People
Base: https://crm-service.<domain>/api/v2/entity/person.
Create
/api/v2/entity/personcrm-service- curl
- JavaScript
- Python
- R
curl -s https://crm-service.scenid.cloud/api/v2/entity/person \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"data": { "title": "Dr.", "firstName": "Anja", "lastName": "Lindholm" },
"employments": [{ "humanId": "SC-COMPANY", "roles": [{ "role": "ceo", "status": "active" }] }],
"groups": [{ "humanId": "SC-GROUP1" }],
"return": true
}'
const response = await fetch('https://crm-service.scenid.cloud/api/v2/entity/person', {
method: 'POST',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
data: { title: 'Dr.', firstName: 'Anja', lastName: 'Lindholm' },
employments: [{ humanId: 'SC-COMPANY', roles: [{ role: 'ceo', status: 'active' }] }],
groups: [{ humanId: 'SC-GROUP1' }],
return: true
})
})
console.log(response.status, await response.json())
import requests
response = requests.post(
"https://crm-service.scenid.cloud/api/v2/entity/person",
headers={"Authorization": f"Bearer {token}"},
json={
"data": {"title": "Dr.", "firstName": "Anja", "lastName": "Lindholm"},
"employments": [
{
"humanId": "SC-COMPANY",
"roles": [{"role": "ceo", "status": "active"}],
},
],
"groups": [{"humanId": "SC-GROUP1"}],
"return": True,
},
)
print(response.status_code, response.json())
library(httr2)
response <- request("https://crm-service.scenid.cloud/api/v2/entity/person") |>
req_auth_bearer_token(token) |>
req_body_json(list(
data = list(title = "Dr.", firstName = "Anja", lastName = "Lindholm"),
employments = list(
list(
humanId = "SC-COMPANY",
roles = list(list(role = "ceo", status = "active"))
)
),
groups = list(list(humanId = "SC-GROUP1")),
return = TRUE
)) |>
req_error(is_error = \(r) FALSE) |>
req_perform()
resp_status(response)
resp_body_json(response)
data is validated against the full Person schema by default (the same fields in Data fields below) — firstName and lastName are the only required ones. Pass "schema": "minimal" to validate against just those two plus title instead, matching the old create-only behavior. Pass "strict": true to reject any field not in the schema being validated against. employments[].humanId is the company. Response 201: { "result": "OK", "humanId": "..." } or the entity.
Update
/api/v2/entity/person/{humanId}crm-service- curl
- JavaScript
- Python
- R
curl -s -X PUT https://crm-service.scenid.cloud/api/v2/entity/person/SC-PERSON \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"data": {
"salutation": "formal-female",
"birthDate": "1979-03-14",
"hasAddress": true, "street": "Ottenser Hauptstraße", "houseNo": "9",
"zipCode": "22765", "city": "Hamburg", "countryCode": "DE",
"contacts": [
{ "contactType": "mobile", "value": { "phone": { "countryCode": "DE", "dialingCode": "+49", "number": "1715550001" } }, "isFavorite": false }
]
}
}'
const response = await fetch('https://crm-service.scenid.cloud/api/v2/entity/person/SC-PERSON', {
method: 'PUT',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
data: {
salutation: 'formal-female',
birthDate: '1979-03-14',
hasAddress: true,
street: 'Ottenser Hauptstraße',
houseNo: '9',
zipCode: '22765',
city: 'Hamburg',
countryCode: 'DE',
contacts: [
{
contactType: 'mobile',
value: {
phone: { countryCode: 'DE', dialingCode: '+49', number: '1715550001' }
},
isFavorite: false
}
]
}
})
})
console.log(response.status, await response.json())
import requests
response = requests.put(
"https://crm-service.scenid.cloud/api/v2/entity/person/SC-PERSON",
headers={"Authorization": f"Bearer {token}"},
json={
"data": {
"salutation": "formal-female",
"birthDate": "1979-03-14",
"hasAddress": True,
"street": "Ottenser Hauptstraße",
"houseNo": "9",
"zipCode": "22765",
"city": "Hamburg",
"countryCode": "DE",
"contacts": [
{
"contactType": "mobile",
"value": {
"phone": {"countryCode": "DE", "dialingCode": "+49", "number": "1715550001"},
},
"isFavorite": False,
},
],
},
},
)
print(response.status_code, response.json())
library(httr2)
response <- request("https://crm-service.scenid.cloud/api/v2/entity/person/SC-PERSON") |>
req_auth_bearer_token(token) |>
req_method("PUT") |>
req_body_json(list(
data = list(
salutation = "formal-female",
birthDate = "1979-03-14",
hasAddress = TRUE,
street = "Ottenser Hauptstraße",
houseNo = "9",
zipCode = "22765",
city = "Hamburg",
countryCode = "DE",
contacts = list(
list(
contactType = "mobile",
value = list(
phone = list(countryCode = "DE", dialingCode = "+49", number = "1715550001")
),
isFavorite = FALSE
)
)
)
)) |>
req_error(is_error = \(r) FALSE) |>
req_perform()
resp_status(response)
resp_body_json(response)
data is merged into the existing data by default — pass "overwrite": true to replace it entirely instead (fields present on the entity but absent from data are then deleted). Pass "strict": true to reject any field in data not in the Person schema. employments and groups, when present, replace the entity's lists. Response 200 { "result": "OK", "humanId": "..." }.
Delete
/api/v2/entity/person/{humanId}crm-service200 { "result": "deleted", "humanId": "..." }.
Add or change an employment
/api/v2/entity/person/{humanId}/employments/{ouHumanId}crm-serviceBody { "data": { "roles": [{ "role": "employee", "status": "active" }] } }.
Remove an employment
/api/v2/entity/person/{humanId}/employments/{ouHumanId}crm-serviceSet employments in bulk
/api/v2/entity/person/{humanId}/employmentscrm-serviceBody: array [{ "humanId": "<company>", "roles": [...] }]. Not wrapped by the SDK.
Merge two people
/api/v2/entity/person/{humanId}/mergecrm-serviceMerges the partnerHumanId into the person in the path (the target). Not wrapped by the SDK.
{
"partnerHumanId": "SC-DUPLICATE",
"data": { "firstName": "Anja", "lastName": "Lindholm" },
"employments": [{ "humanId": "SC-COMPANY", "roles": [{ "role": "ceo", "status": "active" }] }],
"groups": []
}
data is the resulting merged data (validated like an update). Response { "result": "OK", "humanId": "…" }. Errors: person/merge-partner-missing, person/merge-target-equals-partner, entity/data-invalid, entity/wrong-entity-type.
Data fields
| Field | Values |
|---|---|
salutation | formal-neutral, personal-neutral, formal-female, formal-male |
birthDate | YYYY-MM-DD |
contacts[] | { contactType: email|phone|mobile|fax, value, isFavorite } |
hasAddress | boolean |
countryCode | ISO code. Required when hasAddress |
hasBank, bankHistory[] | Bank data with validated IBAN |