Skip to content

Contact types API

A contact type sorts contacts into groups such as Customer or Supplier. A contact has one type or none.

Field Type Meaning
id UUID The type’s identifier.
name string Its name.
contactCount integer How many contacts are of it.
workflowCount integer How many workflows name it.
createdAt time When it was created.

GET/v1/contact_types

Key permission: get_contact_types. Returns 200 OK with items, sorted by name, and untypedCount, how many contacts have no type. Not paged.

Terminal window
curl 'https://api.doxtly.com/v1/contact_types' \
-H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"
{
"items": [
{
"id": "01a1ccda-1b78-73fc-a307-83e0e331a14b",
"name": "Client",
"contactCount": 13,
"workflowCount": 0,
"createdAt": "2026-11-12T00:03:28+01:00"
},
{
"id": "01a1ccda-1fc8-7c1b-b0ce-d1da49e117e9",
"name": "Partner",
"contactCount": 2,
"workflowCount": 0,
"createdAt": "2026-11-12T00:03:29+01:00"
}
],
"untypedCount": 1
}

Shortened: each list shows its first items.

POST/v1/contact_types

Key permission: create_contact_type. Takes name, required, up to 100 characters, unique in your organization whatever its letter case. Returns 201 Created with the type. 422 when the name is taken or your organization has 100 types already.

Terminal window
curl -X POST 'https://api.doxtly.com/v1/contact_types' \
-H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \
-H 'Content-Type: application/json' \
-d '{"name":"Subcontractor"}'
{
"id": "01a1ce96-67ae-7392-b778-f04fbc2c2bef",
"name": "Subcontractor",
"contactCount": 0,
"workflowCount": 0,
"createdAt": "2026-11-12T08:08:45+01:00"
}

PATCH/v1/contact_types/{id}

Key permission: update_contact_type. Takes name, by the same rules. Returns 200 OK with the type, 422 when the name is taken by another type.

Terminal window
curl -X PATCH 'https://api.doxtly.com/v1/contact_types/01a1ce96-67ae-7392-b778-f04fbc2c2bef' \
-H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \
-H 'Content-Type: application/json' \
-d '{"name":"Subcontractors"}'
{
"id": "01a1ce96-67ae-7392-b778-f04fbc2c2bef",
"name": "Subcontractors",
"contactCount": 0,
"workflowCount": 0,
"createdAt": "2026-11-12T08:08:45+01:00"
}

DELETE/v1/contact_types/{id}

Key permission: delete_contact_type. Contacts of the type are left without one. While a workflow names the type, deleting it answers 409 with code used_by_workflows and workflows (their id and name): change them first. Returns 204 No Content. An id that isn’t one of your types answers 404, here and in rename.

Terminal window
curl -X DELETE 'https://api.doxtly.com/v1/contact_types/01a1ce96-67ae-7392-b778-f04fbc2c2bef' \
-H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"