Customers REST API
Sync your service desk customers and their custom fields from your own systems
The customers API lets your own systems keep the service desk's customers (the people who raise tickets) up to date: list and read customers, create them and update them, with their custom fields and the company they belong to. It is a plain JSON API over HTTPS, called with a project API key.
It is a thin layer over the rules the app uses. An email address or your own customer id cannot belong to two customers, a custom field value must fit its field, and what you change appears in the project's activity feed with the name of the key that made the change. It works the same way as the Companies REST API.
This page is the guide. The API reference lists every endpoint with its parameters and fields, and has the OpenAPI spec to download. Customers cannot be deleted through the API. Read more: Sync service desk customers from your own systems.
https://decuga.com/api/v1/projects/{projectId}Authentication
Create a key in the project under Integrations → API Keys. The key is shown once; copy it then. Send it as a bearer token on every request:
Authorization: Bearer dck_...The same key can sign one of your customers in to the helpdesk without an emailed code: see helpdesk auto-login. That call finds the customer by email address and makes them if they are new; this API is how you keep the rest of what you know about them, and your own id for them, on the same record.
Endpoints
Every path starts with /api/v1/projects/{projectId}. Where a path says {customer}, use the customer's id.
| Method and path | What it does |
|---|---|
GET /customers | List customers by name, 50 a page, reached by cursor. Narrow by one of name (starts with), email, externalId or updatedSince. |
GET /customers/{customer} | One customer. |
POST /customers | Create a customer. Needs a name and an email address. Answers 201 with the customer. |
PATCH /customers/{customer} | Update a customer. Fields you leave out stay as they are. |
PUT /customers/external/{externalId} | Create or update the customer with your own id. Safe to repeat. Answers 201 if it created the customer and 200 if it updated one. |
GET /customer-fields | The custom fields a customer can have, with their types and options. |
The customer object
These field names are part of the API's promise: new fields may be added, but these will not be renamed or removed.
| Field | Meaning |
|---|---|
| id | The customer's id. |
| externalId | Your own id for the person in your systems, if you gave one. Unique in the project. |
| name | The customer's name. |
| The customer's email address, always in lower case. Unique in the project. | |
| phone | The customer's phone number, or null. |
| companyId, companyName | The company the customer belongs to, or null. |
| customFields | Custom field values by field name. Only fields that have a value are listed. |
| createdAt, updatedAt | Times in UTC. |
To create, send a name and an email; phone, externalId, the company and customFields are optional. To update, send only what changes. To empty a phone number, an external id, the company or a custom field value, send an empty string.
The company is given by companyId, or by companyExternalId: the external id you gave the company in the Companies API. Send one of them, not both. A companyId that is not a company of the project is refused with 404, and a companyExternalId that no company has with 400. An update that leaves the company out keeps it.
Custom fields
A project's customer custom fields are set up in the service desk, under Tickets → Customers → Custom Fields. Call GET /customer-fields to see them: each has a name, a type and, for choices, its options. Send values in customFields by the field's name (any case), or by its id:
"customFields": { "Plan": "Pro", "Preferred language": "Hindi", "Customer since": "2024-03-01" }A field you name that does not exist is refused, so a typo is never silently dropped. Every value is sent as text and checked against the field's type:
| Type | What a value looks like |
|---|---|
| TEXT | Any text. |
| NUMBER, CURRENCY | A number, such as 40 or 2500.50. For CURRENCY send the amount without the symbol. |
| DATE | A date written 2026-12-31. |
| SELECT | Exactly one of the field's options. |
| MULTI_SELECT | Options separated by commas, each one of the field's options. |
| TAGS | Any words separated by commas, such as Gold, Renewal due. At most 50 tags of 40 characters each; a tag written twice is kept once. |
| CHECKBOX | true, or false to clear it. |
| URL | An address starting with http:// or https://. |
| EMAIL, PHONE | An email address, or a phone number such as +91 22 5550 0100. |
| RATING | A whole number from 1 to 5. |
| PROGRESS | A whole number from 0 to 100. |
A value can be at most 100 characters (a TAGS value is limited by its tags instead, as above). Fields left out of a request keep their value.
Syncing safely
To keep customers in step with another system, give each person your own id as their externalId and use PUT /customers/external/{externalId}. The call makes the customer with that id match what you send: it updates it if there is one and creates it if there is not. Sending the same call twice does not make a second customer, so a sync can be retried after a failure without checking first.
The id in the path is the customer's external id. If you also send an externalId in the body it must be the same. To create a customer this way you must send a name and an email.
externalId. It answers 200, not 201, because it did not create anyone. After that first call the customer has your id, so every later call finds it by that. A customer that already has a different external id is never taken: that is someone else's record, and the call is refused with 409.updatedSince, for example ?updatedSince=2026-11-21T10:00:00Z, or a date such as 2026-11-21.Examples
See the fields a customer can have:
curl "https://decuga.com/api/v1/projects/$PROJECT_ID/customer-fields" \
-H "Authorization: Bearer $DECUGA_API_KEY"Create or update a customer by your own id, in a company you know by its own id, with custom field values:
curl -X PUT "https://decuga.com/api/v1/projects/$PROJECT_ID/customers/external/USR-2231" \
-H "Authorization: Bearer $DECUGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Meera Nair","email":"[email protected]","companyExternalId":"CRM-1042","customFields":{"Plan":"Pro","Preferred language":"Hindi"}}'The answer is the customer:
{
"id": "5c1e0c6e-3a2b-4c4d-8e9f-0a1b2c3d4e5f",
"externalId": "USR-2231",
"name": "Meera Nair",
"email": "[email protected]",
"phone": null,
"companyId": "0b8c1f1e-4d57-4c8f-9d52-6a1d2f3a4b5c",
"companyName": "Acme Corp",
"customFields": { "Preferred language": "Hindi", "Plan": "Pro" },
"createdAt": "2026-11-24T10:00:00",
"updatedAt": "2026-11-24T10:00:00"
}Change one value, clear another and take the customer out of its company:
curl -X PATCH "https://decuga.com/api/v1/projects/$PROJECT_ID/customers/$CUSTOMER_ID" \
-H "Authorization: Bearer $DECUGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"companyId":"","customFields":{"Plan":"Free","Preferred language":""}}'Find the customers that changed today, the oldest change first:
curl "https://decuga.com/api/v1/projects/$PROJECT_ID/customers?updatedSince=2026-11-24&limit=100" \
-H "Authorization: Bearer $DECUGA_API_KEY"A list comes a page at a time. The answer carries nextCursor when there is another page: pass it as cursor to get that page, and keep going until there is no nextCursor. prevCursor goes back. With updatedSince the oldest change comes first, so a sync can read on from where it stopped. Use one filter at a time: asking for two (for example a name and an email) is refused with 400.
curl "https://decuga.com/api/v1/projects/$PROJECT_ID/customers?cursor=a:3f2a9c1e-0000-4000-8000-000000000001" \
-H "Authorization: Bearer $DECUGA_API_KEY"Errors
An error answers with a JSON body of the form {"error": "..."}. A message about a value names the field it is about.
| Status | When |
|---|---|
| 400 | The request is not valid: a missing name or email address, an address that is not an address, both companyId and companyExternalId, a company external id nobody has, a custom field that does not exist, or a value that does not fit its field (for example Seats: "many" is not a number). |
| 401 | No key, or a key that is wrong or has been revoked. |
| 403 | The key is for another project, the account is below the Business plan, or the key's person lacks the permission to see or manage the service desk. |
| 404 | No such customer in this project, or a companyId that is not a company of it. |
| 409 | The email address or the external id already belongs to another customer, or the upsert found the customer with that email address but it has a different external id. The message names it. |
| 429 | Too many requests: the key or its project is over its limit for this minute. Wait Retry-After seconds. |
Limits
| What | Limit |
|---|---|
| Requests | 60 a minute for each API key and 600 a minute for a project, the same as the task API. Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. |
| Page size | 50 customers a page unless you ask, at most 100 (?limit=). A page is reached with the cursor the one before returned. |
| Custom fields | At most 50 customer fields in a project, with names of up to 32 characters. |
| A value | At most 100 characters. A TAGS field holds up to 50 tags of 40 characters each. |
| Name, email, phone, external id | A name of up to 200 characters, an email address of up to 254, a phone number of up to 50, an external id of up to 100. |
FAQ
Can I delete a customer through the API?
No. Delete a customer in the app.
Whose name is on a change?
In the activity feed it is the key's name followed by (API), so a change made by an integration can be told from one made by hand. The key still acts with the access of the person who created it.
Can I create the custom fields through the API?
Not yet. Create them in the service desk under Tickets, Customers, Custom Fields; then send values for them here.
Does this show the custom fields to customers?
No. Customer custom fields are for your team only and are never shown in the helpdesk portal.
Does this email my customers?
No. The API reads and writes the customer records; it sends nothing.
Why is a customer I did not create already there?
Customers are made when they raise a ticket through the helpdesk portal, or sign in through the helpdesk session call. The first upsert for such a person takes them by their email address and gives them your external id, so there is no second record.