cases

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:

AttributeDescription
templateCase template (e.g., ctmpl_ABC123)
case_template_idCase template (e.g., ctmpl_ABC123)
statusCase status (e.g., open, pending, resolved)
stateCase state
resolutionCase resolution
created_atCase creation timestamp
updated_atCase last updated timestamp
resolved_atCase resolution timestamp
sla_expires_atSLA expiration timestamp
assigneeAssigned user (e.g., user_ABC123)
case_queueCase queue (e.g., cqueue_ABC123)
case_queue_idCase queue (e.g., cqueue_ABC123)
resolverResolver user
account_idRelated account (e.g., act_ABC123)
inquiry_idRelated inquiry (e.g., inq_ABC123)
tag_idRelated tag (e.g., tag_ABC123)
fields.*Custom case field (e.g., fields.priority)

Note: Custom fields (fields.*) must be configured as searchable on the Case Template to be queryable.

Note: account_id, inquiry_id, tag_id, case_template_id, case_queue_id, and resolution cannot be used in sort.

Note: account_id, inquiry_id, and tag_id match against the 50 most recently added accounts, inquiries, and tags on a case. A case related to more than 50 of one of these will not match on the older ones.

post/cases/search

Request

  • Base URL: https://api.withpersona.com/api/v1
  • URL: https://api.withpersona.com/api/v1/cases/search
  • Auth: HTTP bearer

Query parameters

fieldsobject

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 for more details.

afterstring

Cursor for forward pagination. Use the value from links.next in the previous response.

beforestring

Cursor for backward pagination. Use the value from links.prev in the previous response.

sizeinteger

Number of results to return per page.

Headers

Key-Inflection'camel' | 'kebab' | 'snake'

Determines casing for the API response.

Idempotency-Keystring

Ensures the request is idempotent.

Persona-Version'2026-09-29' | '2025-12-08' | '2025-10-27' | '2023-01-05' | '2022-09-01' | '2021-08-18' | '2021-07-05' | '2021-02-21' | '2020-05-18'

Server API version. More info on versioning can be found here.

Request body

Response

This endpoint returns a collection of Case objects matching the search criteria.

Changes

No recorded changes to this operation across all 1 revision of this API.