The Search API is a unified search API that returns tickets, users, and organizations. You can define filters to narrow your search results according to resource type, dates, and object properties, such as ticket requester or tag.

To search articles in Help Center, see Search in the Help Center API documentation.

To use the API with Python or Perl, see Searching with the Zendesk API.

Note: It can take up to a few minutes for new tickets, users, and other resources to be indexed for search. If new resources don't appear in your search results, wait a few minutes and try again.

Results limit

The Search API returns up to 1,000 results per query, with a maximum of 100 results per page. See Pagination. If you request a page past the limit (page=11 at 100 results per page), a 422 Insufficient Resource Error is returned.

If you need to retrieve large datasets, Zendesk recommends serializing the search into smaller chunks by limiting results to a specific date range. Alternatively, if you need to export and warehouse large amounts of data, consider using one of the Incremental Export endpoints.

The count property shows the actual number of results. For example, if a query has 5,000 results, the count value will be 5,000, even if the API only returns the first 1,000 results.

Query basics

You specify search queries in a URL parameter named query:


Syntax examples

The query syntax for {search_string} is detailed in the Zendesk Support search reference, but this section gives a quick overview. The syntax gives you a lot of flexibility. Examples:

Query Returns
query=3245227 The ticket with the id 3245227
query=Greenbriar Any record with the word Greenbriar
query=type:user "Jane Doe" User records with the exact string "Jane Doe"
query=type:ticket status:open Open tickets
query=type:organization created<2015-05-01 Organizations created before May 1, 2015
query=status<solved requester:[email protected] type:ticket Unsolved tickets requested by [email protected]
query=type:user tags:premium_support Users tagged with "premium_support"
query=created>2012-07-17 type:ticket organization:"MD Photo" Tickets created in the MD Photo org after July 17, 2012

How it works:

  • The : character is the equality operator. Other operators include < and >, the minus sign -, and the wildcard character *. Learn more about the operators.

  • Double quotes, "", specify a search phrase. The API uses exact word matches. For example, the search results for "top" will include data that match the string "top" as a single word, or a single word in a longer phrase ("top tier"). It will not include the prefix of a longer word ("topology"), or data where the string "top" appears in the middle or end of a word ("stopwatch", "desktop").

  • The type property returns records of the specified resource type. Possible values include ticket, user, organization, or group. Learn more about types.

  • The status property returns tickets set to the specified status. Possible values include new, open, pending, hold, solved, or closed. Learn more about ticket properties. You can also search by user, organization, and group properties.

  • Date-time properties such as created, updated, and solved can return records for a specific date, on or before a certain date, and on or after a certain date. The date format is YYYY-MM-DD. Learn more about dates.

URL-encoding the search string

Because a search string is sent in a HTTP request, the string must be url-encoded. Example:


Most HTTP libraries provide tools for url-encoding strings. In cURL, you can use the --data-urlencode option with the -G flag:

curl "https://{subdomain}" \
-G --data-urlencode "query=type:ticket status:open" \
-v -u {email_address}:{password}

In Python 3, you can use the urlencode() method in the urllib.parse module.

For examples, see Searching with the Zendesk API.

JSON Format

Search results are represented as JSON objects with the following keys.

Name Type Comment
count integer The total number of results matching this query
next_page string URL to the next page of results
prev_page string URL to the previous page of results
results array May consist of tickets, users, groups, or organizations, as specified by the result_type property in each result object
  "results": [
      "name":        "Hello DJs",
      "created_at":  "2009-05-13T00:07:08Z",
      "updated_at":  "2011-07-22T00:11:12Z",
      "id":          211,
      "result_type": "group"
      "url":         ""
      "name":        "Hello MCs",
      "created_at":  "2009-08-26T00:07:08Z",
      "updated_at":  "2010-05-13T00:07:08Z",
      "id":          122,
      "result_type": "group"
      "url":         ""
  "facets":    null,
  "next_page": "\"type:Group hello\"&sort_by=created_at&sort_order=desc&page=2",
  "prev_page": null,
  "count":     1234

List Search Results

GET /api/v2/search.json?query={search_string}

Allowed for:
  • Admins, Agents and Light Agents
Available parameters
Name Type Required Comments
query string yes The search query
sort_by string no One of updated_at, created_at, priority, status, or ticket_type. Defaults to sorting by relevance
sort_order string no One of asc or desc. Defaults to desc

Use the ampersand character (&) to append the sort_by or sort_order parameters to the URL. Example: status:closed&sort_by=status&sort_order=desc

For examples, see Searching with Zendesk API.


See Query basics above. For details on the query syntax, see the Zendesk Support search reference.

Using curl
curl "https://{subdomain}" \
  -G --data-urlencode "query=type:ticket status:open" \
  -v -u {email_address}:{password}

See the example above for an example response.

Errors JSON Format

Errors are represented as JSON objects which have the following keys:

Name Type Comment
error string The type of error. Examples: "unavailable", "invalid"
description string
  "error": "unavailable",
  "description": "Sorry, we could not complete your search query. Please try again in a moment."

Show Results Count

GET /api/v2/search/count.json?query={search_string}

Returns the number of items matching the query rather than the items. The search string works the same as a regular search.

Status: 200 OK

  "count": 6