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

# Search for tasks by a given filter

`POST /tasks/search`

Filterable fields and their allowed operators:

 Field | Allowed operators |
 --- | --- |
 `account_id` | `equals`, `in`, `not_in`, `is_set` |
 `project_id` | `equals`, `in`, `not_in`, `is_set`, `is_unset` |
 `status` | `equals`, `in`, `not_in` |
 `assignee_id` | `equals`, `in`, `not_in`, `is_set` |
 `milestone_id` | `equals`, `in`, `not_in`, `is_set` |
 `created_at` | `time_is_after`, `time_is_before`, `time_range` |
 `due_date` | `time_is_after`, `time_is_before`, `time_range`, `is_set` |
 `updated_at` | `time_is_after`, `time_is_before`, `time_range` |

Timestamp values use RFC3339 format. Valid `status` values are `not_started`, `in_progress`, and `completed`. For custom fields, pass the field slug as `field`.

**Rate limit:** 20 requests per minute

## Request body

- SearchTasksRequest
  - `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.
    - `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 tasks to fetch. Defaults to 100. Must be greater than 0 and less than 1000.

## Response `200`

- SearchTasksResponseBody
  - `data` Task[]
    - `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.
    - `assignee` Actor
      - `contact` MiniContact
        - `email` string — The email of the contact.
        - `id` string — The ID of the contact.
      - `user` MiniUser
        - `email` string — The email of the user.
        - `id` string — The ID of the user.
    - `body_html` string — The body of the task in HTML format.
    - `created_at` string — The created at time of the task.
    - `custom_fields` object — Custom field values associated with the task, keyed by custom field slug.
    - `customer_portal_visible` boolean — The customer portal visible of the task.
    - `due_date` string — The due date of the task in RFC3339 format.
    - `external_issues` ExternalIssue[] — The external product issues associated with the task, 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.
    - `id` string — The ID of the task.
    - `milestone` MiniMilestone
      - `id` string — The ID of the milestone.
    - `parent_task_id` string — The ID of the parent task, if this is a subtask.
    - `project` MiniProject
      - `id` string — The ID of the project.
    - `status` string
    - `subtask_ids` string[] — The IDs of subtasks belonging to this task.
    - `title` string — The title of the task.
    - `updated_at` string — The updated at time of the task.
  - `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.

---

[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/revisions/ad855d921ee9/schema)
