---
title: "List Search Results"
method: GET
path: "/api/v2/search"
tags: ["Search"]
---

# List Search Results

`GET /api/v2/search`

Returns the search results. See [Query basics](#query-basics) for the syntax of the `query` parameter.

Use the ampersand character (&) to append the `sort_by` or `sort_order` parameters to the URL.

For examples, see [Searching with Zendesk API](/documentation/ticketing/using-the-zendesk-api/searching-with-the-zendesk-api).

#### Allowed For

* Agents

#### Pagination

* Offset pagination only

Offset pagination may result in duplicate results when paging. You can also use the
[Export Search Results](/api-reference/ticketing/ticket-management/search/#export-search-results) endpoint, which
uses cursor-based pagination and doesn't return duplicate results. See
[Using cursor pagination](/api-reference/introduction/pagination/#using-cursor-pagination) for more information.


#### 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
```js
{
  "error": "unavailable",
  "description": "Sorry, we could not complete your search query. Please try again in a moment."
}
```

## Query parameters

- `query` string, required
- `sort_by` 'updated_at' | 'created_at' | 'priority' | 'status' | 'ticket_type'
- `sort_order` 'asc' | 'desc'
- `page` integer
- `per_page` integer

## Response `200`

Success response

- SearchResponse
  - `count` integer — The number of resources returned by the query corresponding to this page of results in the paginated response
  - `facets` string, nullable — The facets corresponding to the search query
  - `next_page` string, nullable — URL to the next page of results
  - `previous_page` string, nullable — URL to the previous page of results
  - `results` SearchResultObject[] — May consist of tickets, users, groups, or organizations, as specified by the `result_type` property in each result object
    - `created_at` string — When the resource was created
    - `default` boolean — Flag to indicate whether this is the default resource
    - `deleted` boolean — Flag to indicate whether or not resource has been deleted
    - `description` string — The description of the resource
    - `id` integer — The ID of the resource
    - `name` string — The name of the resource
    - `result_type` string — The type of the resource
    - `updated_at` string — When the resource was last updated
    - `url` string — The url of the resource

---

[API](https://skmtc.dev/botbrains-io/apis/support-api.md) · [All operations](https://skmtc.dev/botbrains-io/apis/support-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/botbrains-io/support-api/revisions/d53eac07ba68/schema)
