provider Tasks GET /workspaces/{workspace_gid}/tasks/search
@utdk/asana /workspaces/{workspace_gid}/tasks/search
Search tasks in a workspace
<b>Required scope: </b><code>tasks:read</code> To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need. #### Premium access Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true: - The workspace in which the search is being performed is a premium workspace - The user is a member of a premium team inside the workspace Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error. #### Pagination Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](/docs/pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter. #### Eventual consistency Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product. Because of this delay, the search endpoint is not suited for use cases that require immediate consistency after writes. If you need read-your-write behavior or strongly consistent results, we recommend using [Get multiple tasks](/reference/gettasks) instead. #### Rate limits You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](/docs/rate-limits). #### Custom field parameters | Parameter name | Custom field type | Accepted type | |---|---|---| | custom_fields.{gid}.is_set | All | Boolean | | custom_fields.{gid}.value | Text | String | | custom_fields.{gid}.value | Number | Number | | custom_fields.{gid}.value | Enum | Enum option ID | | custom_fields.{gid}.value | Date | ISO 8601 date string (yyyy-mm-dd) | | custom_fields.{gid}.starts_with | Text only | String | | custom_fields.{gid}.ends_with | Text only | String | | custom_fields.{gid}.contains | Text only | String | | custom_fields.{gid}.less_than | Number only | Number | | custom_fields.{gid}.greater_than | Number only | Number | | custom_fields.{gid}.before | Date only | ISO 8601 date string (yyyy-mm-dd) | | custom_fields.{gid}.after | Date only | ISO 8601 date string (yyyy-mm-dd) | For example, if the gid of the custom field is 12345, the query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. To find tasks with a date custom field before April 21, 2026, use `custom_fields.12345.before=2026-04-21`. **Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field #### Custom task type parameters | Parameter name | Accepted type | |---|---| | custom_types.{gid}.custom_type_status_option.gid | Enum option GID | This parameter filters tasks by their custom task status option. The `{gid}` is the GID of the custom task type, and the value is the GID of a valid status option for that type's status field. **Requirements**: - `resource_subtype=custom` must be set when using this parameter. - Only one `custom_types.*` parameter may be specified per request. - The provided custom task type GID must reference a valid custom object type. - The status option GID must be a valid option for the custom type's status field. - Cannot be combined with `custom_fields.{status_field_gid}.value` when `{status_field_gid}` is the status field belonging to the same custom task type. For example, to find custom tasks of type `12345` with status option `67890`: `custom_types.12345.custom_type_status_option.gid=67890&resource_subtype=custom`. *Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.*
workspace_gid path required
Globally unique identifier for the workspace or organization.
string
opt_pretty query
Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
boolean
text query
Performs full-text search on both task name and description
string
resource_subtype query
Filters results by the task's resource_subtype
enum: default_task, milestone, approval, custom
assignee.any query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
assignee.not query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
portfolios.any query
Comma-separated list of portfolio IDs
string
projects.any query
Comma-separated list of project IDs
string
projects.not query
Comma-separated list of project IDs
string
projects.all query
Comma-separated list of project IDs
string
sections.any query
Comma-separated list of section or column IDs
string
sections.not query
Comma-separated list of section or column IDs
string
sections.all query
Comma-separated list of section or column IDs
string
tags.any query
Comma-separated list of tag IDs
string
tags.not query
Comma-separated list of tag IDs
string
tags.all query
Comma-separated list of tag IDs
string
teams.any query
Comma-separated list of team IDs
string
followers.any query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
followers.not query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
created_by.any query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
created_by.not query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
assigned_by.any query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
assigned_by.not query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
liked_by.not query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
commented_on_by.not query
Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.
string
due_on.before query
ISO 8601 date string
string
due_on.after query
ISO 8601 date string
string
due_on query
ISO 8601 date string or `null`
string
due_at.before query
ISO 8601 datetime string
string
due_at.after query
ISO 8601 datetime string
string
start_on.before query
ISO 8601 date string
string
start_on.after query
ISO 8601 date string
string
start_on query
ISO 8601 date string or `null`
string
created_on.before query
ISO 8601 date string
string
created_on.after query
ISO 8601 date string
string
created_on query
ISO 8601 date string or `null`
string
created_at.before query
ISO 8601 datetime string
string
created_at.after query
ISO 8601 datetime string
string
completed_on.before query
ISO 8601 date string
string
completed_on.after query
ISO 8601 date string
string
completed_on query
ISO 8601 date string or `null`
string
completed_at.before query
ISO 8601 datetime string
string
completed_at.after query
ISO 8601 datetime string
string
modified_on.before query
ISO 8601 date string
string
modified_on.after query
ISO 8601 date string
string
modified_on query
ISO 8601 date string or `null`
string
modified_at.before query
ISO 8601 datetime string
string
modified_at.after query
ISO 8601 datetime string
string
is_blocking query
Filter to incomplete tasks with dependents
boolean
is_blocked query
Filter to tasks with incomplete dependencies
boolean
has_attachment query
Filter to tasks with attachments
boolean
completed query
Filter to completed tasks
boolean
is_subtask query
Filter to subtasks
boolean
sort_by query
One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at`
enum: due_date, created_at, completed_at, likes…
sort_ascending query
Default `false`
boolean
opt_fields query
This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
array

Try it

Authentication
Configure credentials for Asana
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

searchtasksforworkspace
GET/workspaces/{workspace_gid}/tasks/search
<b>Required scope: </b><code>tasks:read</code> To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need. #### Premium access Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true: - The workspace in which the search is being performed is a premium workspace - The user is a member of a premium team inside the workspace Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error. #### Pagination Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](/docs/pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter. #### Eventual consistency Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product. Because of this delay, the search endpoint is not suited for use cases that require immediate consistency after writes. If you need read-your-write behavior or strongly consistent results, we recommend using [Get multiple tasks](/reference/gettasks) instead. #### Rate limits You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](/docs/rate-limits). #### Custom field parameters | Parameter name | Custom field type | Accepted type | |---|---|---| | custom_fields.{gid}.is_set | All | Boolean | | custom_fields.{gid}.value | Text | String | | custom_fields.{gid}.value | Number | Number | | custom_fields.{gid}.value | Enum | Enum option ID | | custom_fields.{gid}.value | Date | ISO 8601 date string (yyyy-mm-dd) | | custom_fields.{gid}.starts_with | Text only | String | | custom_fields.{gid}.ends_with | Text only | String | | custom_fields.{gid}.contains | Text only | String | | custom_fields.{gid}.less_than | Number only | Number | | custom_fields.{gid}.greater_than | Number only | Number | | custom_fields.{gid}.before | Date only | ISO 8601 date string (yyyy-mm-dd) | | custom_fields.{gid}.after | Date only | ISO 8601 date string (yyyy-mm-dd) | For example, if the gid of the custom field is 12345, the query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. To find tasks with a date custom field before April 21, 2026, use `custom_fields.12345.before=2026-04-21`. **Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field #### Custom task type parameters | Parameter name | Accepted type | |---|---| | custom_types.{gid}.custom_type_status_option.gid | Enum option GID | This parameter filters tasks by their custom task status option. The `{gid}` is the GID of the custom task type, and the value is the GID of a valid status option for that type's status field. **Requirements**: - `resource_subtype=custom` must be set when using this parameter. - Only one `custom_types.*` parameter may be specified per request. - The provided custom task type GID must reference a valid custom object type. - The status option GID must be a valid option for the custom type's status field. - Cannot be combined with `custom_fields.{status_field_gid}.value` when `{status_field_gid}` is the status field belonging to the same custom task type. For example, to find custom tasks of type `12345` with status option `67890`: `custom_types.12345.custom_type_status_option.gid=67890&resource_subtype=custom`. *Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.*

Parameters

required

Globally unique identifier for the workspace or organization.

Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

Performs full-text search on both task name and description

Filters results by the task's resource_subtype

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of portfolio IDs

Comma-separated list of project IDs

Comma-separated list of project IDs

Comma-separated list of project IDs

Comma-separated list of section or column IDs

Comma-separated list of section or column IDs

Comma-separated list of section or column IDs

Comma-separated list of tag IDs

Comma-separated list of tag IDs

Comma-separated list of tag IDs

Comma-separated list of team IDs

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

Comma-separated list of user identifiers. This can either be the string "me", an email, or the gid of a user.

ISO 8601 date string

ISO 8601 date string

ISO 8601 date string or `null`

ISO 8601 datetime string

ISO 8601 datetime string

ISO 8601 date string

ISO 8601 date string

ISO 8601 date string or `null`

ISO 8601 date string

ISO 8601 date string

ISO 8601 date string or `null`

ISO 8601 datetime string

ISO 8601 datetime string

ISO 8601 date string

ISO 8601 date string

ISO 8601 date string or `null`

ISO 8601 datetime string

ISO 8601 datetime string

ISO 8601 date string

ISO 8601 date string

ISO 8601 date string or `null`

ISO 8601 datetime string

ISO 8601 datetime string

Filter to incomplete tasks with dependents

Filter to tasks with incomplete dependencies

Filter to tasks with attachments

Filter to completed tasks

Filter to subtasks

One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at`

Default `false`

This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import asana from '@utdk/asana';

await asana.searchtasksforworkspace({
  "resource_subtype": "milestone",
  "sort_by": "modified_at",
  "sort_ascending": false
})