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.

The companies API is on the Business plan and above, the same as project API keys and the companies themselves.

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 key acts as the person who created it. To read companies 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.

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 pathWhat it does
GET /companiesList 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 /companiesCreate 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-fieldsThe 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.

FieldMeaning
idThe company's id.
externalIdYour own id for the company in your systems, if you gave one. Unique in the project.
nameThe company's name.
domainThe email domain used to match customers to the company, always in lower case, or null. Unique in the project.
customerCountHow many customers belong to the company. Read only.
emailsThe addresses the company is emailed at, in lower case. Empty only for a company created before addresses were kept.
emailOptOutTrue when the company asked not to be emailed.
customFieldsCustom field values by field name. Only fields that have a value are listed.
createdAt, updatedAtTimes 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:

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 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.

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 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.

StatusWhen
400The 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).
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 company in this project.
409The domain or the external id already belongs to another company. The message names that company.
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 companies a page unless you ask, at most 100 (?limit=). A page is reached with the cursor the one before returned.
Custom fieldsAt most 50 company 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, domain, external idA name of up to 200 characters, a domain of up to 253, an external id of up to 100.
Email addressesAt 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.