Product Update24 November 20266 min read

Sync Service Desk Customers From Your Own Systems

Keep the people who raise tickets in step with your CRM or your product: create and update customers over REST, find them by your own id, put them in a company and fill in their custom fields.

Your customers already exist somewhere else

The people who raise tickets are usually also rows in your CRM, accounts in your product or contacts in a billing tool. Typing them into the service desk a second time means two lists that drift apart: a person changes their email, moves company or upgrades their plan, and the service desk is the last to know. The Customers REST API lets your own systems write those facts into the service desk as they change, so an agent opening a ticket sees the person as your systems do.

What you can do with it

The API is plain JSON over HTTPS, called with a project API key, on the Business plan and above. It is a thin layer over the same rules the app applies, so an email address or your own customer id cannot belong to two customers, and every custom field value is checked against its field before it is saved.

CallWhat it does
GET /customersList customers by name, 50 a page, reached by cursor; narrow by name, email, your own id or the time of the last change
GET /customers/{customer}Read one customer
POST /customersCreate a customer: a name and an email address are needed
PATCH /customers/{customer}Change a customer; what you leave out stays as it is
PUT /customers/external/{externalId}Create or update the customer with your own id, safe to repeat
GET /customer-fieldsThe custom fields a customer can have, with their types and options

Give each person your own id, and a repeat changes nothing

The call to reach for in a sync is the upsert. Give each person your own id as their external id and send PUT /customers/external/{externalId} with what you know: it updates the customer with that id if there is one and creates it if there is not. Sending the same call twice does not make a second customer, so a job that failed halfway can simply run again. The id in the path is the external id; if you also send one in the body it has to be the same.

From your systems to a customer your agents see

One call keeps a person in step, however many times it is sent.

  1. 1Your systems

    A CRM, your product or a billing tool know who the person is.

  2. 2PUT by your own id

    Updates the customer if there is one, creates it if there is not.

  3. 3The customer

    With its company and its custom fields, checked against their types.

  4. 4Your agents

    See the person as your systems do, on every ticket.

Anything that changed since the last run can be read back with updatedSince

Companies and custom fields, by the names you already use

A customer belongs to a company, and the API lets you say which one in the words your systems use. Send the company's id, or the external id you gave the company in the Companies API, and an empty value takes the customer out of its company. Custom field values are sent by the field's name, such as Plan or Preferred language, where the app keeps them by id; a name that is not a field is refused rather than silently dropped, so a typo never loses a value.

  • ✓A company is given by companyId or by companyExternalId, never both
  • ✓A custom field you name that does not exist is refused, naming where to see the fields
  • ✓Fields left out of an update keep their value, and an empty value clears one
  • ✓The values follow the same types as in the app: text, numbers, dates, choices, checkboxes, ratings and the rest

The people who were already there

Customers are not only made by your sync. A person who raises a ticket through the helpdesk portal, or whom your app signs in with the helpdesk session call, becomes a customer found by their email address, long before your first sync. The upsert looks for a customer by your external id first. When none has it, it takes the customer with the email address you send, if that customer has no external id yet, updates it and gives it your id, so the person is your customer and not a duplicate. After that first call the customer has your id, and every later call finds it by that. A customer that already has a different external id is never taken: that record is someone else's, and the call is refused with a conflict.

Permissions, limits and what is not there

A key acts as the person who created it: it needs the permission to see tickets to read customers and the permission to manage the service desk to change them. Each change appears in the project's activity feed with the name of the key that made it, so a change made by an integration can be told from one made by hand. The same rate limits apply as for the task and companies APIs. Customers cannot be deleted through the API, the custom fields themselves are created in the service desk and not through the API, and the API sends no email: it reads and writes the records.

Ready to try Decuga?

Start free - no account or credit card required. One week free trial of the Business plan.

Start free trial