People
The People domain stores Person entities: employees, contractors, service accounts, and external users. Each person is a central node in the EDM graph, linkable to groups, licences, assets, and risk findings.
Person Schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | auto | Prefixed ID: per-{ulid} |
firstName | string | yes | Given name |
lastName | string | yes | Family name |
email | string | yes | Primary email — must be unique per tenant |
displayName | string | auto | Computed full name (firstName + ' ' + lastName) |
type | enum | yes | employee | contractor | vendor | partner | service_account |
status | enum | auto | active | on_leave | terminated | suspended |
department | string | no | Organisational department |
jobTitle | string | no | Job title |
managerId | string | no | id of the manager Person |
startDate | string | no | ISO 8601 date |
endDate | string | no | ISO 8601 date — set on offboarding |
tags | string[] | no | Free-form tags |
createdAt | string | auto | ISO 8601 UTC |
updatedAt | string | auto | ISO 8601 UTC |
List People
import { CpodClient } from '@cpod/sdk'
const sdk = new CpodClient({ apiKey: process.env.CPOD_API_KEY! })
// All active employees, newest first
const result = await sdk.people.list({
type: 'employee',
status: 'active',
pageSize: 50,
})
for (const person of result.data) {
console.log(person.id, person.displayName, person.email)
}
// Paginate
if (result.hasMore) {
const page2 = await sdk.people.list({ page: 2, pageSize: 50 })
}Get a Person
const person = await sdk.people.get('per-abc123')
// → Person
// With related entities expanded
const full = await sdk.people.get('per-abc123', {
expand: ['groups', 'licenses'],
})
// full.groups → Group[]
// full.licenses → LicenseAssignment[]Create a Person
const created = await sdk.people.create({
firstName: 'Alice',
lastName: 'Smith',
email: 'alice@acme.com',
type: 'employee',
department: 'Engineering',
jobTitle: 'Senior Engineer',
startDate: '2024-03-01',
})
// created.id → "per-01HXYZ..."Update a Person
const updated = await sdk.people.update('per-abc123', {
jobTitle: 'Staff Engineer',
department: 'Platform',
})Deactivate a Person
⚠️
deactivate() transitions the person’s status to terminated. It does not revoke entitlements automatically — use client.technology.revokeEntitlement() for each active entitlement first. Hard deletion requires a support request.
// Offboard: set endDate then deactivate
await sdk.people.update('per-abc123', {
endDate: new Date().toISOString().slice(0, 10),
})
await sdk.people.deactivate('per-abc123')