Search Cases

Search for cases using a flexible query language. ## Search vs. List Endpoints The Search and List endpoints serve different purposes and have distinct performance characteristics. Use the **Search** endpoint (`POST /cases/search`) when you need to perform complex queries with boolean logic (AND/OR/NOT), filter by custom fields, assignee, case queue, or SLA expiration, or apply multiple conditions simultaneously. Search is optimized for flexible querying and is faster than paginating through all resources when looking for specific records. Use the **List** endpoint (`GET /cases`) for simple listing with basic filters like status, case template, account, inquiry, or report. ## Data Freshness Do not use search for read-after-write flows because the data will not be immediately available to search. Under normal operating conditions, data is searchable within approximately 1 minute of creation or modification. Propagation of new or updated data could be delayed during an outage. For workflows that require immediate data availability after creating or updating a case, use the List Cases endpoint instead. ### Searchable Attributes The following attributes can be used in query predicates: | Attribute | Description | |-----------|-------------| | `template` | Case template (e.g., `ctmpl_ABC123`) | | `status` | Case status (e.g., `open`, `pending`, `resolved`) | | `state` | Case state | | `created_at` | Case creation timestamp | | `updated_at` | Case last updated timestamp | | `resolved_at` | Case resolution timestamp | | `sla_expires_at` | SLA expiration timestamp | | `assignee` | Assigned user (e.g., `user_ABC123`) | | `case_queue` | Case queue (e.g., `cqueue_ABC123`) | | `resolver` | Resolver user | | `fields.*` | Custom case field (e.g., `fields.priority`) | **Note:** Custom fields (`fields.*`) must be configured as searchable on the Case Template to be queryable.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

Key-InflectionenumOptional
Determines casing for the API response.
Allowed values:
Idempotency-KeystringOptional
Ensures the request is idempotent.
Persona-VersionenumOptional
Server API version. More info on versioning can be found [here](https://docs.withpersona.com/versioning).

Query parameters

fieldsmap from strings to stringsOptional
Comma-separated list(s) of attributes to include in the response. This can be used to customize which attributes will be serialized in the response. See [Serialization](https://docs.withpersona.com/serialization#sparse-fieldsets) for more details.
pageobjectOptional

Request

This endpoint expects an object.
queryobjectOptional

Search query using boolean logic (AND/OR/NOT) and comparison operators. Supports predicates with operators: eq (equal), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal).

sortobjectOptional
Sort configuration for results
pageobjectOptional
Pagination parameters

Response headers

RateLimit-Limitinteger
The maximum number of requests permitted in the current rate limit window for the API key used to authenticate the request. Returned on every authenticated response.
RateLimit-Remaininginteger
The number of requests remaining in the current rate limit window for the API key used to authenticate the request. Returned on every authenticated response.
RateLimit-Resetinteger
The number of seconds until the current rate limit window resets. Returned on every authenticated response.
Request-Idstring

The unique identifier of the API log entry that recorded this request. Starts with req_. Include this value when reaching out to Persona support. Present on every authenticated response, including error responses.

Persona-Environment-Idstring
The token of the Persona environment that handled the request. Returned on every authenticated response, including most error responses.
Persona-Organization-Idstring
The token of the Persona organization that handled the request. Returned on every authenticated response, including most error responses.

Response

This endpoint returns a collection of Case objects matching the search criteria.
datalist of objects
An array of Cases matching the search criteria

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error