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.

The customers API is on the Business plan and above, the same as project API keys and the customer custom fields.

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_...
A key acts as the person who created it. To read customers it needs the permission to see tickets; to create or change them, the permission to manage the service desk. A key made by someone without it is refused with 403. If that person leaves the project or loses the permission, the key loses it too. Keep a key secret: anyone who has it can do what it can.

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 pathWhat it does
GET /customersList 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 /customersCreate 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-fieldsThe 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.

FieldMeaning
idThe customer's id.
externalIdYour own id for the person in your systems, if you gave one. Unique in the project.
nameThe customer's name.
emailThe customer's email address, always in lower case. Unique in the project.
phoneThe customer's phone number, or null.
companyId, companyNameThe company the customer belongs to, or null.
customFieldsCustom field values by field name. Only fields that have a value are listed.
createdAt, updatedAtTimes 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:

TypeWhat a value looks like
TEXTAny text.
NUMBER, CURRENCYA number, such as 40 or 2500.50. For CURRENCY send the amount without the symbol.
DATEA date written 2026-12-31.
SELECTExactly one of the field's options.
MULTI_SELECTOptions separated by commas, each one of the field's options.
TAGSAny words separated by commas, such as Gold, Renewal due. At most 50 tags of 40 characters each; a tag written twice is kept once.
CHECKBOXtrue, or false to clear it.
URLAn address starting with http:// or https://.
EMAIL, PHONEAn email address, or a phone number such as +91 22 5550 0100.
RATINGA whole number from 1 to 5.
PROGRESSA 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.

Customers that were there before your sync. The upsert looks for the customer with your external id first. If none has it, it takes the customer with the email address you send, when that customer has no external id yet (for example someone who raised a ticket through the portal), updates it and gives it your 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.
To fetch only what changed since your last sync, list with 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.

StatusWhen
400The 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).
401No key, or a key that is wrong or has been revoked.
403The 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.
404No such customer in this project, or a companyId that is not a company of it.
409The 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.
429Too many requests: the key or its project is over its limit for this minute. Wait Retry-After seconds.

Limits

WhatLimit
Requests60 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 size50 customers a page unless you ask, at most 100 (?limit=). A page is reached with the cursor the one before returned.
Custom fieldsAt most 50 customer fields in a project, with names of up to 32 characters.
A valueAt most 100 characters. A TAGS field holds up to 50 tags of 40 characters each.
Name, email, phone, external idA 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.