List Search Results
GET {{baseUrl}}/api/v2/search?query=<string>&sort_by=<string>&sort_order=<string>
Use the ampersand character (&) to append the sort_by
or sort_order
parameters to the URL.
For examples, see Searching with Zendesk API.
Pagination
- Offset pagination only
Offset pagination may result in duplicate results when paging. You can also use the Export Search Results endpoint, which uses cursor-based pagination and doesn't return duplicate results. See Pagination for more information.
Allowed For
- Admins, Agents and Light Agents
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 |
Example Error
{
"error": "unavailable",
"description": "Sorry, we could not complete your search query. Please try again in a moment."
}
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
query | string | (Required) The search query. See Query basics above. For details on the query syntax, see the Zendesk Support search reference | |
sort_by | string | One of updated_at , created_at , priority , status , or ticket_type . Defaults to sorting by relevance | |
sort_order | string | One of asc or desc . Defaults to desc |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"count":1234,"facets":null,"next_page":"https://foo.zendesk.com/api/v2/search.json?query=\"type:Group hello\"\u0026sort_by=created_at\u0026sort_order=desc\u0026page=2","previous_page":null,"results":[{"created_at":"2009-05-13T00:07:08Z","id":211,"name":"Hello DJs","result_type":"group","updated_at":"2011-07-22T00:11:12Z","url":"https://foo.zendesk.com/api/v2/groups/211.json"},{"created_at":"2009-08-26T00:07:08Z","id":122,"name":"Hello MCs","result_type":"group","updated_at":"2010-05-13T00:07:08Z","url":"https://foo.zendesk.com/api/v2/groups/122.json"}]}