Zendesk query editor
This document explains how to use the Zendesk query editor to retrieve data from your Zendesk account.
Before you begin
Before you build a query, ensure you have:
- Configured the Zendesk data source.
- An API token with permission to access the resources you want to query.
Key concepts
The following terms are used throughout the query editor:
Query types
The first step when building a query is selecting the Action, also called the query type. Each action represents an API endpoint in Zendesk. After you select an action, provide the additional information the API requires. Required parameters appear next to the action selector, and any optional parameters appear in the Optional parameters section of the query editor.
The query editor supports the following query types:
- Search: Search for tickets, users, and organizations.
- Show tickets by IDs: Retrieve multiple ticket records by their IDs.
- Show ticket comments: Retrieve the comments on a specific ticket.
- Show deleted tickets: List deleted tickets that aren’t yet archived.
- Count tickets: Return an approximate ticket count for the account.
- Show all users: List all users registered to the Zendesk instance.
- Show selected users: Retrieve information about specific users by their IDs.
Search
Search lets you search for tickets, users, and organizations in your Zendesk account. Use the query parameter to specify a resource type, such as tickets or users, along with the search criteria, such as users named Jane Doe or tickets with an open status.
To see the full list of search parameters, refer to the Zendesk search reference.
Parameters
Examples
The following table shows example search queries:
Show tickets by IDs
This action retrieves multiple ticket records by providing a list of ticket IDs. It returns up to 100 ticket records in a single request.
Parameters
Show ticket comments
This action retrieves the comments associated with a specific ticket.
Parameters
Show deleted tickets
This action returns a list of all deleted tickets that aren’t yet archived.
Parameters
Count tickets
This action returns an approximate count of tickets in the account. If the count exceeds 100,000, Zendesk updates it every 24 hours. Because it returns a numeric value, this query type works well as an alerting condition.
Show all users
This action lists all users registered to the Zendesk instance.
Parameters
Show selected users
This action shows information about multiple users by their IDs.
Parameters
The editor fills the Users drop-down from the results of the Show all users query, showing each user’s name while sending the user ID to the API. This pairs well with a template variable: create a user variable from Show all users, then reference it here as ${user}. Refer to Zendesk template variables.
Use cases
The following examples show common ways to use the Zendesk data source. Query examples show how to configure fields, while use cases show when each query type is useful.
Because the Search, Show tickets by IDs, and user query types return timestamped fields, such as created_at and updated_at, you can plot them on time series panels or use them to drive annotations.
Next steps
After you build a query, you can:


