Common tasks for the Zendesk Ticketing API
If you're planning on using the Zendesk REST API with Zendesk Support, it's important to know what you want to do and the best way to accomplish it. This article covers common tasks performed with the Zendesk API, and lists the APIs and endpoints to use in your projects.
The article also points out APIs that might be inappropriate for the job. Knowing the difference between the right and the wrong API can help you choose the right tools for your other projects. Typically the APIs and endpoints you want will be obvious. Sometimes you'll need to do a bit of detective work to determine the APIs and endpoints that best meet your needs.
The purpose of the article is to get you thinking about the scope of your projects and the easiest ways to accomplish them. Knowing the scope of your project and the proper API to use will not only save you time when developing features. It could save you from having to restart a project later because you didn't spend enough time on the initial planning phase.
Here are the most common tasks performed with the Zendesk API:
- Creating tickets with a custom ticket form
- Migrating ticket data into Zendesk Support
- Creating users in Zendesk Support
Other popular APIs are listed at the end of the article.
This is not a definitive guide to the Zendesk API and the tasks you can accomplish with it. The APIs covered in this article are just the most common ones with the broadest applications. Many more exist.
One of the most common tasks performed with the Zendesk API is creating tickets with a custom ticket form. Use one of the following APIs to create the tickets:
- the tickets API
- the requests API
The main difference between the two is that the requests API is for authenticated end-users while the tickets API is for authenticated agents.
If you're creating a custom form for users, you can use the tickets API's
requester key to create a new user on the fly. See Creating a ticket with a new requester. You don't have to worry about users not being verified before they submit a ticket. For this reason, the tickets API is probably the better choice when setting up a custom form.
For an end-to-end tutorial, see Building a custom ticket form.
For details on using the tickets and requests APIs, see the following API docs:
Another common task performed with the Zendesk API is migrating ticket data into Zendesk Support. Use the ticket import endpoint to migrate the ticket data. The endpoint lets you import legacy data as closed tickets. In addition to standard fields, the endpoint lets you set solved_at, updated_at, and created_at dates on imported tickets. The tickets and requests APIs are not as effective in migrating ticket data.
For details on using the ticket import endpoint, see the following API doc:
Another common use for the Zendesk API is creating users in Zendesk Support. Use the users API to add customers to your Zendesk Support instance. Before you start, it’s important to note which user fields you can set, and whether or not you want additional user identities. A user identity is something that identifies an individual. A primary email address is typically used as the user identity. An X (formerly Twitter) handle, a secondary email, or a phone number can be used too. See User Identities.
For a tutorial, see Importing users with the Zendesk API.
Use the endpoint in the users API that meets your requirements:
If you want to create users with only one user identity, use the Create user endpoint
If you want to create users with multiple user identities, see Create user with multiple identities.
If you want to create many users at once, use the Create many users endpoint
Note: Before you begin creating users through the API, make sure to configure your account settings in Zendesk Support to get the results you want. For example, do you want to send welcome emails automatically to the new users?
You can leverage the search API to make complex tasks simpler. Sometimes a task that may seem complex or require multiple endpoints can be accomplished easily with the search API.
For example, suppose you want to import a subset of your Zendesk Support data into an external application. The subset you want is defined as all open tickets with a particular tag. The search API can easily return the information.
For a tutorial, see Searching with the Zendesk Ticketing API.
For details on using the search API, see the following API docs:
In addition to the APIs mentioned in the common tasks above, page view metrics indicate that the following APIs are also popular with developers.