Search tasks in a workspace

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 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.

Rate limits

You may receive a 429 Too Many Requests response if you hit any of our rate limits.

Custom field parameters

Parameter nameCustom field typeAccepted type
custom_fields.{gid}.is_setAllBoolean
custom_fields.{gid}.valueTextString
custom_fields.{gid}.valueNumberNumber
custom_fields.{gid}.valueEnumEnum option ID
custom_fields.{gid}.starts_withText onlyString
custom_fields.{gid}.ends_withText onlyString
custom_fields.{gid}.containsText onlyString
custom_fields.{gid}.less_thanNumber onlyNumber
custom_fields.{gid}.greater_thanNumber onlyNumber

For example, if the gid of the custom field is 12345, these 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.

Not Supported: searching for multiple exact matches of a custom field, searching for multi-enum custom field

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.

📘

Customizing the response

Requests to this endpoint return "compact" task objects (schema) by default. To include more fields in the response, see input/output options.

Path Params
string
required

Globally unique identifier for the workspace or organization.

Query Params
array of strings

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.

opt_fields
boolean

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.

string

Performs full-text search on both task name and description

string
Defaults to milestone

Filters results by the task's resource_subtype

string

Comma-separated list of user identifiers

string

Comma-separated list of user identifiers

string

Comma-separated list of portfolio IDs

string

Comma-separated list of project IDs

string

Comma-separated list of project IDs

string

Comma-separated list of project IDs

string

Comma-separated list of section or column IDs

string

Comma-separated list of section or column IDs

string

Comma-separated list of section or column IDs

string

Comma-separated list of tag IDs

string

Comma-separated list of tag IDs

string

Comma-separated list of tag IDs

string

Comma-separated list of team IDs

string

Comma-separated list of user identifiers

string

Comma-separated list of user identifiers

string

Comma-separated list of user identifiers

string

Comma-separated list of user identifiers

string

Comma-separated list of user identifiers

string

Comma-separated list of user identifiers

string

Comma-separated list of user identifiers

string

Comma-separated list of user identifiers

date

ISO 8601 date string

date

ISO 8601 date string

date | null

ISO 8601 date string or null

date-time

ISO 8601 datetime string

date-time

ISO 8601 datetime string

date

ISO 8601 date string

date

ISO 8601 date string

date | null

ISO 8601 date string or null

date

ISO 8601 date string

date

ISO 8601 date string

date | null

ISO 8601 date string or null

date-time

ISO 8601 datetime string

date-time

ISO 8601 datetime string

date

ISO 8601 date string

date

ISO 8601 date string

date | null

ISO 8601 date string or null

date-time

ISO 8601 datetime string

date-time

ISO 8601 datetime string

date

ISO 8601 date string

date

ISO 8601 date string

date | null

ISO 8601 date string or null

date-time

ISO 8601 datetime string

date-time

ISO 8601 datetime string

boolean

Filter to incomplete tasks with dependents

boolean

Filter to tasks with incomplete dependencies

boolean

Filter to tasks with attachments

boolean

Filter to completed tasks

boolean

Filter to subtasks

string
Defaults to modified_at

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

boolean
Defaults to false

Default false

Responses

Response body
object
array of objects
data
object
string

Globally unique identifier of the resource, as a string.

string

The base type of this resource.

string

The name of the task.

string

The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning.
The resource_subtype milestone represent a single moment in time. This means tasks with this subtype cannot have a start_date.

default_task milestone approval

object

Opt In. A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

Language
Credentials
OAuth2
Request
Asana Home
Asana helps you manage projects, focus on what's important, and organize work in one place for seamless collaboration.
© 2023 Asana, Inc.