---
title: "Search for issues by a given filter"
method: POST
path: "/issues/search"
tags: ["issues"]
---

# Search for issues by a given filter

`POST /issues/search`

Currently, the following fields are filterable for issues:

* created_at (in RFC3339 format). Allowed operators: `time_is_after`, `time_is_before`, `time_range`

* account_id. Allowed operators: `equals`, `in`, `not_in`, `is_set`, `is_unset`

* ticket_form_id. Allowed operators: `equals`, `in`, `not_in`, `is_set`, `is_unset`

* requester_id. Allowed operators: `equals`, `in`, `not_in`, `is_set`, `is_unset`

* follower_user_id. Allowed operators: `equals`, `in`, `not_in`

* follower_contact_id. Allowed operators: `equals`, `in`, `not_in`

* state. Valid values are `["new", "waiting_on_you", "waiting_on_customer", "on_hold", "closed"]` or a custom status slug. Allowed operators: `equals`, `in`, `not_in`

* custom fields (pass in the slug of the custom field)

* tags (pass in the tag name). Allowed operators: `contains`, `does_not_contain`, `in`, `not_in`

* title. Allowed operators: `string_contains`, `string_does_not_contain`

* body_html. Allowed operators: `string_contains`, `string_does_not_contain`

* assignee_id. Allowed operators: `equals`, `in`, `not_in`, `is_set`, `is_unset`

* team_id. Allowed operators: `equals`, `in`, `not_in`

* issue_type. Valid values are `["conversation", "ticket"]`. Allowed operators: `equals`, `in`, `not_in`, `is_set`, `is_unset`

* resolved_at. Allowed operators: `time_is_after`, `time_is_before`, `time_range`

* latest_message_activity_at. Allowed operators: `time_is_after`, `time_is_before`, `time_range`

* updated_at (in RFC3339 format). Allowed operators: `time_is_after`, `time_is_before`, `time_range`

* slack_channel_id (the Slack channel ID the issue was created in). Allowed operators: `equals`, `in`, `not_in`

**Rate limit:** 20 requests per minute

## Request body

- SearchIssuesRequest
  - `cursor` string — The cursor to use for pagination.
  - `filter` Filter
    - `field` string, required — The field for this filter. For allowed fields, see the documentation for the specific endpoint you are using. For non-compound filters (any operators other than "and" or "or"), Field must be set, along with either Value or Values, depending on the operator.
    - `operator` 'equals' | 'not_equals' | 'contains' | 'does_not_contain' | 'in' | 'not_in' | 'and' | 'or' | 'time_is_after' | 'time_is_before' | 'time_range' | 'string_contains' | 'string_does_not_contain' | 'is_set' | 'is_unset' | 'greater_than' | 'less_than' | 'greater_than_or_equals' | 'less_than_or_equals', required — The operator for this filter. `equals`: Matches objects that are exactly equal to the value in the field. `not_equals`: Matches objects that are not exactly equal to the value in the field. `contains`: For a multi-valued field, such as tags, this operator will match objects that contain any of the values in the field. `does_not_contain`: For a multi-valued field, such as tags, this operator will match objects that do not contain any of the values in the field. `in`: Matches objects if the field is one of several possible values, as specified in the values array. `not_in`: Matches objects if the field is none of several possible values, as specified in the values array. `and`: Matches objects only if all subfilters match. `or`: Matches objects if any subfilter matches. `time_is_after`: Matches objects if the field is after the given time. `time_is_before`: Matches objects if the field is before the given time. `time_range`: Matches objects if the field is between the given times. `string_contains`: Matches objects if the field contains the given string. `string_does_not_contain`: Matches objects if the field does not contain the given string. `is_set`: Matches objects if the field is set. `is_unset`: Matches objects if the field is unset. `greater_than`: Matches objects if the numeric field is greater than the given value. `less_than`: Matches objects if the numeric field is less than the given value. `greater_than_or_equals`: Matches objects if the numeric field is greater than or equal to the given value. `less_than_or_equals`: Matches objects if the numeric field is less than or equal to the given value.
    - `subfilters` Filter[] — Sub-filters for this filter. Valid only when operator is "and" or "or". The maximum allowed depth for a tree of filters is 3.
    - `value` string — The value for this filter. Only used for single-valued operators ("equals", "not_equals", "contains", "does_not_contain")
    - `values` string[] — The values for this filter. Only used for multi-valued operators ("in", "not_in").
  - `limit` integer — The number of issues to fetch. Defaults to 100. Must be greater than 0 and less than 1000.
  - `search_text` string — Fuzzy text search. Results are intersected with any provided filter.

## Response `200`

- SearchIssuesResponseBody
  - `data` Issue[]
    - `account` MiniAccount
      - `external_ids` ExternalID[] — External IDs associated with the account.
        - `external_id` string — The external ID. Must be unique per object type (ex. account).
        - `label` string — The label of the external ID. Must be unique per object.
      - `id` string — The ID of the account.
    - `active_time_by_user` ActiveTimeByUser[] — Active time spent on the issue broken down per user, if any.
      - `active_time_seconds` integer — The user's active time on the issue in seconds.
      - `business_hours_active_time_seconds` integer — The user's business-hours active time on the issue in seconds.
      - `user_id` string — The ID of the user who spent the time.
    - `active_time_seconds` integer — The total active time spent on the issue in seconds, if any. Equals the sum of the per-user active time.
    - `assignee` MiniUser
      - `email` string — The email of the user.
      - `id` string — The ID of the user.
    - `attachment_urls` string[] — The attachment URLs attached to this issue, if any.
    - `author_unverified` boolean — Whether any message on the issue has an unverified author identity. True if any message author's identity has NOT been verified (e.g., from public forms).
    - `body_html` string — The body of the issue in HTML format.
    - `business_hours_active_time_seconds` integer — The total business-hours active time spent on the issue in seconds, if any. Equals the sum of the per-user business-hours active time.
    - `business_hours_first_response_seconds` integer — The business hours time in seconds it took for the first response to the issue, if any.
    - `business_hours_resolution_seconds` integer — The business hours time in seconds it took for the issue to be resolved, if any.
    - `business_hours_time_in_status_seconds` object — A map of status slug to the business hours time in seconds the issue has spent in that status. Includes both base statuses (e.g. "new", "waiting_on_you") and custom statuses.
    - `chat_widget_info` IssueChatWidgetInfo
      - `page_url` string — The URL of the page that the user was on when they started the chat widget issue.
    - `child_issues` MiniIssue[] — The child issues in this group, if this issue is an issue group.
      - `id` string — The ID of the issue.
      - `number` integer — The number of the issue.
    - `created_at` string — The time the issue was created.
    - `csat_responses` CSATResponse[] — The CSAT responses of the issue, if any.
      - `comment` string — The comment of the CSAT response.
      - `score` integer — The score of the CSAT response.
    - `custom_fields` object — Custom field values associated with the issue.
    - `customer_portal_visible` boolean — Whether the issue is visible in the customer portal.
    - `external_issues` ExternalIssue[] — The external issues associated with the issue, if any.
      - `external_id` string — The external ID of the external issue. Jira: ID of the issue (autoincrementing number from 10000). GitHub: Owner/Repo/IssueID. Linear: ID of the issue (UUID). Asana: ID of the task (Long number).
      - `link` string — Link to the product issue.
      - `source` string — The source of the external issue.
    - `first_response_breach_time` string — The time by which the issue's first response SLA will breach, if any. Only present for issues with an active first response SLA.
    - `first_response_seconds` integer — The time in seconds it took for the first response to the issue, if any.
    - `first_response_time` string — The time of the first response to the issue, if any.
    - `id` string — The ID of the issue.
    - `latest_message_time` string — The time of the latest message in the issue.
    - `link` string — The link to the issue in Pylon.
    - `number` integer — The number of the issue.
    - `number_of_touches` integer — The number of times the issue has been touched.
    - `parent_issue_group` MiniIssue
      - `id` string — The ID of the issue.
      - `number` integer — The number of the issue.
    - `requester` MiniContact
      - `email` string — The email of the contact.
      - `id` string — The ID of the contact.
    - `resolution_breach_time` string — The time by which the issue's resolution SLA will breach, if any. Only present for open issues with an active resolution SLA.
    - `resolution_seconds` integer — The time in seconds it took for the issue to be resolved, if any.
    - `resolution_time` string — The time of the resolution of the issue, if any.
    - `slack` SlackInfo
      - `channel_id` string — The Slack channel ID associated with the issue.
      - `message_ts` string — The root message ID of slack message that started issue.
      - `workspace_id` string — The Slack workspace ID associated with the issue.
    - `snoozed_until_time` string — The time the issue was snoozed until in RFC3339 format, if any.
    - `source` 'slack' | 'microsoft_teams' | 'microsoft_teams_chat' | 'chat_widget' | 'email' | 'manual' | 'form' | 'discord' | 'whatsapp' | 'sms' | 'telegram' | 'phone' — The source of the issue.
    - `state` string — The state of the issue. This could be one of `["new", "waiting_on_you", "waiting_on_customer", "on_hold", "closed"] or a custom status slug.
    - `tags` string[] — Tags associated with the issue.
    - `team` MiniTeam
      - `id` string — The ID of the team.
    - `team_slas` TeamSLA[] — The team-scoped SLAs on the issue, if any. One entry per team, mirroring the issue-level first response and resolution SLA fields.
      - `first_response` SLATimes
        - `breach_time` string — The time at which it breaches (or has breached), if any.
        - `business_hours_seconds` integer — The elapsed business-hours time in seconds, if any.
        - `seconds` integer — The elapsed time in seconds, if any.
        - `time` string — The time it was reached, if any.
      - `resolution` SLATimes
        - `breach_time` string — The time at which it breaches (or has breached), if any.
        - `business_hours_seconds` integer — The elapsed business-hours time in seconds, if any.
        - `seconds` integer — The elapsed time in seconds, if any.
        - `time` string — The time it was reached, if any.
      - `team_id` string — The ID of the team these are scoped to.
    - `time_in_status_seconds` object — A map of status slug to the time in seconds the issue has spent in that status. Includes both base statuses (e.g. "new", "waiting_on_you") and custom statuses.
    - `title` string — The title of the issue.
    - `type` 'conversation' | 'ticket' — The type of the issue. `conversation`: A conversation. `ticket`: A support ticket.
    - `updated_at` string — The time the issue was last updated.
  - `pagination` Pagination
    - `cursor` string, required — The cursor for the next page of results.
    - `has_next_page` boolean, required — Indicates if there is a next page of results.
  - `request_id` string

## Other responses

- `400` — The request was invalid or could not be completed.
- `404`
- `500` — An unexpected internal error occurred.

---

[API](https://skmtc.net/usepylon/apis/pylon-api.md) · [All operations](https://skmtc.net/usepylon/apis/pylon-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usepylon/pylon-api/versions/999c51740b4e/schema)
