Groups
Base: https://crm-service.<domain>/api/v2/entity/group.
Create
/api/v2/entity/groupcrm-service- curl
- JavaScript
- Python
- R
curl -s https://crm-service.scenid.cloud/api/v2/entity/group \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"data": { "name": "Key accounts", "groupType": "manual", "labels": ["vip", "sales"] },
"members": [{ "humanId": "SC-COMPANY" }],
"return": true
}'
const response = await fetch('https://crm-service.scenid.cloud/api/v2/entity/group', {
method: 'POST',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
data: { name: 'Key accounts', groupType: 'manual', labels: ['vip', 'sales'] },
members: [{ humanId: 'SC-COMPANY' }],
return: true
})
})
console.log(response.status, await response.json())
import requests
response = requests.post(
"https://crm-service.scenid.cloud/api/v2/entity/group",
headers={"Authorization": f"Bearer {token}"},
json={
"data": {
"name": "Key accounts",
"groupType": "manual",
"labels": ["vip", "sales"],
},
"members": [{"humanId": "SC-COMPANY"}],
"return": True,
},
)
print(response.status_code, response.json())
library(httr2)
response <- request("https://crm-service.scenid.cloud/api/v2/entity/group") |>
req_auth_bearer_token(token) |>
req_body_json(list(
data = list(
name = "Key accounts",
groupType = "manual",
labels = list("vip", "sales")
),
members = list(list(humanId = "SC-COMPANY")),
return = TRUE
)) |>
req_error(is_error = \(r) FALSE) |>
req_perform()
resp_status(response)
resp_body_json(response)
data.name is required and unique (entity/group-already-exists). groupType is manual (default) or filter. members is a list of objects { humanId }. data is validated against the full Group schema by default; pass "schema": "minimal" to validate against just name instead, or "strict": true to reject any field not in the schema being validated against. Response 201: { "result": "OK", "humanId": "..." } or the entity with return.
Update
/api/v2/entity/group/{humanId}crm-serviceBody: data, overwrite, strict, config, features, return. data is merged into the existing data by default — overwrite: true replaces it entirely instead (fields present on the entity but absent from data are then deleted). strict: true rejects any field in data not in the Group schema. Response 200 { "result": "OK", "humanId": "..." }. Errors: entity/data-missing, group/config-invalid, group/features-invalid, entity/group-already-exists.
Delete
/api/v2/entity/group/{humanId}crm-service200 { "result": "deleted", "humanId": "..." }.
Add a member
/api/v2/entity/group/{groupHumanId}/members/{targetHumanId}crm-servicePUT works too. The body is ignored, except return. Response { "result": "OK", "humanId": "..." }. The target can be a company or a person.
Remove a member
/api/v2/entity/group/{groupHumanId}/members/{targetHumanId}crm-service200 { "result": "deleted", "humanId": "..." }.
Other group endpoints
The Customers app uses more group routes that the SDK does not wrap: /{humanId}/members (bulk add), /{humanId}/members/remove, /{humanId}/members/refresh, /{humanId}/members/diff, /{humanId}/head, /{humanId}/features. Feature routes need customers.group.manage, and the acl feature needs owner or customers.admin.