Custom fields API
Custom fields are your organization’s own fields of contacts, companies and document packages. This page covers the fields themselves; their values are read and written with the contact, the company and the package, in customFields.
Key permissions
Section titled “Key permissions”The fields of contacts and companies take get_custom_fields (listing them and a field’s usage), create_custom_field, update_custom_field (also their order) and delete_custom_field. The fields of packages, on the same endpoints, take get_package_custom_fields, create_package_custom_field, update_package_custom_field and delete_package_custom_field, given only by whoever holds View documents or Manage custom fields of packages. A key with the operations of one kind is refused with 403 on the fields of the other.
The field object
Section titled “The field object”| Field | Type | Meaning |
|---|---|---|
id |
UUID | The field’s identifier. |
subject |
string | contact, company or document_package. |
key |
string | The name documents and workflows use for it. Never changes. |
labels |
object | The label by language code, such as {"en": "Client number", "pl": "Numer klienta"}. |
helpTexts |
object | The hint by language code; empty without one. |
type |
string | text, date or number. |
sensitive |
boolean | Whether its values are kept encrypted and read only through the sensitive values endpoints. |
mayPrefill |
boolean | Whether a form sent through a personal link may show its value already filled in. |
unique |
boolean | Whether no two records of your organization may hold the same value. Never true for a sensitive field. |
documentTypeIds |
array of UUIDs | For a field of packages, the document types whose packages have it; empty for every type, and always empty for contacts and companies. |
position |
integer | Its place in the subject’s order, from 0. |
createdAt, updatedAt |
time | When it was created and last changed. |
Values
Section titled “Values”A contact and a company carry their values in two fields:
| Field | Type | Meaning |
|---|---|---|
customFields |
object | The values of the fields that are not sensitive, by key. A field without a value is left out. |
sensitiveCustomFields |
array of strings | The keys of the sensitive fields that hold a value. The values themselves are never in a contact or a company: read them from their own endpoint. |
Every value is a string. A date is YYYY-MM-DD; a number is a decimal with a dot, such as 1500.25, kept as written so it is never rounded. To set values, send customFields with Create a contact, Update a contact or the same endpoints of companies: an object by key, where a value is a string or a JSON number, and null or an empty string takes the value away. Keys you leave out keep their values. A key no field has, or a value not of its field’s type, is refused with 422, naming customFields.<key>. Giving a sensitive field needs the read_sensitive_custom_fields operation as well, otherwise the save is refused with 403. A value of a unique field that another contact or company of your organization already holds, compared exactly after trimming, is refused with 409, nothing saved, and detail names who holds it: Anna Nowak already has the value "NB-1042" in "Client number", which must be unique.
curl -X PATCH 'https://api.doxtly.com/v1/contacts/01a1ce96-6be6-7605-b9ad-fb6bfd0af776' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"customFields":{"clientNumber":"NB-1188","contractEnd":"2027-03-31","preferredOffice":"Gdańsk"}}'{ "id": "01a1ce96-6be6-7605-b9ad-fb6bfd0af776", "firstName": "Jonas", "lastName": "Berg", "fullName": "Jonas Berg", "email": "jonas.berg@nordvik-marine.example", "phone": null, "jobTitle": null, "companyName": "Nordvik Marine AS", "company": { "id": "01a1ccda-2ad5-70dd-aa62-48bede3a76f7", "name": "Nordvik Marine AS" }, "language": null, "type": null, "photoId": null, "customFields": { "clientNumber": "NB-1188", "preferredOffice": "Gdańsk", "contractEnd": "2027-03-31" }, "sensitiveCustomFields": [], "createdAt": "2026-11-12T08:08:46+01:00", "updatedAt": "2026-11-12T08:08:47+01:00"}List fields
Section titled “List fields”GET/v1/custom_fields?subject=contact
Key permission: get_custom_fields. subject is contact, company or document_package, required. Returns 200 OK with items, the subject’s fields in their order. Not paged. A subject missing or wrong answers 422.
curl 'https://api.doxtly.com/v1/custom_fields?subject=contact' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"{ "items": [ { "id": "01a1ccda-20ca-7f02-92a1-46e9a6cf9a20", "subject": "contact", "key": "clientNumber", "labels": { "en": "Client number", "pl": "Numer klienta" }, "helpTexts": { "en": "As on our invoices, e.g. NB-1042.", "pl": "Jak na naszych fakturach, np. NB-1042." }, "type": "text", "sensitive": false, "mayPrefill": true, "unique": false, "documentTypeIds": [], "position": 0, "createdAt": "2026-11-12T00:03:29+01:00", "updatedAt": "2026-11-12T00:03:29+01:00" }, { "id": "01a1ccda-2151-79ec-bd9e-57bbe6d2c85d", "subject": "contact", "key": "contractEnd", "labels": { "en": "Contract end", "pl": "Koniec umowy" }, "helpTexts": {}, "type": "date", "sensitive": false, "mayPrefill": true, "unique": false, "documentTypeIds": [], "position": 2, "createdAt": "2026-11-12T00:03:29+01:00", "updatedAt": "2026-11-12T08:06:59+01:00" } ]}Shortened: each list shows its first items.
Create a field
Section titled “Create a field”POST/v1/custom_fields
Key permission: create_custom_field
| Field | Type | Required | Rules |
|---|---|---|---|
subject |
string | Yes | contact, company or document_package. |
key |
string | Yes | A letter, then letters, digits and underscores, up to 64. Not a built-in field’s name, such as email or city, and no other field’s key of the subject in any letter case. |
labels |
object | Yes | Up to 100 characters each, with the label in your organization’s language. |
helpTexts |
object | No | Up to 300 characters each. |
type |
string | Yes | text, date or number. |
sensitive |
boolean | No | false when left out. |
mayPrefill |
boolean | No | The opposite of sensitive when left out. |
unique |
boolean | No | false when left out. Refused with 422 together with sensitive: true. |
documentTypeIds |
array of UUIDs | No | Only for document_package: your organization’s document types, each kept once; empty or left out for every type. A type of another organization or none, or any type for contact or company, is refused with 422. |
Returns 201 Created with the field, placed after the subject’s last one. 422 names each field that is wrong, or says the subject has 50 fields already.
curl -X POST 'https://api.doxtly.com/v1/custom_fields' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"subject":"contact","key":"preferredOffice","labels":{"en":"Preferred office","pl":"Preferowane biuro"},"type":"text"}'{ "id": "01a1ce96-69d5-7dad-b273-24c37af193a3", "subject": "contact", "key": "preferredOffice", "labels": { "en": "Preferred office", "pl": "Preferowane biuro" }, "helpTexts": {}, "type": "text", "sensitive": false, "mayPrefill": true, "unique": false, "documentTypeIds": [], "position": 5, "createdAt": "2026-11-12T08:08:46+01:00", "updatedAt": "2026-11-12T08:08:46+01:00"}Update a field
Section titled “Update a field”PATCH/v1/custom_fields/{id}
Key permission: update_custom_field. Takes labels, helpTexts, type, sensitive, mayPrefill, unique and documentTypeIds; a field left out stays as it is, and subject and key never change. Returns 200 OK with the field.
- A new
typeis refused with409while any value is not of it, saying how many are not. unique: trueis refused with409while two records share a value, naming up to five of them, and with422for a sensitive field.sensitive: trueis refused with422for a unique field.- Changing
sensitivemoves the values already entered, in the background. Until that is done, each value is already returned as the field now says: amongcustomFields, or only by its key insensitiveCustomFields.
curl -X PATCH 'https://api.doxtly.com/v1/custom_fields/01a1ce96-69d5-7dad-b273-24c37af193a3' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"helpTexts":{"en":"Where the client prefers to meet.","pl":"Gdzie klient woli się spotykać."}}'{ "id": "01a1ce96-69d5-7dad-b273-24c37af193a3", "subject": "contact", "key": "preferredOffice", "labels": { "en": "Preferred office", "pl": "Preferowane biuro" }, "helpTexts": { "en": "Where the client prefers to meet.", "pl": "Gdzie klient woli się spotykać." }, "type": "text", "sensitive": false, "mayPrefill": true, "unique": false, "documentTypeIds": [], "position": 5, "createdAt": "2026-11-12T08:08:46+01:00", "updatedAt": "2026-11-12T08:08:46+01:00"}Order the fields
Section titled “Order the fields”PUT/v1/custom_fields/order
Key permission: update_custom_field. Takes subject and ids, the identifiers of all the subject’s fields in their new order, each once. Returns 200 OK with items in that order, or 422 when ids misses a field or names one twice.
curl -X PUT 'https://api.doxtly.com/v1/custom_fields/order' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"subject":"contact","ids":["01a1ccda-20ca-7f02-92a1-46e9a6cf9a20","01a1ce96-69d5-7dad-b273-24c37af193a3","01a1ccda-2151-79ec-bd9e-57bbe6d2c85d","01a1ccda-21f4-7436-adfe-6ea931e1ef48","01a1ccda-22fb-7afd-a678-7068e87037b0"]}'{ "items": [ { "id": "01a1ccda-20ca-7f02-92a1-46e9a6cf9a20", "subject": "contact", "key": "clientNumber", "labels": { "en": "Client number", "pl": "Numer klienta" }, "helpTexts": { "en": "As on our invoices, e.g. NB-1042.", "pl": "Jak na naszych fakturach, np. NB-1042." }, "type": "text", "sensitive": false, "mayPrefill": true, "unique": false, "documentTypeIds": [], "position": 0, "createdAt": "2026-11-12T00:03:29+01:00", "updatedAt": "2026-11-12T00:03:29+01:00" }, { "id": "01a1ce96-69d5-7dad-b273-24c37af193a3", "subject": "contact", "key": "preferredOffice", "labels": { "en": "Preferred office", "pl": "Preferowane biuro" }, "helpTexts": { "en": "Where the client prefers to meet.", "pl": "Gdzie klient woli się spotykać." }, "type": "text", "sensitive": false, "mayPrefill": true, "unique": false, "documentTypeIds": [], "position": 1, "createdAt": "2026-11-12T08:08:46+01:00", "updatedAt": "2026-11-12T08:08:46+01:00" }, { "id": "01a1ccda-2151-79ec-bd9e-57bbe6d2c85d", "subject": "contact", "key": "contractEnd", "labels": { "en": "Contract end", "pl": "Koniec umowy" }, "helpTexts": {}, "type": "date", "sensitive": false, "mayPrefill": true, "unique": false, "documentTypeIds": [], "position": 2, "createdAt": "2026-11-12T00:03:29+01:00", "updatedAt": "2026-11-12T08:06:59+01:00" } ]}Shortened: each list shows its first items.
Count a field’s values
Section titled “Count a field’s values”GET/v1/custom_fields/{id}/usage
Key permission: get_custom_fields. Returns 200 OK with valueCount, how many contacts, companies or packages hold a value of the field: what deleting it takes away; and usages, each a list of {id, name}: the templates that fill documents from it, the forms whose field defaults name it and the workflows whose steps read it - what deleting it leaves pointing at nothing.
curl 'https://api.doxtly.com/v1/custom_fields/01a1ccda-20ca-7f02-92a1-46e9a6cf9a20/usage' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"{ "valueCount": 11, "usages": { "templates": [ { "id": "01a1ccdb-d975-7002-b9c9-59f4e38b4e16", "name": "Engagement letter" } ], "forms": [ { "id": "01a1cce5-dbee-755c-901a-5959e5655e36", "name": "Client details check" } ], "workflows": [] }}Delete a field
Section titled “Delete a field”DELETE/v1/custom_fields/{id}
Key permission: delete_custom_field. Returns 204 No Content. The field is gone at once, and its values are taken from every contact, company or package in the background. Until they are, its key cannot be used for a new field.
curl -X DELETE 'https://api.doxtly.com/v1/custom_fields/01a1ce96-69d5-7dad-b273-24c37af193a3' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"Read sensitive values
Section titled “Read sensitive values”GET/v1/contacts/{id}/sensitive_fields
GET/v1/companies/{id}/sensitive_fields
Key permission: read_sensitive_custom_fields. Returns 200 OK with customFields, the values of the contact’s or company’s sensitive fields by key, without the ordinary ones. A key given this operation may also write sensitive values with create_contact, update_contact, create_company or update_company.
curl 'https://api.doxtly.com/v1/contacts/01a1ccda-309f-71ec-93f3-dc28d5e4c19d/sensitive_fields' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"{ "customFields": { "idDocumentNumber": "533018762" }}Errors
Section titled “Errors”| Status | When |
|---|---|
403 |
The key lacks the operation, or writes a sensitive field without read_sensitive_custom_fields. |
404 |
No field of that id in your organization, or one already deleted. |
409 |
The type cannot change: some values are not of the new type. The field cannot be made unique: some records share a value. A value of a unique field is held by another record. |
422 |
A field or a value is wrong; the response names each one. |