Skip to main content

Person

Guide: People.

const { Person } = sdk.asAdmin().Customers()

Person.create(body, options?)​

POST /api/v2/entity/person

BodyTypeDescription
dataobjectRequired. Validated against the full Person schema by default (same fields as update, below); firstName and lastName are the only required ones
groupsstring[]Group names
employments[{ humanId, roles }]humanId is the company

Options { return: true }. { schema: 'minimal' } validates against just firstName, lastName and title instead. { strict: true } rejects any field in data not in the schema being validated against.

Person.update(humanId, body)​

PUT /api/v2/entity/person/{humanId}. Body: data (merged by default), overwrite (replace entirely instead of merging), strict (reject unknown fields in data), groups, employments (replace), return.

Updatable fields: active, avatar, salutation, title, firstName, lastName, birthName, birthDate, birthPlace, contacts, website, hasAddress, extra, street, houseNo, zipCode, city, countryCode, location, hasBank, bankHistory.

Person.delete(humanId)​

DELETE /api/v2/entity/person/{humanId}. Status 200, { result: 'deleted', humanId }.

Person.upsertEmployment(personId, ouId, roles, options?)​

POST /api/v2/entity/person/{person}/employments/{ou} with { data: { roles }, return? }.

Person.removeEmployment(personId, ouId)​

DELETE /api/v2/entity/person/{person}/employments/{ou}. Status 200, { result: 'deleted', humanId }.

Data reference​

FieldType / values
salutationformal-neutral, personal-neutral, formal-female, formal-male
birthDateYYYY-MM-DD
contacts[]{ id?, contactType: 'email' | 'phone' | 'mobile' | 'fax', value, isFavorite }
contacts[].valueemail: { email }. Phone: { phone: { countryCode, dialingCode, number } }
hasAddressboolean, true before setting address fields
countryCodeISO code such as DE. Required when hasAddress
bankHistory[]{ bankAccountOwner, iban, bankNote, bankValidFrom, bankValidTill, inherited, inheritedFrom }