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:

NameTypeComment
errorstringThe type of error. Examples: unavailable, invalid
descriptionstring
Example Error
{
  "error": "unavailable",
  "description": "Sorry, we could not complete your search query. Please try again in a moment."
}

Request Params

KeyDatatypeRequiredDescription
querystring(Required) The search query. See Query basics above. For details on the query syntax, see the Zendesk Support search reference
sort_bystringOne of updated_at, created_at, priority, status, or ticket_type. Defaults to sorting by relevance
sort_orderstringOne of asc or desc. Defaults to desc

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{&quot;count&quot;:1234,&quot;facets&quot;:null,&quot;next_page&quot;:&quot;https://foo.zendesk.com/api/v2/search.json?query=\&quot;type:Group hello\&quot;\u0026sort_by=created_at\u0026sort_order=desc\u0026page=2&quot;,&quot;previous_page&quot;:null,&quot;results&quot;:[{&quot;created_at&quot;:&quot;2009-05-13T00:07:08Z&quot;,&quot;id&quot;:211,&quot;name&quot;:&quot;Hello DJs&quot;,&quot;result_type&quot;:&quot;group&quot;,&quot;updated_at&quot;:&quot;2011-07-22T00:11:12Z&quot;,&quot;url&quot;:&quot;https://foo.zendesk.com/api/v2/groups/211.json&quot;},{&quot;created_at&quot;:&quot;2009-08-26T00:07:08Z&quot;,&quot;id&quot;:122,&quot;name&quot;:&quot;Hello MCs&quot;,&quot;result_type&quot;:&quot;group&quot;,&quot;updated_at&quot;:&quot;2010-05-13T00:07:08Z&quot;,&quot;url&quot;:&quot;https://foo.zendesk.com/api/v2/groups/122.json&quot;}]}