Skip to main content

Create and manage people

People are entities of type person.

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

Create a person​

const { result: person } = await Person.create(
{ data: { title: 'Dr.', firstName: 'Anja', lastName: 'Lindholm' } },
{ return: true }
)
FieldRequiredNotes
firstNameyes
lastNameyes
titlenoAcademic title: Dr., Prof. Dr., Dr. med., … New values are accepted

As with companies, create validates data against the full Person schema by default, so every field below can be set right at creation time too. This guide adds them with a follow-up update to show that flow. Pass { schema: 'minimal' } as a third option to Person.create() to go back to validating just firstName, lastName and title.

Complete the profile​

update merges into the existing data by default — pass overwrite: true to replace it entirely instead.

await Person.update(person.humanId, {
data: {
salutation: 'formal-female',
birthDate: '1979-03-14',
hasAddress: true,
street: 'Ottenser Hauptstraße',
houseNo: '9',
zipCode: '22765',
city: 'Hamburg',
countryCode: 'DE',
contacts: [
{ contactType: 'email', value: { email: 'anja.lindholm@nordlicht-holding.example' }, isFavorite: true },
{
contactType: 'mobile',
value: { phone: { countryCode: 'DE', dialingCode: '+49', number: '1715550001' } },
isFavorite: false
}
]
}
})
FieldValues
salutationformal-neutral ("Guten Tag"), personal-neutral ("Hallo"), formal-female ("Sehr geehrte Frau"), formal-male ("Sehr geehrter Herr")
birthDateISO date, YYYY-MM-DD
birthName, birthPlace, websitefree text, website must be a URL
contactssee Companies
activefalse to deactivate

Bank data​

await Person.update(person.humanId, {
data: {
hasBank: true,
bankHistory: [
{
bankAccountOwner: 'Anja Lindholm',
iban: 'DE89370400440532013000',
bankValidFrom: '2026-01-01'
}
]
}
})

bankHistory keeps earlier accounts with bankValidFrom and bankValidTill. IBANs are validated.

Create with employments and groups​

await Person.create({
data: { firstName: 'Jonas', lastName: 'Petersen' },
employments: [{ humanId: 'SC-COMPANY', roles: [{ role: 'employee', status: 'active' }] }],
groups: ['Newsletter']
})

Delete and merge​

await Person.delete('SC-PERSON') // { result: 'deleted', humanId: 'SC-PERSON' }

Merging duplicates is available on the REST API, see Person endpoints.

Common patterns​

Find or create by email​

const customers = sdk.asAdmin().Customers()

const findByEmail = async email => {
const { result } = await customers.Entities.search({
entityType: 'person',
filterModel: { logicOperator: 'and', items: [{ field: 'contacts.email', operator: 'equals', value: email }] },
idsOnly: true
})
return result[0]
}

const existing = await findByEmail('anja.lindholm@nordlicht-holding.example')