Skip to content

Search tasks in a workspace

API Reference

📘

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

workspace_gid

string

required

Globally unique identifier for the workspace or organization.

opt_fields

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 ADD string

opt_pretty

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.

truetruefalse

text

string

Performs full-text search on both task name and description

resource_subtype

string

enum

Defaults to milestone

Filters results by the task's resource_subtype

default_taskmilestoneapprovalcustom

Allowed:

default_task``milestone``approval``custom

assignee.any

string

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

assignee.not

string

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

portfolios.any

string

Comma-separated list of portfolio IDs

projects.any

string

Comma-separated list of project IDs

projects.not

string

Comma-separated list of project IDs

projects.all

string

Comma-separated list of project IDs

sections.any

string

Comma-separated list of section or column IDs

sections.not

string

Comma-separated list of section or column IDs

sections.all

string

Comma-separated list of section or column IDs

tags.any

string

Comma-separated list of tag IDs

tags.not

string

Comma-separated list of tag IDs

tags.all

string

Comma-separated list of tag IDs

teams.any

string

Comma-separated list of team IDs

followers.any

string

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

followers.not

string

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

created_by.any

string

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

created_by.not

string

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

assigned_by.any

string

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

assigned_by.not

string

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

liked_by.not

string

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

commented_on_by.not

string

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

due_on.before

date

ISO 8601 date string

due_on.after

date

ISO 8601 date string

due_on

date | null

ISO 8601 date string or null

due_at.before

date-time

ISO 8601 datetime string

due_at.after

date-time

ISO 8601 datetime string

start_on.before

date

ISO 8601 date string

start_on.after

date

ISO 8601 date string

start_on

date | null

ISO 8601 date string or null

created_on.before

date

ISO 8601 date string

created_on.after

date

ISO 8601 date string

created_on

date | null

ISO 8601 date string or null

created_at.before

date-time

ISO 8601 datetime string

created_at.after

date-time

ISO 8601 datetime string

completed_on.before

date

ISO 8601 date string

completed_on.after

date

ISO 8601 date string

completed_on

date | null

ISO 8601 date string or null

completed_at.before

date-time

ISO 8601 datetime string

completed_at.after

date-time

ISO 8601 datetime string

modified_on.before

date

ISO 8601 date string

modified_on.after

date

ISO 8601 date string

modified_on

date | null

ISO 8601 date string or null

modified_at.before

date-time

ISO 8601 datetime string

modified_at.after

date-time

ISO 8601 datetime string

is_blocking

boolean

Filter to incomplete tasks with dependents

truefalse

is_blocked

boolean

Filter to tasks with incomplete dependencies

truefalse

has_attachment

boolean

Filter to tasks with attachments

truefalse

completed

boolean

Filter to completed tasks

truefalse

is_subtask

boolean

Filter to subtasks

truefalse

sort_by

string

enum

Defaults to modified_at

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

due_datecreated_atcompleted_atlikesmodified_at

Allowed:

due_date``created_at``completed_at``likes``modified_at

sort_ascending

boolean

Defaults to false

Default false

truefalse

``200 Successfully retrieved the section's tasks.

object

data

array of objects

data

object

Full object requires scope:tasks:read

The task is the basic object around which many operations in Asana are centered.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

The name of the task.

resource_subtype

string

enum

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``custom

created_by

object

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

created_by object

``400 This usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.

``401 A valid authentication token was not provided with the request, so the API could not associate a user with the request.

``403 The authentication and request syntax was valid but the server is refusing to complete the request. This can happen if you try to read or write to objects or properties that the user does not have access to.

``404 Either the request method and path supplied do not specify a known action in the API, or the object specified by the request does not exist.

``500 There was a problem on Asana’s end. In the event of a server error the response body should contain an error phrase. These phrases can be used by Asana support to quickly look up the incident that caused the server error. Some errors are due to server load, and will not supply an error phrase.

Updated 28 days ago


Did this page help you?

Yes

No

ShellNodeRubyPHPPython


xxxxxxxxxx

curl --request GET \

     --url 'https://app.asana.com/api/1.0/workspaces/workspace_gid/tasks/search?resource_subtype=milestone&sort_by=modified_at&sort_ascending=false' \

     --header 'accept: application/json'

xxxxxxxxxx

{

  "data": [\
\
    {\
\
      "gid": "12345",\
\
      "resource_type": "task",\
\
      "name": "Bug Task",\
\
      "resource_subtype": "default_task",\
\
      "created_by": {\
\
        "gid": "1111",\
\
        "resource_type": "user"\
\
      }\
\
    }\
\
  ]

}

Updated28 days ago


Did this page help you?

Yes

No