Companies REST API
Sync your service desk companies and their custom fields from your own systems
The companies API lets your own systems keep the service desk's companies up to date: list and read companies, create them and update them, with their custom fields. 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. A domain or your own company id cannot belong to two companies, 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.
This page is the guide. The API reference lists every endpoint with its parameters and fields, and has the OpenAPI spec to download. Companies cannot be deleted through the API yet.
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 project API key can also sign your own customers in to the helpdesk, and the externalId you give a company here is how you tell Decuga which company a customer belongs to: see helpdesk auto-login. The key stays on your server there too.
Endpoints
Every path starts with /api/v1/projects/{projectId}. Where a path says {company}, use the company's id.
| Method and path | What it does |
|---|---|
GET /companies | List companies by name, 50 a page, reached by cursor. Narrow by one of name (starts with), domain, externalId or updatedSince. |
GET /companies/{company} | One company. |
GET /companies/external/{externalId} | One company, by your own id. Answers 404 when no company has it. |
POST /companies | Create a company. Needs a name. Answers 201 with the company. |
PATCH /companies/{company} | Update a company. Fields you leave out stay as they are. |
PUT /companies/external/{externalId} | Create or update the company with your own id. Safe to repeat. Answers 201 if it created the company and 200 if it updated one. |
GET /company-fields | The custom fields a company can have, with their types and options. |
The company 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 company's id. |
| externalId | Your own id for the company in your systems, if you gave one. Unique in the project. |
| name | The company's name. |
| domain | The email domain used to match customers to the company, always in lower case, or null. Unique in the project. |
| customerCount | How many customers belong to the company. Read only. |
| emails | The addresses the company is emailed at, in lower case. Empty only for a company created before addresses were kept. |
| emailOptOut | True when the company asked not to be emailed. |
| 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 at least one address in emails; domain, externalId and customFields are optional. To update, send only what changes. The emails you send replace the addresses kept, and there must still be at least one. To empty a domain, an external id or a custom field value, send an empty string.
Custom fields
A project's company custom fields are set up in the service desk, under Tickets → Companies → Custom Fields. Call GET /company-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": { "Account Tier": "Gold", "Seats": "40", "Renewal": "2026-12-31" }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 companies in step with another system, give each company your own id as its externalId and use PUT /companies/external/{externalId}. The call makes the company 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 company, so a sync can be retried after a failure without checking first.
To read one company by your own id, use GET /companies/external/{externalId}: it answers with the company, or 404 when no company has that id.
The id in the path is the company's external id. If you also send an externalId in the body it must be the same. To create a company this way you must send a name.
updatedSince, for example ?updatedSince=2026-11-21T10:00:00Z, or a date such as 2026-11-21.Examples
See the fields a company can have:
curl "https://decuga.com/api/v1/projects/$PROJECT_ID/company-fields" \
-H "Authorization: Bearer $DECUGA_API_KEY"Create or update a company by your own id, with custom field values:
curl -X PUT "https://decuga.com/api/v1/projects/$PROJECT_ID/companies/external/CRM-1042" \
-H "Authorization: Bearer $DECUGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Acme Corp","domain":"acme.example","emails":["[email protected]","[email protected]"],"customFields":{"Account Tier":"Gold","Seats":"40"}}'The answer is the company:
{
"id": "0b8c1f1e-4d57-4c8f-9d52-6a1d2f3a4b5c",
"externalId": "CRM-1042",
"name": "Acme Corp",
"domain": "acme.example",
"customerCount": 0,
"emails": ["[email protected]", "[email protected]"],
"emailOptOut": false,
"customFields": { "Seats": "40", "Account Tier": "Gold" },
"createdAt": "2026-11-21T10:00:00",
"updatedAt": "2026-11-21T10:00:00"
}Change one value and clear another:
curl -X PATCH "https://decuga.com/api/v1/projects/$PROJECT_ID/companies/$COMPANY_ID" \
-H "Authorization: Bearer $DECUGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"customFields":{"Account Tier":"Silver","Renewal":""}}'Find the companies that changed today, the oldest change first:
curl "https://decuga.com/api/v1/projects/$PROJECT_ID/companies?updatedSince=2026-11-21&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 a domain) is refused with 400.
curl "https://decuga.com/api/v1/projects/$PROJECT_ID/companies?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, no email address when creating, an address that is not an address, 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 company in this project. |
| 409 | The domain or the external id already belongs to another company. The message names that company. |
| 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 companies 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 company 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, domain, external id | A name of up to 200 characters, a domain of up to 253, an external id of up to 100. |
| Email addresses | At least one and at most 50 for a company, each up to 254 characters. |
FAQ
Can I delete a company through the API?
Not yet. Delete a company 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, Companies, Custom Fields; then send values for them here.
Does this show the custom fields to customers?
No. Company custom fields are for your team only and are never shown in the helpdesk portal.
What if two companies need the same domain?
A domain belongs to one company, because customers are matched to a company by their email domain. Give the second company no domain, or a different one.