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

FieldTypeRequiredDescription
idstringautoPrefixed ID: per-{ulid}
firstNamestringyesGiven name
lastNamestringyesFamily name
emailstringyesPrimary email — must be unique per tenant
displayNamestringautoComputed full name (firstName + ' ' + lastName)
typeenumyesemployee | contractor | vendor | partner | service_account
statusenumautoactive | on_leave | terminated | suspended
departmentstringnoOrganisational department
jobTitlestringnoJob title
managerIdstringnoid of the manager Person
startDatestringnoISO 8601 date
endDatestringnoISO 8601 date — set on offboarding
tagsstring[]noFree-form tags
createdAtstringautoISO 8601 UTC
updatedAtstringautoISO 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')