Export Search Results

GET {{baseUrl}}/api/v2/search/export?query=<string>&page[size]=<integer>&filter[type]=<string>

Exports a set of results. See Query basics for the syntax of the query parameter.

This endpoint is for search queries that will return more than 1000 results. The result set is ordered only by the created_at attribute.

The search only returns results of a single object type. The following object types are supported: ticket, organization, user, or group.

You must specify the type in the filter[type] parameter. Searches with type in the query string will result in an error.

Allowed For

  • Agents

Pagination

  • Cursor pagination

See Pagination.

Returns a maximum of 1000 records per page. The number of results shown in a page is determined by the page[size] parameter.

Note: You may experience a speed reduction if you request 1000 results per page and you have many archived tickets in the results. Try reducing the number of results per page.

The cursor specified by the after_cursor property in a response expires after one hour.

For more information on cursor-based pagination, see the following articles:

Limits

This API endpoint is rate-limited to 100 requests per minute per account. The limit also counts towards the global API rate limit.

Response Format

NameTypeComment
links[next]stringURL to the next page of results
meta[has_more]stringBoolean indicating if there are more results
meta[after_cursor]stringCursor object returned from the Search Service
resultsarrayMay consist of tickets, users, groups, or organizations, as specified by the filter_type parameter

The response is similar to the response of GET /api/v2/search.json?, with a few changes:

  • links - Has the following nested properties: prev and next. These replace the next_page and prev_page links. The prev property is always null because backward pagination is not supported. The next property may include an auto-generated link to the next page of results.
  • meta - Has the following nested properties: has_more and after_cursor. The has_more property indicates whether the next page has more results. The after_cursor property is the cursor used to paginate to the next page. It expires after one hour.

There's no count property.

Request Params

KeyDatatypeRequiredDescription
querystring(Required) The search query. See Query basics above. For details on the query syntax, see the Zendesk Support search reference
page[size]stringThe number of results shown in a page.
filter[type]stringThe object type returned by the export query. Can be ticket, organization, user, or group.

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{&quot;facets&quot;:null,&quot;links&quot;:{&quot;next&quot;:&quot;https://example.zendesk.com/api/v2/search/export.json?filter%5Btype%5D=ticket\u0026page%5Bafter%5D=eyJmaWVsZCI6ImNyZWF0ZWRfYXQiLCJkZXNjIjp0cnVlLCJ0aWVCcmVha0ZpZWxkIjoiaWQiLCJ0aWVCcmVha0Rlc2MiOmZhbHNlLCJzb3J0VmFsdWVzIjpudWxsLCJleHBvcnRlZFRodXNGYXIiOjAsInNlc3Npb25TdGFydCI6MTYwNzAzOTI1Mzk4NSwiY3JlYXRlZEF0IjoxNjA3MDM5MjUzOTg1LCJzYWx0ZWRSZXF1ZXN0SGFzaCI6LTQ5ODM0ODc3LCJzYWx0ZWRDdXJzb3JIYXNoIjotMjQwMzQ4MjgwfQ%3D%3D\u0026page%5Bsize%5D=100\u0026query=hello%26page%5Bsize%5D%3D100%26filter%5Btype%5D%3Dticket&quot;,&quot;prev&quot;:null},&quot;meta&quot;:{&quot;after_cursor&quot;:&quot;eyJmaWVsZCI6ImNyZWF0ZWRfYXQiLCJkZXNjIjp0cnVlLCJ0aWVCcmVha0ZpZWxkIjoiaWQiLCJ0aWVCcmVha0Rlc2MiOmZhbHNlLCJzb3J0VmFsdWVzIjpudWxsLCJleHBvcnRlZFRodXNGYXIiOjAsInNlc3Npb25TdGFydCI6MTYwNzAzOTI1Mzk4NSwiY3JlYXRlZEF0IjoxNjA3MDM5MjUzOTg1LCJzYWx0ZWRSZXF1ZXN0SGFzaCI6LTQ5ODM0ODc3LCJzYWx0ZWRDdXJzb3JIYXNoIjotMjQwMzQ4MjgwfQ==&quot;,&quot;before_cursor&quot;:null,&quot;has_more&quot;:true},&quot;results&quot;:[]}