hamburger icon "
BETA
curl

Overview

Basics

Helpful code snippets will show up in this column. You can choose your language in the navigation above!

curl https://app.asana.com/api/1.0/users/me \
  -H "Authorization: Bearer 0/a7f89e98g007e0s07da763a"

The Asana API is a RESTful interface, providing programmatic access to much of the data in the system. It provides predictable URLs for accessing resources, and uses built-in HTTP features to receive commands and return responses. This makes it easy to communicate with from a wide variety of environments, from command-line utilities to gadgets to the browser URL bar itself.

The API accepts JSON or form-encoded content in requests and returns JSON content in all of its responses, including errors. Only the UTF-8 character encoding is supported for both requests and responses.

Notes on Pagination

Pagination is an important concept when working with queries for multiple objects. Requests with large result sets may timeout or be truncated; therefore, pagination is strongly encouraged to ensure both you and your users have the best experience when using the Asana API.

Happy coding!


Object Hierarchy

Asana object hierarchy

Asana is a work tracking and collaboration tool. This guide is designed to give developers building on Asana’s API a brief overview of how Asana is structured. It’s not meant to be exhaustive and may be too basic for experienced Asana users, but read on if you're not a user of Asana who uses it regularly. The intention is to describe the fundamental elements of Asana to help you scope apps and avoid common points of confusion.

How work in Asana is organized

Tasks

Tasks are the basic unit of action in Asana. Tasks have many fields including a single assignee, name, notes, followers, likes, and comments. Tasks inherit custom fields from their parent project(s). Custom fields values are set for each individual task.

In addition to standard Create / Read / Update / Delete operations, there are a few things to watch out for when working with tasks:

Projects

A project is a collection of tasks that can be viewed as a list, board, timeline, and calendar. Projects can only exist in a single organization or workplace and only belong to a single team. Projects can be public in the team or private to project members. Among the many fields associated with projects, they can have global (shared across the organization) or local (project-specific) custom fields. A project’s custom fields will be displayed on each task within the project.

Portfolios

Portfolios are collections of projects (or other portfolios). Custom fields can be added to portfolios in addition to standard fields that are displayed on every portfolio. These fields provide a high-level overview of the status of each project within the portfolio.

Subtasks

A subtask is exactly the same as tasks in a project except that one (and only one) of its parents is a task (although subtasks can also simultaneously be organized into projects). To check if a task has a subtask, include the num_subtasks field when fetching the parent task.

Things to note when working with subtasks:

How users of Asana are organized

Workspaces

A workspace is the highest-level organizational unit in Asana. All projects, tasks, and teams have an associated workspace.

Organizations

An organization is a special kind of workspace that represents a company. Organizations connect all the employees at a company using Asana in a single space based on the company’s shared email domain. In an organization, you can group your projects into teams.

Teams

Teams are a subset of users in an organization who collaborate on projects together. Every project in an organization is associated with one team. Team conversations are not currently available in the API.

Users

A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks. Asana accounts are free and tied to individuals; Asana accounts grant access to one or more shared Workspaces and Organizations to collaborate with other Asana users.

Guest Users

Users can invite clients, contractors, customers, or anyone else who does not have an email address at an approved Organization email domain. These users join as Organization Guests. Guests have limited access in an Organization -- they can only see what’s explicitly shared with them.

Note: it can be advantageous to use guests to create bot accounts. Due to the access restrictions, bots created from a guest account Personal Access Token can be given fine-grained access to only the data that it needs to use.


Authentication Basics

Asana supports a few methods of authenticating with the API.

"Authorization: Bearer ACCESS_TOKEN"

OAuth

Most of the time, OAuth is the preferred method of authentication for developers, users, and Asana as a platform. If you're new to OAuth, take a moment to learn about it here. It's not as scary as you might think!

In addition to learning about how to use OAuth on the Asana platform here, feel free to take a look at the official OAuth spec!

At its core, OAuth is a mechanism for applications to access the Asana API on behalf of a user without the application having access to the username and password. Instead, apps get a token which they can use with their own application credentials to make API calls.

What is OAuth?

If you're using a library to handle this or already understand OAuth and have registered an OAuth application, you may want to skip ahead to the quick reference.

  1. If you have not already, you will need to register an application. Take note of the client ID, an application's username, and the client secret, an application's password (protect it like one)!

  2. A user will arrive at your application and click a button that says "Connect with Asana."

  3. This takes the customer to the User Authorization Endpoint, which displays a page asking the user if they would like to grant access to your third-party application.

  4. If the customer clicks "Allow", they are redirected back to the application, bringing along a special code as a query parameter. (We are assuming the Authorization Code Grant flow, which is the most common.)

  5. The application can now use the Token Exchange Endpoint to exchange the code, together with the Client Secret, for a Bearer Token (which lasts an hour) and a Refresh Token (which can be used to fetch new Bearer Tokens when the current one expires).

  6. The application can make requests of the API using this Bearer Token for the next hour.

  7. Once the Bearer Token expires, the application can again use the Token Exchange Endpoint to exchange the Refresh Token for a new Bearer Token. (This can be repeated for as long as the user has authorized the application.)

We definitely recommend using a library to take care of the nitty-gritty of OAuth, but hopefully this helps demystify the process somewhat.

Register an Application

You must first register your application with Asana to receive a client ID and client secret. Fortunately, this process is fast and easy: visit your Account Settings dialog, click the Apps tab, and "Add New Application".

You must supply your new application with:

Note that all of these attributes can be changed later, so don't worry too much right away.

Once you have created an app, the details view will include a Client ID, needed to uniquely identify your app to the Asana API, as well as a Client Secret.

Note Your Client Secret is a secret, it should never be shared with anyone or checked into source code that others could gain access to.

Quick Reference

User Authorization Endpoint

Request

Send a user to oauth_authorize

<a href="https://app.asana.com/-/oauth_authorize
?client_id=753482910
&redirect_uri=https://my.app.com
&response_type=code
&state=thisIsARandomString
&code_challenge_method=S256
&code_challenge=671608a33392cee13585063953a86d396dffd15222d83ef958f43a2804ac7fb2
&scope=default">Authenticate with Asana</a>

Your app redirects the user to https://app.asana.com/-/oauth_authorize, passing parameters along as a standard query string:

ParameterDescription
client_idrequired The Client ID uniquely identifies the application making the request.
redirect_urirequired The URI to redirect to on success or error. This must match the Redirect URL specified in the application settings.
response_typerequired Must be either code or id_token, or the space-delimited combination code id_token.
stateoptional Encodes state of the app, which will be returned verbatim in the response and can be used to match the response up to a given request.
code_challenge_methodPKCE The hash method used to generate the challenge. Typically S256.
code_challengePKCE The code challenge used for PKCE.
scopeoptional A space-delimited set of one or more scopes to get the user's permission to access. Defaults to the default OAuth scope if no scopes are specified.

Response

If either the client_id or redirect_uri do not match, the user will simply see a plain-text error. Otherwise, all errors will be sent back to the redirect_uri specified.

The user then sees a screen giving them the opportunity to accept or reject the request for authorization. In either case, the user will be redirected back to the redirect_uri.

User is redirected to the redirect_uri

https://my.app.com?code=325797325&state=thisIsARandomString

When using the response_type=code, your app will receive the following parameters in the query string on successful authorization.

ParameterDescription
codeIf response_type=code in the request, this is the code your app can exchange for a token
stateThe state parameter that was sent with the authorizing request

You should check that the state is the same in this response as it was in the request. You can read more about the state parameter here.

OAuth Scopes

The Asana API supports a small set of OAuth scopes you can request using the scope parameter during the user authorization step of your authentication flow. Multiple scopes can be requested at once as a space-delimited list of scopes. An exhaustive list of the supported scopes is provided here:

ScopeAccess provided
defaultProvides access to all endpoints documented in our API reference. If no scopes are requested, this scope is assumed by default.
openidProvides access to OpenID Connect ID tokens and the OpenID Connect user info endpoint.
emailProvides access to the user's email through the OpenID Connect user info endpoint.
profileProvides access to the user's name and profile photo through the OpenID Connect user info endpoint.

Token Exchange Endpoint

Request

When your app receives a code from the authorization endpoint, it can now be exchanged for a proper token.

If you have a client_secret, this request should be sent from your secure server. The browser should never see your client_secret.

App sends request to oauth_token

{
  "grant_type": "authorization_code",
  "client_id": "753482910",
  "client_secret": "6572195638271537892521",
  "redirect_uri": "https://my.app.com",
  "code": "325797325",
  "code_verifier": "fdsuiafhjbkewbfnmdxzvbuicxlhkvnemwavx"
}

Your app should make a POST request to https://app.asana.com/-/oauth_token, passing the parameters as part of a standard form-encoded post body.

ParameterDescription
grant_typerequired One of authorization_code or refresh_token. See below for more details.
client_idrequired The Client ID uniquely identifies the application making the request.
client_secretrequired The Client Secret belonging to the app, found in the details pane of the developer console.
redirect_urirequired Must match the redirect_uri specified in the original request.
coderequired This is the code you are exchanging for an authorization token.
refresh_tokensometimes required If grant_type=refresh_token this is the refresh token you are using to be granted a new access token.
code_verifierPKCE This is the string previously used to generate the code_challenge.

The token exchange endpoint is used to exchange a code or refresh token for an access token.

Response

In the response, you will receive a JSON payload with the following parameters:

{
  "access_token": "f6ds7fdsa69ags7ag9sd5a",
  "expires_in": 3600,
  "token_type": "bearer",
  "refresh_token": "hjkl325hjkl4325hj4kl32fjds",
  "data": {
    "id": "4673218951",
    "name": "Greg Sanchez",
    "email": "gsanchez@example.com"
  }
}
ParameterDescription
access_tokenThe token to use in future requests against the API
expires_inThe number of seconds the token is valid, typically 3600 (one hour)
token_typeThe type of token, in our case, bearer
refresh_tokenIf exchanging a code, a long-lived token that can be used to get new access tokens when old ones expire.
dataA JSON object encoding a few key fields about the logged-in user, currently id, name, and email.

Authorization Code Grant

To implement the Authorization Code Grant flow (the most typical flow for most applications), there are three steps:

  1. Send the user to the authorization endpoint so that they can approve access of your app to their Asana account

  2. Receive a redirect back from the authorization endpoint with a code embedded in the parameters

  3. Exchange the code via the token exchange endpoint for a **refresh_token** and, for convenience, an initial access_token.

  4. When the short-lived access_token expires, the **refresh_token** can be used with the token exchange endpoint, without user intervention, to get a fresh access_token.

The token that you have at the end can be used to make calls to the Asana API on the user's behalf.

Proof Key for Code Exchange (PKCE) OAuth Extension

User Authorization Endpoint

{
  ...
  "code_challenge": "671608a33392cee13585063953a86d396dffd15222d83ef958f43a2804ac7fb2",
  "code_challenge_method": "S256"
}

Token Exchange Endpoint

{
  ...
  "code_verifier": "fdsuiafhjbkewbfnmdxzvbuicxlhkvnemwavx"
}

PKCE proves the app that started the authorization flow is the same app that finishes the flow. You can read more about it here.

Here's what you need to know:

  1. Whenever a user wants to oauth with Asana, your app server should generate a random string called the code_verifier. This string should be saved to the user (as every code_verifier should be unique per user). This should stay on the app server and only be sent to the Token Exchange Endpoint.

  2. Your app server will hash the code_verifier with SHA256 to get a string called the code_challenge. Your server will give the browser only the code_challenge & code_challenge_method. The code_challenge_method should be the string "S256" to tell Asana we hashed with SHA256. More specifically, code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier))).

  3. The browser includes code_challenge & code_challenge_method when redirecting to the User Authorization Endpoint.

  4. The app server should include the code_verifier in it's request to the Token Exchange Endpoint.

Asana confirms that hashing the code_verifier with the code_challenge_method results in the code_challenge. This proves to Asana the app that hit the User Authorization Endpoint is the same app that hit the Token Exchange Endpoint.

Secure Redirect Endpoint

As the redirect from the authorization endpoint in either grant procedure contains a code that is secret between Asana's authorization servers and your application, this response should not occur in plaintext over an unencrypted http connection. Asana is deprecating this behavior. We're enforcing the use of https redirect endpoints for new application registrations, and will soon stop calling back to http apps during the authorization process.

For non-production or personal use, you may wish to check out stunnel, which can act as a proxy to receive an encrypted connection, decrypt it, and forward it on to your application. For development work, you may wish to create a self-signed SSL/TLS certificate for use with your web server; for production work we recommend purchasing a certificate from a certificate authority. A short summary of the steps for each of these processes can be read here.

Your application will need to be configured to accept SSL/TLS connections for your redirect endpoint when users become authenticated, but for many apps, this will simply require a configuration update of your application server. Instructions for Apache and Nginx can be found on their respective websites, and most popular application servers will contain documentation on how to proceed.

Personal Access Token

Personal Access Tokens are a useful mechanism for accessing the API in scenarios where OAuth would be considered overkill, such as access from the command line and personal scripts or applications. A user can create many, but not unlimited, personal access tokens. When creating a token you must give it a description to help you remember what you created the token for.

Personal Access Tokens should be used similarly to OAuth access tokens when accessing the API, passing them in the Authorization header.

curl https://app.asana.com/api/1.0/users/me \
  -H "Authorization: Bearer ACCESS_TOKEN"

You should regularly review the list of personal access tokens you have created and deauthorize those that you no longer need.

Note: Remember to keep your tokens secret; treat them just like passwords! They act on your behalf when interacting with the API. Don't hardcode them into your programs; instead, opt to use them as environment variables.

OpenID Connect

Asana also supports the OpenID Connect protocol for authenticating Asana users with your applications. This means that, in addition to the normal code and token response types for the OAuth flow, you can also use the id_token response type.

For this response type, you are not granted an access token for the API, but rather given a signed Json Web Token containing the user's ID along with some metadata. If you want to allow users to log into your services using their Asana account, the OpenID Connect protocol is an ideal way to authenticate an Asana user. To obtain an ID token, you must request the openid scope during the authentication flow.

It is also possible to obtain an ID token alongside an authorization code in the authorization code grant flow by using the (space-delimited) code id_token response type. If you do, the redirect parameters will include the ID token in addition to everything you would normally receive.

To access additional information about the user in a standardized format, we also expose a user info endpoint that can provide the user's name, email address, and profile photo. This data is available by making a GET request to https://app.asana.com/api/1.0/openid-connect/userinfo with an OAuth access token that has the openid scope. Depending on the scopes tied to that token, you will receive different pieces of data. Refer to our list of OAuth scopes to determine which additional scopes you need to get the data you want.

Metadata about our OpenID Connect implementation is also made available through OpenID Connect's discovery protocol. Making an unauthenticated GET request to https://app.asana.com/api/1.0/.well-known/openid-configuration will provide all the details of our implementation necessary for you to use OpenID Connect with Asana's API.


Errors

Missing authorization header

GET https://app.asana.com/api/1.0/users/me HTTP/1.1
HTTP/1.1 401 Not Authorized
{
  "errors": [
  {
    "message": "Not Authorized"
  }
  ]
}

Sadly, sometimes requests to the API are not successful. Failures can occur for a wide range of reasons. In all cases, the API should return an HTTP Status Code that indicates the nature of the failure (below), with a response body in JSON format containing additional information.

In the event of a server error the response body will contain an error phrase. These phrases are automatically generated using the node-asana-phrase library and can be used by Asana support to quickly look up the incident that caused the server error.

Bad request parameters

GET https://app.asana.com/api/1.0/tasks HTTP/1.1
Authorization: Bearer <personal_access_token>
HTTP/1.1 400 Bad Request
{
  "errors": [
  {
    "message": "workspace: Missing input"
  }
  ]
}

Asana had a problem

GET https://app.asana.com/api/1.0/users/me HTTP/1.1
Authorization: Bearer <personal_access_token>
HTTP/1.1 500 Server Error
{
  "errors": [
  {
    "message": "Server Error",
    "phrase": "6 sad squid snuggle softly"
  }
  ]
}



CodeMeaningDescription
200SuccessIf data was requested, it will be available in the data field at the top level of the response body.
201Created
(for object creation)
Its information is available in the data field at the top level of the response body. The API URL where the object can be retrieved is also returned in the Location header of the response.
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.
402Payment RequiredThe request was valid, but the queried object or object mutation specified in the request is only available to premium organizations and workspaces.
403ForbiddenThe 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.
404Not FoundEither 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.
429Too Many RequestsYou have exceeded one of the enforced rate limits in the API. See the documentation on rate limiting for more information.
500Internal Server ErrorThere was a problem on Asana's end.
↓ Show Common Responses ↓↑ Hide Common Responses ↑



In the event of an error, the response body will contain an errors field at the top level. This contains an array of at least one error object, described below:

ExampleDescription
Message:project: Missing input Message providing more detail about the error that occurred, if available.
Phrase:6 sad squid snuggle softly 500 errors only. A unique error phrase which can be used when contacting developer support to help identify the exact occurrence of the problem in Asana's logs.

Rate Limits

To protect the stability of the API and keep it available to all users, Asana enforces multiple kinds of rate limiting. Requests that hit any of our rate limits will receive a 429 Too Many Requests response, which contains the standard Retry-After header indicating how many seconds the client should wait before retrying the request.

Limits are allocated per authorization token. Different tokens will have independent limits.

The client libraries respect the rate-limited responses and will wait the appropriate amount of time before automatically retrying the request, up to a configurable maximum number of retries.

Standard Rate Limits

Request

GET https://app.asana.com/api/1.0/users/me HTTP/1.1
Authorization: Bearer <personal_access_token>

Response

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 30

{
  "errors": [
  {
    "message": "You've made too many requests and hit a rate limit. Please retry after the given amount of time."
  }
  ]
}

Our standard rate limiter imposes a quota on how many requests can be made in a given window of time. Our limits are based on minute-long windows, and differ depending on whether the domain is premium or not. We may change these quotas or add new quotas (such as maximum requests per hour) in the future.

Domain typeMaximum requests per minute
Free150
Premium1500

In addition, calls to the search API are limited to 60 requests per minute. The duplication endpoints are limited to 5 concurrent jobs.

Although the quota is defined per minute, it is evaluated more frequently than once per minute, so you may not need to wait for a full minute before retrying your request. For requests rejected by this limiter, the Retry-After header has the result of this calculation.

Requests rejected by this limiter still count against the quotas so that ignoring the Retry-After header will result in fewer and fewer requests being accepted during the subsequent tine windows.

Concurrent Request Limits

In addition to limiting the total number of requests in a given time window, we also limit the number of requests being handled at any given instant. We may change these limits or add new limits in the future.

Request typeMaximum concurrent requests
Reads (HTTP GET method)50
Writes (HTTP POST, PUT, PATCH, and DELETE methods combined)15

For example, if you have 50 read requests in-flight and attempt to make another read request, the API will return a 429 Too Many Requests error. The read and write limits are independent of each other, so the number of read requests you make at one time will have no impact on the number of write requests you can make.

Responses for requests rejected by this concurrent request limiter will contain a Retry-After header specifying a duration long enough such that the other in-flight requests are guaranteed to have either completed or timed out.

Cost Limits

Objects in Asana are connected to each other in a graph. Some examples of links in this graph are:

Depending on the kind of requests you make to our API, our servers have to traverse different parts of the graph. The sizes of these parts directly influence how expensive it is for our servers to build the API responses. For example, fetching just the name and ID of a task requires very few resources and no traversal of the graph, but fetching all tasks in a project and all their attributes (assignee, followers, custom fields, likes) can require following several thousand links in the graph.

Because there can be a wide range in the cost of any given API request in terms of the computational resources and database load, the standard rate limits are not always enough to maintain stability of the API. In the past, when we’ve received bursts of expensive requests, our typical course of action has been to block the offending authorization token and reject all future requests, resulting in confusion for both the user and the app developer. Instead, to protect against the extreme cases where API requests require inordinate traversal of the graph, we impose an additional limit based on the computational cost.

The cost we associate with a request isn't equivalent to the number of links in the subset of the graph involved, but it is roughly proportional. The cost of a request is calculated after the response has been fully built and we know how much data we needed to fetch from our databases to build it. This cost is then deducted from a quota, and the response is returned. Because the cost of a request is not known until we’ve built the response, we allow this deduction to result in a net negative quota. The request that causes the quota to become negative will receive the expected response and not be rejected.

When a request is received, if the remaining quota is not positive, the new request is rejected with a 429 Too Many Requests. As with the standard rate limits, this quota is defined per-minute but is updated on a more frequent interval. The Retry-After header will specify how long you must wait for the quota to become positive again.

The vast majority of developers will be unaffected by the cost limit, and the quota is set sufficiently high that it only affects users making requests that would compromise the stability of the API. Rather than unconditionally blocking their token from the API, this cost limiter will permit them to continue operation at a slower but safe and stable rate.


Rich Text

Example Rich Text

<body>All these new tasks are <em>really</em> getting disorganized, so <a data-asana-gid="4168112"/> just made the new <a data-asana-gid="5732985"/> project to help keep them organized. <strong>Everyone</strong> should start using the <a data-asana-gid="6489418" data-asana-project="5732985"/> when adding new tasks there.</body>

Note: In preparation for our upcoming migration to string IDs (referred to as gids in the API) this new feature uses only gids and not ids. Read more about it in our community post.

The web product offers a number of rich formatting features when writing task notes, comments, project descriptions, and project status updates. These features include bold, italic, underlined, and monospaced text, as well as bulleted and numbered lists. Additionally, users can "@-mention" other users, tasks, projects, and many other objects within Asana to create links.

The rich text field name for an object is equivalent to it's plain text field name prefixed with html_. The following object types in Asana support rich text:

ObjectPlain text fieldRich text field
Tasksnoteshtml_notes
Projectsnoteshtml_notes
Storiestexthtml_text
Project status updatestexthtml_text
Teamsdescriptionhtml_description

Reading rich text

Python

from lxml import etree

html_text = "<body>...</body>"
root = etree.HTML(html_text)
user_ids = root.xpath('//a[@data-asana-type="user"]/@data-asana-gid')
for user_id in user_ids:
    print(user_id)

Java

import com.jcabi.xml.XML;
import com.jcabi.xml.XMLDocument;
import java.util.List;

XML root = new XMLDocument("<body>...</body>");
List<String> userIds = root.xpath("//a[@data-asana-type=\"user\"]/@data-asana-gid");
for (String userId : userIds) {
    System.out.println(userId);
}

Javascript

var htmlText = '<body>...</body>'
var parser = new DOMParser()
var doc = parser.parseFromString(htmlText, "text/html")
var iterator = doc.evaluate(
    '//a[@data-asana-type="user"]/@data-asana-gid', doc, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE)
var node = iterator.iterateNext()
while (node) {
    console.log(node.nodeValue);
    node = iterator.iterateNext();
}

Rich text in the API is formatted as an HTML fragment, which is wrapped in a root <body> tag. Rich text is guaranteed to be valid XML; there will always be a root element, all tags will be closed, balanced, and case-sensitive, and all attribute values will be quoted. The following is a list of all the tags that are currently returned by the API:

TagMeaning in Asana
<body>None
<strong>Bold text
<em>Italic text
<u>Underlined text
<s>Strikethrough text
<code>Monospaced text
<ol>Ordered list
<ul>Unordered list
<li>List item
<a>Link

Note: This list can expand as new features are introduced to the Asana web product. Treat rich text as you would treat arbitrary HTML, and ensure that your code doesn't break when it encounters a tag not on this list.

While links are easy to understand when users view the rendered in the Asana web product, an <a> tag and its href alone are insufficient to programmatically understand what the target of the link is. This is confused further by the fact that the formats of these links are frequently ambiguous. For example, an @-mention to a user generates a link to their "My Tasks", which looks identical to a link to a normal project.

Because of this, the API will return additional attributes in <a> tags to convey meaningful information about the target. The following is a complete list of attributes we may return inside an <a> tag, in addition to the usual href:

AttributeMeaning
data-asana-accessibleBoolean, representing whether or not the linked object is accessible to the current user. If the resource is inaccessible, no other data-asana-* attributes will be included in the tag.
data-asana-typeThe type of the referenced object. One of user, task, project, tag, conversation, status_update, team, or search.
data-asana-gidThe GID of the referenced object. If the referenced object is a user, this is the user's GID.
data-asana-projectIf the type of the referenced object is a task, and the link references that task in a particular project, this is the GID of that project.
data-asana-tagIf the type of the referenced object is a task, and the link references that task in a particular tag, this is the GID of that tag.

Here are some examples of how this behavior manifests:

Here's an example of what a complete rich comment might look like in the API:

<body>All these new tasks are <em>really</em> getting disorganized, so <a href="https://app.asana.com/0/4168466/list" data-asana-accessible="true" data-asana-type="user" data-asana-gid="4168112">Tim Bizzaro</a> just made the new <a href="https://app.asana.com/0/5732985/list" data-asana-accessible="true" data-asana-type="project" data-asana-gid="5732985">Work Requests</a> project to help keep them organized. <strong>Everyone</strong> should start using the <a href="https://app.asana.com/0/5732985/6489418" data-asana-accessible="true" data-asana-type="task" data-asana-gid="6489418" data-asana-project="5732985">Request template</a> when adding new tasks there.</body>

Writing rich text

When writing rich text to the API, you must provide similarly structured, valid XML. The text must be wrapped in a <body> tag, all tags must be closed, balanced, and match the case of supported tags, and attributes must be quoted. Invalid XML, as well as unsupported tags, will be rejected with a 400 Bad Request error. Only <a> tags support attributes, and any attributes on other tags will be similarly rejected.

For <a> tags specifically, to make it easier to create @-mentions through the API, we only require that you provide the GID of the object you wish to reference. If you have access to that object, the API will automatically generate the appropriate href and other attributes for you. For example, to create a link to a task with GID "123", you can send the tag <a data-asana-gid="123"/> which will then be expanded to <a href="https://app.asana.com/0/0/123/f" data-asana-accessible="true" data-asana-type="task" data-asana-gid="123">Task Name</a>. You can also generate a link to a task in a specific project or tag by including a data-asana-project or data-asana-tag attribute in the <a> tag. All other attributes, as well as the contents of the tag, are ignored.

If you do not have access to the referenced object when you try to create a link, the API will not generate an href for you, but will instead look for an href you provide. This allows you to write back <a> tags unmodified even if you do not have access to the resource. If you do not have access to the referenced object and no href is provided, your request will be rejected with a 400 Bad Request error. Similarly, if you provide neither a GID nor a valid href, the request will be rejected with the same error.


Pagination

Paginating requests for object sets that may be large is highly recommended. For requests that will return large result sets the API may truncate the result or timeout attempting to gather the data. Pagination ensures a more reliable experience by limiting requests to a smaller number of objects at a time, ultimately getting you the results faster; should there be more results, the API will return an offset that will allow you to access the next page.

Strongly prefer paginated requests {#prefer-pagination}

For all new features in the Asana API, we're making pagination required by specifying a value for the limit parameter. Though they may return more results, our current unpaginated requests are still ultimately subject to a timeout limit, which means requests that work successfully one day may fail later due to factors such as server load and network latency.

Pagination limits provide a mechanism to specify a page size that we should always be able to serve regardless of these factors. To prevent current integrations from breaking, pagination is not enabled by default on "grandfathered" endpoints; instead, you can request paginated results by providing the optional limit parameter in your query. We will be working to deprecate requests to these endpoints in the future.

Request

curl "https://app.asana.com/api/1.0/tasks?project=1337&limit=5&offset=eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9" \
  -H "Authorization: Bearer <personal_access_token>"

Response

{
  "data": [
    {
      "id": 1000,
      "name": "Task 1",
      ...
    },
    ...
  ],
  "next_page": {
    "offset": "yJ0eXAiOiJKV1QiLCJhbGciOiJIRzI1NiJ9",
    "path": "/tasks?project=1337&limit=5&offset=yJ0eXAiOiJKV1QiLCJhbGciOiJIRzI1NiJ9",
    "uri": "https://app.asana.com/api/1.0/tasks?project=1337&limit=5&offset=yJ0eXAiOiJKV1QiLCJhbGciOiJIRzI1NiJ9"
  }
}

Note that all of Asana's official client libraries support pagination by default.

When making a paginated request, the API will return a number of results as specified by the limit parameter. If more results exist, then the response will contain a next_page attribute, which will include an offset, a relative path attribute, and a full uri attribute. If there are no more pages available, next_page will be null and no offset will be provided. Do note that an offset token will expire after some time, as data may have changed.

When making paginated requests you are able to page through all objects for a particular query up to 100 objects at a time. Alternatively your query will be truncated at about 1000 objects. In addition, when issuing non-paginated requests to organizations with a large number of objects queries may time out before returning. For these reasons, we recommend that you paginate all requests to the API.

ParameterDescription
Limit20 The number of objects to return per page. The value must be between 1 and 100.
OffseteyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9 An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results.

Note: You can only pass in an offset that was returned to you via a previously paginated request.

This method returns paginated results for tasks from a project.


Input/Output Options

GET url params

?opt_pretty
?opt_fields=followers,assignee

PUT or POST body options

options: { 
  pretty: true,
  fields: ["followers", "assignee"]
}

In addition to providing fields and their values in a request, you may also specify options to control how your request is interpreted and how the response is generated. For GET requests, options are specified as URL parameters prefixed with opt_. For POST or PUT requests, options are specified in the body. If the body uses the application/x-www-form-urlencoded content type, then options are prefixed with opt_ just like for GET requests. If the body uses the application/json content type, then options are specified inside the top-level options object (a sibling of the data object).

?opt_fields=name,notes&opt_pretty response

HTTP/1.1 200
{
  "data": {
    "name": "Make a list",
    "notes": "Check it twice!",
    "gid": 1224
  }
}

These options can be used in combination in a single request, though some of them may conflict in their impact on the response.

OptionDescriptionNotes
prettyProvides the response in "pretty" output. 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.
fieldsSome requests return compact representations of objects, to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below.The id of included objects will always be returned, regardless of the field options.

SELECTING FIELDS

opt_fields nesting

"data": {                       < this
  "gid": 1001,
  "name": "Feed the cat",       < this.name
  "workspace": {                < this.workspace
    "gid": 14916,
    "name": "Shared Projects",  < this.workspace.name
  },
  "followers": [{               < this.followers
    "gid": 1234,
    "email": "tbizarro@…",      < this.followers.email
  }, {
    "gid": 5678,
    "email": "gsanchez@…",      < this.followers.email
  }]
}

Some output options allow you to reference fields of objects to include in the response. The way to specify a field is by path. A path is made up of a sequence of terms separated by the dot (.) operator. It takes the form this.a.b… where this refers to an object returned at the top level of the response, a the name of a field on a root object, b a field on a child object referred to by a, and so on.

For example, when retrieving a task or tasks, the path this.followers.email refers to the email field of all users mentioned in the followers field of the task or tasks returned. See the annotated output below:

There are also some advanced operators you can use for shorter syntax in selecting fields:

( .. | .. )

The group operator can be used in place of any whole term in a path, and will match any of a group of terms.

this.(followers|assignee).email will match the email field of the assignee object or any of the followers.


Custom External Data

Custom external data allows a client application to add app-specific metadata to Tasks in the API. The custom data includes a string id that can be used to retrieve objects and a data blob that can store character strings.

The blob may store unicode-safe serialized data such as JSON or YAML. The external id is capped at 1,024 characters, while data blobs are capped at 32,768 characters. Each object supporting external data can have one id and one data blob stored with it. You can also use either or both of those fields.

The external id field is a good choice to create a reference between a resource in Asana and another database, such as cross-referencing an Asana task with a customer record in a CRM, or a bug in a dedicated bug tracker. Since it is just a unicode string, this field can store numeric IDs as well as URIs, however, when using URIs extra care must be taken when forming queries that the parameter is escaped correctly. By assigning an external id you can use the notation external:custom_id to reference your object anywhere that you may use the original object id.

Note: that you will need to authenticate with Oauth, as the id and data are app-specific, and these fields are not visible in the UI. This also means that external data set by one Oauth app will be invisible to all other Oauth apps. However, the data is visible to all users of the same app that can view the resource to which the data is attached, so this should not be used for private user data.

ParameterDescription
idcontractor_name The external id. Max size is 1024 characters. Can be a URI.
data{ "time_estimate": 3600, "time_spent": 1482 } The external data blob. Max size is 32,786 characters.

Deprecations

Communicating about breaking changes

Whenever possible, the Asana API aims to preserve backwards compatibility for its users. Apps you write on top of the API now should, in ideal situations, continue to work indefinitely. However, there are a few rare cases where breaking changes are required. For example:

If a breaking change is required, the API team will provide a number of resources to help our developers get through the change:

Response header notifications

While the previously mentioned communication channels are the best place to learn about upcoming changes, the API itself will also alert you of upcoming changes. Shortly after we post communication, the API will begin sending Asana-Change headers in the responses. These headers will have two or three pieces of information:

This header may be present multiple times in the response if there are multiple ongoing changes. Here's an example of one of these headers:

Asana-Change: name=security_headers;info=https://asa.na/api-sh;affected=true
Asana-Change: name=other_change;info=https://asa.na/api-oc

Note: If your request is not affected, we will not claim affected=false. This is in case, during the deprecation, we detect that the change has a larger scope than initially thought. A request going from "you may be affected" to "you definitely are affected" is an acceptable update, but a request going from "you definitely are not affected" to "you definitely are affected" is not an acceptable update.

Request header options

During the deprecation period, you can test out how the API will behave by sending additional headers in your requests. Sending an Asana-Enable header including comma-separated names of features will turn those features on for that request. Sending an Asana-Disable header will do the opposite and turn those features off for that request.

If no header is specified, the default behavior will be determined by how far into the deprecation period we are:

The start, activation, and end dates will clearly be documented in our communications. These days may be pushed into the future if we discover that developers need more time to migrate their apps, but they are guaranteed to never occur sooner than documented.

These dates are arranged such that, if a developer happens to miss our communication and their app breaks when the default behavior changes on the activation date, they can begin sending the Asana-Disable header to restore the old behavior and use the remaining half of the deprecation period to make their app compatible.

Here's an example of how these headers would look:

Asana-Enable: security_headers,another_change
Asana-Disable: a_third_change

Aside from reserving the right to push the date of changes to a future date, the precise time during the activation date isn't specified. However, since the default will only affect your integration if you do not pass either the Asana-Enable or Asana-Disable headers for a particular deprecation you can ensure predictable behavior of our API for your app during the entire period, including throughout the activation date.

The way we recommend you implement these changes in your integration is this:

At this point, your integration has been migrated to the new behavior. At any point after the end date the Asana-Enable header will be ignored by the Asana API and you can feel free to remove it. (We strongly recommend keeping it all the way through the end date in case of unforseen circumstances that cause us to temporarily reset the default behavior from the new implementation to the deprecated behavior.)

Client library support

The latest version of our official client libraries for Python, Java, PHP, and Javascript all support sending custom headers and are able to use our deprecations framework. Consult the individual libraries for how to send headers with each request.

Active deprecations

Here is a table of recent, ongoing, and upcoming deprecations, including their header names, links to resources, and relevant dates where available. If dates are available, the next date to occur for that change is bolded.

DeprecationHeader nameStart dateActivation dateEnd date
Security headerssecurity_headers2018-08-032018-09-282018-11-15
New rich textnew_rich_text2018-08-072018-10-152018-12-17
New task subtypesnew_task_subtypes2018-10-01See [1]1 mo. after activation
New sectionsnew_sections2019-01-28See [2]See [2]
String IDsstring_ids2019-02-122019-08-132020-02-11

[1] The activation date for this change will be one month after the public launch of the new task subtype. The end date for this change will be two months after the public launch.

[2] This migration is happening simultaneously with the rollout of a change to the Asana web app, and so the timeline for it is subject to change with ongoing development of the web app. Refer to the deprecation details for the most current information.


Why use Asana's API?

Asana’s API and you

Collaboration across teams and tools works best when everyone stays in sync and processes flow easily and without friction. This is why we have Asana's API: it's a platform to ensure all of your information is up to date and that your teams stay efficient and in the loop.

Asana’s API provides a means for software and scripts to read information from inside Asana, input information from outside Asana, and automatically react when things change. This can include:

The role of Asana's platform is to allow Asana to meet your team where you are and how you work. Asana is built to be flexible and powerful, to be intuitive enough for all teams to adopt and maintain clarity on who is doing what by when. Asana’s platform enables you to specialize this flexibility to maximize efficiency. Here are some ideas for what you can build:

Doing repetitive work

Integrations and bots are great for making sure that repetitive tasks are always taken care of. Running a script with Asana's API can quickly take care of work like moving cards between board columns, setting assignees or due dates based on the state of the task, or asking that all custom fields are set before work can begin on a task. This can save time and overhead when trying to keep your projects clear and correct.

Reacting to changes

Workflows with Asana often have a "when this task changes, do something" feel. An example is moving tasks between projects based on subtasks: if one team completes a subtask, move the parent task to the next team's project. Integrations can be built to respond in near-real time to changes in Asana to move work forward to the next step.

Generating reports

Fetching the state of the tasks in a project or for your teammates can unlock the ability to create simple - or complex - metrics around how you are progressing. How many open tasks are there in the project? Who has the most tasks assigned? How often does the due date of each task get shifted back? Our platform enables pulling of data from Asana to make customized metrics to track your work.

Keeping in sync

Teams frequently use a multitude of software tools to accomplish work, from email to asset management to file storage. These specialized tools are often used with colleagues who don't track their work with Asana; and even if they do, keeping all of your tools in sync makes the transitions between tools straightforward to minimize work about work.

Some of our integration partners, like Tray.io, Unito, and Zapier, offer syncing solutions out of the box with common workplace tools, or you could build your own solution in cases where you need more flexibility, such as when connecting to customized or internally-built software.

Capturing work

Asana is built for teamwork and knowing who is doing what by when. Having an easy way to capture information in Asana makes it less likely that work will slip through the cracks. For example, when communicating with people who work in other companies who aren't members of your Asana organization, an integration like we built for Gmail lets you create follow-up tasks with just a few clicks.

Getting information into Asana in a quick and easy way is important for ensuring that you don’t drop the ball. Asana’s platform is a great way to pull information from many channels into Asana with minimum hassle.

Extending Asana

Asana is built to be a tool that works well for all teams, so we build features into our core product that aren't overly opinionated about how you get work done. At the same time, there is opportunity for teams to use Asana in a specialized way or with specific additional features. When there are features that you'd like Asana to have, our platform is a resource to make them happen. As a matter of fact, some of our more successful integrations like Instagantt exist purely to provide additional features to Asana.

Customizing workflows

Integrations or scripts work great to maintain a custom workflow, saving a team member from having to continually pay attention to the state of tasks in Asana.

Whether it's ensuring that custom fields are filled out, tasks are completed, tasks live in the correct board-view column, or automatically assigning tasks at certain stages in your process, integrations can react to changes in Asana to ensure that everyone is up to date. When processes mature around how you get work done, it's a great time to use Asana's platform to make sure everything stays consistent and clear.

Check out some examples of integrations we've built on Asana below:

Learn more or submit an app you've built

Read more on how to get started building on Asana or submit an app to add to our apps page.

Q&A Response

Asana's API enables customization and automation of your organization’s workflow through scripts built to specialize your use of Asana. Using Asana to track your work and leveraging Asana’s API to automate your processes is a powerful combination which can make your team much more efficient. Here's one example of how we do it at Asana.

Tracking timely responses to support questions

Asana’s developer relations team manages technical support for our API through a number of channels: support tickets, questions about our API and integrations forwarded on from our colleagues, the Asana Community's Developer category, Stack Overflow, pull requests and bug reports from open-source GitHub projects like our client libraries, and more. Staying on top of all of these channels can be daunting, but we want our users to reach us however works best for them. At the same time, we want to isolate the noisiness of incoming requests for our colleagues at Asana who are involved with only one channel.

Additionally, the management of the question and answer process, triaging the incoming requests, troubleshooting with our engineers, and measuring our response performance are all internal processes. Even if we have a workflow in place to support our developer relations team, we want the experience for other teams to be easy and lightweight. We want to ensure our coworkers do the right things by default without hindering the consistency of our work and our ability to track progress.

Our solution: automation and reporting through our API to provide consistent management of the whole process.

To do this, we wrote an integration with the following goals in mind:

The script we built does the following for us:

  1. Integrate with external sources to put incoming questions into Asana, one project per channel.
  2. Add question tasks from each incoming project into a single combined project.
  3. Acknowledge a question has been received and begin tracking response times.
  4. Upon first response, complete a task to signal relevant followers that we've reached out.

Maintain focus

We use webhooks to get notified in near-real time when new tasks are created in any of several Asana projects, one per incoming channel. Some of these projects are automatically synced with outside sources, others are available for our coworkers to create tasks in. Keeping tasks in their source channel helps keep us organized for where to go to respond. These projects are what our colleagues follow in order to remain focused on their own channels.

Our script responds to these webhook notifications from each project by adding these tasks into a single "Developer Questions" project. Our developer relations team can then see all outstanding questions about our API in a single place. This is a key part of hitting our service level agreement (SLA) goals: not having to cycle through many projects and channels to see how we're progressing.

Ensure timely responses

Once a question gets added to our Developer Questions project, our integration creates a subtask on it. This signals to our colleagues that we have received the question and will begin to triage and investigate. The subtask is completed when we first respond to our users to inform them that we're investigating. Completion of the question task itself signals that we've achieved a resolution for the person who reached out to us.

Track progress

Our script can generate a simple report to see which questions are still open, how long they’ve been open, and how much time we have left to answer before we miss our service level agreement limits. A simple webpage that the integration creates enables a high level view of what's still in progress and how timely we've been in the past.

Keep the process moving, automatically

Our integration also helps automate some of the routine steps to ensure questions get answered. After a task gets triaged for priority, our integration sets an appropriate due date. It can also set an assignee and followers based on current workload and by matching certain keywords in the task description. If the task approaches its due date and it has not received a response, the script comments on the task to alert us that the question is about to reach our SLA limit. This helps us keep the right people in the loop with minimal overhead and maximum clarity of what needs to be done by when.

By managing this routine and specialized workflow with automation through Asana’s API, our team is more efficient, more effective, and less likely to make a mistake. We know how responsive we've been and can see how we're doing at any time. We're better able to minimize the number of questions which slip through the cracks. The result is better support for outside developers and increased focus on core work, not work about work.

Over time, we've continuously tweaked how our integration behaves to evolve our process, empowering us to adjust and iterate our approach. This is one of the key opportunities that Asana's API provides: ownership and control over how work gets done. Incremental improvements provide the chance to try out new workflows and settle on one that works well for everyone, leading to a more consistent and customized experience of using Asana.

To get started, check out our quick start page for an overview of Asana's API. For support or to generate ideas of how your team can work more effectively with Asana, head to the Asana Community to chat with Asana team members and users!


Bot examples

Reminder bot

Even the most conscientious and best-intentioned teammate can get overloaded and occasionally forget a task. For project managers, team leads, or coordinators, it can be draining to check-in on everyone to make sure that everything is going according to schedule. How can you stay on track and minimize the work-about-work?

Instead of continually reminding teammates to stay focused, use Asana’s API to create a bot for automatic reminders (a bot is a script that performs a task automatically). In this case, a "ping bot" takes action when due dates are approaching (or for any other specified trigger). This can act as a more intelligent version of the reminders that Asana already sends when due dates approach. For example, this persistent friend could comment with reminders further in advance, ask assignees or followers to take some action like setting a custom field, re-assign the work, and/or push out due dates. With a bot taking care of the schedule and reminders, people can spend their time on the work that needs human attention, like ideation and feedback.

Recruiting bot

At Asana, we use a bot to help automate the job application process for engineering candidates. When candidates complete a coding test, the test needs to get graded in a timely manner to keep the interview process on track and to keep the candidate from feeling stranded or forgotten about.

Once candidates have submitted their coding test, a bot uses the Asana API to assign the test to a grader based on specific criteria tracked in Asana, such as their preferred programming languages and number of previous evaluations. Graders are given x days to grade tests (the bot takes into account when graders are out of office). If tests have not been graded by the due date, graders are pinged by the bot with a comment on the task to either grade the test or re-assign it to someone else. After x days, the bot automatically re-assigns the test to the next grader to keep the process moving.

Bugs bot

Our engineering teams handle triaging bug reports by creating a task in a "Bugs" project. A bot then adds the project manager of the relevant team in Asana as a follower, moves the task into a "needs triage" section, and requests assistance. The project manager can then evaluate the bug and triage it.

Since the evaluation of the severity of the bug is important for understanding how urgent the fix is, Bugs Bot will remain persistent, commenting every few days until the task has been moved out of the triage section and into a section of the relevant priority. This process ensures that we're aware of the impact of bugs and helps us avoid severe bugs slipping through the cracks.


How to use the API

Request

https://app.asana.com/api/1.0/users/me

If you're familiar with building against APIs, you can jump to our Quick Start.



If you’re new to developing on APIs, this is a great place to start. You’ll learn in this guide how to make the simplest Asana API request -- getting your user information.

To get started

  1. Be logged into Asana.
  2. Go to this URL: https://app.asana.com/api/1.0/users/me

Response

{
  "data": {
    "gid": "12e345a67b8910c11",
    "email": "jonsnow@example.com",
    "name": "Jon Snow",
    "photo": {
      "image_21x21": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_21x21.png",
      "image_27x27": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_27x27.png",
      "image_36x36": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_36x36.png",
      "image_60x60": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_60x60.png",
      "image_128x128": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_128x128.png"
    },
    "resource_type": "user"
  }
}

And Congratulations! You’ve just made your first Asana API request.



Let’s unpack what just happened. The base URL for all requests to the Asana API is https://app.asana.com/api/1.0. We want information about users, so we go down a level to the https://app.asana.com/api/1.0/users resource. Within the set of all users in Asana, We’re specifically looking to get information about our own account, so we get more specific by adding /me to get https://app.asana.com/api/1.0/users/me. The /me part would ordinarily be an identifier (a long number) or email address of the user, but we've created this shorthand for getting the current user of Asana's API, whomever that may be. Put it together and you have the above path to get your user information from Asana.

Since every API request you make will start with the same base URL ('https://app.asana.com/api/1.0'), we'll just talk about what comes next in the URL -- which is often referred to as a 'resource' or 'path'. For instance, when we say /users/me it's actually shorthand for the entire URL which would be https://app.asana.com/api/1.0/users/me.

After requesting information from the API, you will receive a resposne in JSON format, which can be read and understood by both humans and computers. It's structured in a particular way so programs can rely on a consistent format for the data.

Our API is documented for what resources are available and what sort of return data to expect. For example, here are the docs for the /users endpoint which we just called. This is where you can discover what's possible with our API.

Now, let’s make the same call to /users/me more like software would. Before we do so, we’ll need to get access outside of your web browser to the API.


Authentication Quick Start

Similarly to entering your username/password into a website or logging into Asana with Google, when you access your Asana data via the API you need to authenticate. In the above example, you were already logged into Asana in your browser so you were able to authenticate to the API with credentials stored by your browser.

If you want to write a script that interacts with the Asana API, the easiest method is to get a Personal Access Token (PAT), which you can think of as your unique password for accessing the API.

App or PAT?

If your app needs to perform actions on behalf of users, you should use OAuth.

Getting a Personal Access Token (PAT)

Example PAT

0/68a9e79b868c6789e79a124c30b0
  1. Open the Developer App Management page by using this permalink or following these steps:

* From within Asana, click your profile photo from the top bar and select "My Profile Settings"

* Click the "Apps" tab

* Click "Manage Developer Apps"

  1. Click "+ Create New Personal Access Token"

  2. Type a description of what you’ll use the Personal Access Token for.

  3. Click "Create"

  4. Copy your token. You will only see this one time, but you can always create another PAT later.

Note: treat your PAT like you would a password. Do not share it or display it online.


Accessing the API in the Terminal

curl Request

curl https://app.asana.com/api/1.0/users/me \
  -H "Authorization: Bearer 0/123456789abcdef"

We’ll use cURL, a command line[^1] program to make HTTP requests. MacOS and many Linux distributions have cURL pre-installed, and it’s available for download on Windows and many other operating systems. If you’re curious, you can learn more about cURL in its own documentation.

Let’s do this:

Response

{
  data: {
    gid: "<your id>",
    email: "<your email>"
    name: "<your name>",
    ...
  }
}
  1. Open a terminal (instructions for Mac and Windows)

  2. Copy/paste the cURL request on the right (make sure to enter your personal access token instead of the placeholder after the word "Bearer", or else you'll get a "Not Authorized" message):

  3. Press Enter

Nice work! You just wrote a cURL command.

In our API documentation, we will often write examples as cURL commands since it's a middle-of-the-road approach to accessing our API: more flexible than using a browser, but user-friendly enough to be quick and easy to do.

You’re ready to start coding!

Asana has client libraries in several popular coding languages. Using these libraries has several advantages (like managing authorization and retrying errors) that make them a good place to go from here. Let’s take a look at making the same /users/me request in Python, JavaScript, and Ruby (feel free to skip ahead to your favorite of the three languages).


Accessing the API with Postman

You can quickly get started on Asana's API with the API Explorer. However, if you want a more robust experience hitting the API, we recommend using Postman. You can get started with the 'Run in Postman' button!

Once you have the collection, you should create an environment.

You'll want to set:

  1. authentication_token to a PAT. If you don't have one yet, visit our Authentication Quick Start
  2. workspace to your workspace's gid, you can find via a logged-in browser by going to https://app.asana.com/api/1.0/users/me/workspaces, or you can hit that endpoint using your PAT
  3. any other gids you want to easily access.
    1. For example, in my Postman. I set task to the gid of a task I regularly test with, project to a the gid of a private sandbox project, and user to the string 'me'.

No need to edit your environment for requests on different objects, simply navigate to the endpoint you want to use, and change the {{object}} to any gid you want.

Importing this collection gives you a snapshot of the API at this time. To stay up to date with API changes, you'll have to re-import the collection by hitting the 'Run in Postman' button, and choosing to override your existing collection. This means if you want to save custom requests, you should do so in a different collection.


Quick Start

Triage Bot

We will use a very basic file structure for the purposes of this guide. Start by making a project directory, moving into it, and running npm init.

$ mkdir triage-bot
$ cd triage-bot
$ npm init

Install the Node Asana client library and create config and app files:

$ npm install asana
$ touch config.js app.js

Add gids (global ids) for the workspace, design request project, and designers that will be assigned requests (note that all ids in Asana should be strings). You can get a project’s gid from its URL in the Asana web product (e.g. the structure of links for a task is www.asana.com/0/{project_gid}/{task_gid}). Similarly, you can get user’s gid from the URL of their task list (i.e. click on their name in Asana). To get your workspace gid(s), go to https://app.asana.com/api/1.0/users/me/workspaces.

let config = {
  workspaceId: "15793206719",
  designRequestProjectId: "180350018127066",
  //gids of designers who are fulfilling design requests
  designers: ["180015866142449", "180015866142454", "180015886142844"]
};

module.exports = config;

Next, let’s get started on our app.js file. Include the Asana node client library and the config file:

let asana = require('asana');
let config = require('./config');

Get your access token and use it to create an Asana client. At the time of writing this guide, the Asana API is going through two deprecations (moving to string gids and changing how sections function). You can learn about our deprecations framework in our docs. To prevent my app from breaking when the deprecations are finalized, I'm passing headers to enable the new API behavior for string gids and sections. We will also set a delay to determine how quickly our parallel requests are sent.

// Get personal access token (PAT) from environment variables.
const accessToken = process.env.triage_bot_pat;

const deprecationHeaders = {"defaultHeaders": {"asana-enable": "new_sections,string_ids"}};

// Create Asana client using PAT and deprecation headers.
const client = asana.Client.create(deprecationHeaders).useAccessToken(accessToken);

// Request delay in ms
const delay = 200;

Use the search API to fetch unassigned tasks from the design requests project. Note that the search API doesn’t return paginated results so you need to pass the max limit which is 100. If there are often more than 100 unassigned tasks, you can add a function to keep running the script until there are no more unassigned tasks.

function getUnassignedTasks() {
  let workspaceId = config.workspaceId;
  let params = {
    "projects.any" : config.designRequestProjectId,
    "assignee.any" : "null",
    "resource_subtype": "default_task",
    "fields": "gid",
    "limit": 100
  };
  client.tasks.searchInWorkspace(workspaceId, params).then(tasks => {
    randomAssigner(tasks.data);
  });
}

We’ll need a few helper functions. One to shuffle an array and another to assign tasks.

function shuffleArray(array) {
  for (let i = array.length - 1; i > 0; i--) {
      let j = Math.floor(Math.random() * (i + 1));
      let temp = array[i];
      array[i] = array[j];
      array[j] = temp;
    }
  return array;
}

function assignTask(taskStringId, assigneeStringId) {
  client.tasks.update(taskStringId, {assignee: assigneeStringId})
}

Our final function will take the array of unassigned tasks and round-robin assign them to the group of shuffled designers from the config file. We will use an interval to loop so we can control the speed of the requests. You can change the delay with the const you declared earlier. This is a balance between speed and staying within our concurrent request limit. In node, a normal loop would send all requests at once, which doesn’t work in larger projects.

function randomAssigner(unassignedTasks) {
  let shuffledDesigners = shuffleArray(config.designers);
  let numDesigners = shuffledDesigners.length;

  // Let's use an interval to loop, so we control how quickly requests are sent
  let index = 0;
  let interval = setInterval(function() {
    assignTask(unassignedTasks[index].gid, shuffledDesigners[index % numDesigners]);
    index++;

    // When our index reaches the end, we're done
    if (index >= unassignedTasks.length) {
      clearInterval(interval);

      console.log("You've assigned " + unassignedTasks.length + " new design requests");
    }
  }, delay);
}

Then we just need to call our getUnassignedTasks function to kick-off the script:

getUnassignedTask();

Now run your script, sit back, and watch the bot do your work.

$ node app.js

Why build a bot?

When processes get complex in Asana there can begin to be work about work. This could be happening to you (or someone you love) if you find yourself spending time doing repetitive work such as triaging tasks, reminding people to do something, or adding/removing followers as you move a task through a workflow.

What we’re going to build

In this guide, we will build a simple triage bot that will assign tasks. This is a common Asana use case with support inboxes or request projects.

If you want to skip ahead and see the code for the triage bot, it’s on Github in the Javascript folder of our devrel-examples repo: https://github.com/Asana/devrel-examples.

For this guide, let’s suppose a design team has a requests project where people from the marketing team fill out an Asana form to request graphics from the design team. The form creates a task in the design requests project that needs to be assigned to a designer.

Our triage bot will gather all unassigned tasks in the design request project and then randomly distribute the requests across a group of designers.

For the purposes of this guide, we will keep it this simple, however, you could add more complex logic to your bot. For instance, you could check custom field values on the request task to see what type of request it is (e.g. video, graphic, logo, etc.) and then assign it to the designer that has those skills. You could go even further and check the designers workload to see who currently has the least amount of work already assigned to them (this could be determined by a point value for tasks assigned to them in the project). You could then have the bot ping the design request task as it approaches the due date to ensure that the designer will have it completed on deadline.

Before we get started, here are some helpful links for building on the Asana API:

Create your bot user in Asana

Create a new Asana account for your bot (instructions for inviting users). You want to create a distinct Asana account for your bot because any action it takes in Asana will be attributed to this user. Give your bot a name and photo that will be recognizable to users in Asana that encounter it. Note that if your bot is a guest member in Asana that it will need to be added to every project you need it to work in. Bots based on guest Asana accounts will also not have access to some API features such as defining new custom fields or modifying their settings.

Authenticating your bot

We will authenticate our bot using a Personal Access Token (PAT). Log in to the Asana account that will be used for the bot and navigate to the developer console. You can get to your dev console by either using this URL https://app.asana.com/-/developer_console or from within Asana by clicking your photo icon in the upper right of Asana -> My Profile Settings -> Apps -> Manage Developer Apps.

Next, click “+ New access token” and follow the instructions to get your token. Treat this token like a username and password. Don’t share it with anyone and never publish it to a public repository. I like to save my PAT as an environment variable (here are instructions on how to do this on Mac). For this guide, I’ve saved a PAT as an env variable called triage_bot_pat.

Create an Asana sandbox

Before we start coding, create a project in Asana to use as a sandbox. While not required, I like to set the project to private while developing. To get some users in the project, add your main Asana user as well as your bot account. You could also invite a personal email as a guest user.

Choose an Asana client library

The Asana API has SDKs in several popular languages. For most developers, we recommend using one of our client libraries because they help with some of the complexities of using an API such as authentication, pagination, and deprecations.

For this guide, we will use the Asana Node client library, however, you can follow along in any language of your choice.

Each library has an examples folder in addition to the readme, which can be helpful for getting started. The methods for each resource can be found in the “gen” folder of each client library (e.g. node-asana/lib/resources/gen/).

Let’s start coding!

If you haven't already, follow the code and headers in this section. This will walk you through the terminal commands and code with explainations along the way.

Congratulations! Now go above and beyond

You’ve created an Asana triage bot. Let’s explore a few ideas on how to make it even better.

Deploy your app

While you can run your bot from the command line, that seems like a lot of work to run a bot that’s supposed to eliminate work about work.

One option is to use launchd to automatically execute your script (launchd is like cron but better). Here’s a tutorial to get you started with launchd.

The next step would be to deploy to a hosted server. Here’s a guide exploring some of the popular hosting providers. Hosting your app makes it more resilient and allows you to create more sophisticated apps (e.g. use webhooks).

Use Asana as your config file

To take your bot’s accessibility to the next level, put your configuration in an Asana task(s) and then have your script read that task(s) for instructions. This allows you (or anyone else) to make config changes without touching any code. For example, if a designer is on vacation, you can easily remove them from the group that gets assigned requests. Similarly, if a designer joins or leaves the team, this change could be easily configured in a task instead of having to change the bot’s code.

To see this approach in the wild, checkout Ohmega, an automation framework we created. Here’s the configuration service that reads a tree of tasks for its configuration.

Use webhooks for real-time triaging

If you need your bot to react to changes in real time, then you’ll need to use webhooks. We built a python webhook inspector to help developers get started using Asana webhooks.


Python Hello World

import asana

# replace with your personal access token. 
personal_access_token = '0/123456789....'

# Construct an Asana client
client = asana.Client.access_token(personal_access_token)
# Set things up to send the name of this script to us to show that you succeeded! This is optional.
client.options['client_name'] = "hello_world_python"

# Get your user info
me = client.users.me()

# Print out your information
print "Hello world! " + "My name is " + me['name'] + "!"

To get started, run pip install asana or follow the detailed installation instructions on the GitHub page for the Python client library.

Once it’s installed, open your favorite text editor and we’ll code a GET request to /users/me - the same request as above, but in Python.

Save this file as something descriptive like "hello_world.py"

To run this script in your console, pass it as an argument to the python interpreter, i.e. python hello_world.py from the same directory as the file. You should see the message we wrote above with your user information.

As an aside, for clarity python-asana will also work with Python 3.x (with small changes to the above example to make it compatible.)

All of the built-in functions can be found in the /gen folder of the client library.

You can see a variant of this script, and other useful Asana API scripts, in our open-source Github examples repository


Node Hello World

var asana = require('asana');

// replace with your personal access token. 
var personalAccessToken = '0/123456789....';

// Construct an Asana client
var client = asana.Client.create().useAccessToken(personalAccessToken);

// Get your user info
client.users.me()
  .then(function(me) {
    // Print out your information
    console.log('Hello world! ' + 'My name is ' + me.name + '!');
});

To get started, npm install asana or follow the detailed installation instructions on the GitHub page for the Node client library.

Once it’s installed, open your favorite text editor and we’ll code a GET request to /users/me. - the same request as above, but in JavaScript.

Save this file as something descriptive like "hello_world.js"

To run this script in your console, pass it as an argument to the node interpreter, i.e. node hello_world.py from the same directory as the file. You should see the message we wrote above with your user information.

All of the built-in functions can be found in the /gen folder of the client library.

You can see a variant of this script, and other useful Asana API scripts, in our open-source Github examples repository


Ruby Hello World

require 'asana'

# replace with your personal access token. 

personal_access_token = '0/123456789....'

client = Asana::Client.new do |c|

  c.authentication :access_token, personal_access_token

end

me = client.users.me

puts "Hello world! " + "My name is " + me.name + "!"

To get started, gem install asana or follow the detailed installation instructions on the GitHub page for the Ruby client library.

Once it’s installed, open your favorite text editor and we’ll code a GET request to /users/me.

Save this file as something descriptive like "hello_world.rb"

To run this script in your console, pass it as an argument to the ruby interpreter, i.e. ruby hello_world.rb from the same directory as the file. You should see the message we wrote above with your user information.

All of the built-in methods can be found in the /resources folder of the client library.

You can see a variant of this script, and other useful Asana API scripts, in our open-source Github examples repository


Official Client Libraries

Asana is committed to making the developer experience as smooth as possible. Part of this effort is providing high-quality libraries you can use to access the API. The available libraries are listed below, and more are in development. If you don't see what you need, check the open-source community for your platform, and let us know that you'd like to find one here!


JavaScript (Node)

npm install asana

For use in the Node server-side JavaScript runtime.

Links: GitHub

Installation: Install with npm


JavaScript (Browser)

<script src="asana-min.js"></script>

This is built from the Node library above, so you get the exact same interface.

Links: GitHub

Installation: Visit the releases page to download the latest full or minified JS bundle, then include the script in your web page.


Python

pip install asana

Links: GitHub

Installation: Install with pip


Ruby

gem install asana

Links: GitHub

Installation: Install with gem


Java

<dependency>
  <groupId>com.asana</groupId>
  <artifactId>asana</artifactId>
  <version>0.6.0</version>
</dependency>

Links: GitHub

Installation: If you use Maven for dependency management simply include the following in your pom.xml.


PHP

"require": {
  "asana/asana": "^0.1.2"
}

Links: GitHub

Installation: If you use Composer to manage dependencies you can include the "asana/asana" package as a dependency.


API Reference

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

This is the interface for interacting with the Asana Platform. Our API reference is generated from our OpenAPI spec.

Base URLs:

Terms of service Web: Asana Support License: Apache 2.0


Attachments

GET /attachments/{attachment_gid}
GET /tasks/{task_gid}/attachments
POST /tasks/{task_gid}/attachments

An attachment object represents any file attached to a task in Asana, whether it’s an uploaded file or one associated via a third-party service such as Dropbox or Google Drive.


Get an attachment

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/attachments/{attachment_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /attachments/{attachment_gid}

Get the full record for a single attachment.

Parameters

NameInTypeRequiredDescription
attachment_gidpathstringtrueGlobally unique identifier for the attachment.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "attachment",
    "name": "Screenshot.png",
    "created_at": "2012-02-22T02:06:58.147Z",
    "download_url": "https://www.dropbox.com/s/123/Screenshot.png?dl=1",
    "host": "dropbox",
    "parent": null,
    "view_url": "https://www.dropbox.com/s/123/Screenshot.png"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the record for a single attachment.Attachment
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
402Payment RequiredThe request was valid, but the queried object or object mutation specified in the request is above your current premium level.None
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
424Failed DependencyYou have exceeded one of the enforced rate limits in the API. See the documentation on rate limiting for more information.Error
500Internal Server ErrorThere 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.Error
501Not ImplementedThere is an issue between the load balancers and Asana's API.Error
503Service UnavailableEither the upstream service is unavailable to the API, or he API has been intentionally shut off.Error
504Gateway Time-outThis request took too long to complete.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get attachments for a task

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tasks/{task_gid}/attachments \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tasks/{task_gid}/attachments

Returns the compact records for all attachments on the task.

Parameters

NameInTypeRequiredDescription
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "attachment",
      "name": "Screenshot.png"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the compact records for all attachments on the task.Attachment
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Upload an attachment

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/tasks/{task_gid}/attachments \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /tasks/{task_gid}/attachments

Upload an attachment.

This method uploads an attachment to a task and returns the compact record for the created attachment object. It is not possible to attach files from third party services such as Dropbox, Box & Google Drive via the API. You must download the file content first and then upload it as any other attachment.

The 100MB size limit on attachments in Asana is enforced on this endpoint.

This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded.

Requests made should follow the HTTP/1.1 specification that line terminators are of the form CRLF or \r\n outlined here in order for the server to reliably and properly handle the request.

Body parameter

file: string

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe file you want to upload.
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Detailed descriptions

body: The file you want to upload.

Note when using curl:

Be sure to add an ‘@’ before the file path, and use the —form option instead of the -d option.

When uploading PDFs with curl, force the content-type to be pdf by appending the content type to the file path: —form “file=@file.pdf;type=application/pdf”.

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "attachment",
    "name": "Screenshot.png",
    "created_at": "2012-02-22T02:06:58.147Z",
    "download_url": "https://www.dropbox.com/s/123/Screenshot.png?dl=1",
    "host": "dropbox",
    "parent": null,
    "view_url": "https://www.dropbox.com/s/123/Screenshot.png"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully uploaded the attachment to the task.Attachment
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Batch API

POST /batch

There are many cases where you want to accomplish a variety of work in the Asana API but want to minimize the number of HTTP requests you make. For example:

To make development easier in these use cases, Asana provides a batch API that enables developers to perform multiple “actions” by making only a single HTTP request.

Making a Batch Request

To make a batch request, send a POST request to /batch. Like other POST endpoints, the body should contain a data envelope. Inside this envelope should be a single actions field, containing a list of “action” objects. Each action represents a standard request to an existing endpoint in the Asana API.

The maximum number of actions allowed in a single batch request is 10. Making a batch request with no actions in it will result in a 400 Bad Request.

When the batch API receives the list of actions to execute, it will dispatch those actions to the already-implemented endpoints specified by the relative_path and method for each action. This happens in parallel, so all actions in the request will be processed simultaneously. There is no guarantee of the execution order for these actions, nor is there a way to use the output of one action as the input of another action (such as creating a task and then commenting on it).

The response to the batch request will contain (within the data envelope) a list of result objects, one for each action. The results are guaranteed to be in the same order as the actions in the request, e.g., the first result in the response corresponds to the first action in the request.

The batch API will always attempt to return a 200 Success response with individual result objects for each individual action in the request. Only in certain cases (such as missing authorization or malformed JSON in the body) will the entire request fail with another status code. Even if every individual action in the request fails, the batch API will still return a 200 Success response, and each result object in the response will contain the errors encountered with each action.

Rate Limiting

The batch API fully respects all of our rate limiting. This means that a batch request counts against both the standard rate limiter and the concurrent request limiter as though you had made a separate HTTP request for every individual action. For example, a batch request with five actions counts as five separate requests in the standard rate limiter, and counts as five concurrent requests in the concurrent request limiter. The batch request itself incurs no cost.

If any of the actions in a batch request would exceed any of the enforced limits, the entire request will fail with a 429 Too Many Requests error. This is to prevent the unpredictability of which actions might succeed if not all of them could succeed.

Restrictions

Not every endpoint can be accessed through the batch API. Specifically, the following actions cannot be taken and will result in a 400 Bad Request for that action:


Submit parallel requests

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/batch \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /batch

Make multiple requests in parallel to Asana's API.

Body parameter

{
  "data": {
    "actions": [
      {
        "relative_path": "/tasks/123",
        "method": "get",
        "data": {
          ...
        },
        "options": {
          ...
        }
      }
    ]
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe requests to batch together via the Batch API.
databodyobjectfalsenone
actionsbody[BatchRequest]false[A request object for use in a batch request.]
relative_pathbodystringtrueThe path of the desired endpoint relative to the API’s base URL. Query parameters are not accepted here; put them in data instead.
methodbodystringtrueThe HTTP method you wish to emulate for the action.
databodyobjectfalseFor GET requests, this should be a map of query parameters you would have normally passed in the URL. Options and pagination are not accepted here; put them in options instead. For POST, PATCH, and PUT methods, this should be the content you would have normally put in the data field of the body.
optionsbodyobjectfalsePagination (limit and offset) and output options (fields or expand) for the action. “Pretty” JSON output is not an available option on individual actions; if you want pretty output, specify that option on the parent request.
limitbodyintegerfalsePagination limit for the request.
offsetbodyintegerfalsePagination offset for the request.
fieldsbody[string]falseThe fields to retrieve in the request.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Enumerated Values

ParameterValue
methodget
methodpost
methodput
methoddelete
methodpatch
methodhead

200 Response

{
  "data": [
    {
      "status_code": 200,
      "headers": {
        "location": "/tasks/1234"
      },
      "body": {
        "data": {
          ...
        }
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully completed the requested batch API operations.BatchResult
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Custom Fields

POST /custom_fields
GET /custom_fields/{custom_field_gid}
PUT /custom_fields/{custom_field_gid}
DELETE /custom_fields/{custom_field_gid}
GET /workspaces/{workspace_gid}/custom_fields
POST /custom_fields/{custom_field_gid}/enum_options
POST /custom_fields/{custom_field_gid}/enum_options/insert
PUT /enum_options/{enum_option_gid}

In the Asana application, Tasks can hold user-specified Custom Fields which provide extra information; for example, a priority value or a number representing the time required to complete a Task. This lets a user define the type of information that each Task within a Project can contain in addition to the built-in fields that Asana provides.

Note: Custom Fields are a premium feature. Integrations which work with Custom Fields need to handle an assortment of use cases for free and premium users in context of free and premium organizations. For a detailed examination of to what data users will have access in different circumstances, read the section below on access control.

The characteristics of Custom Fields are:

A brief example: let's imagine that an organization has defined a Custom Field for "Priority". This field is of enum type and can have user-defined values of Low, Medium, or High. This is the field metadata, and it is visible within, and shared across, the entire organization.

A Project is then created in the organization, called "Bugs", and the "Priority" Custom Field is associated with that Project. This will allow all Tasks within the "Bugs" Project to have an associated "Priority".

A new Task is created within "Bugs". This Task, then, has a field named "Priority" which can take on the Custom Field value of one of [null], Low, Medium, and High.

These Custom Fields are accessible via the API through a number of endpoints at the top level (e.g. /custom_fields and /custom_field_settings) and through calls on Workspaces, Projects, and Tasks resources. The API also provides a way to fetch both the metadata and data which define each particular Custom Field, so that a client application may render proper UI to display or edit the values.

Custom Field aware integrations need to be aware of the basic types that Custom Fields can adopt. These types are:

Text fields are currently limited to 1024 characters. On Tasks, their Custom Field value will have a text_value property to represent this field.

Number fields can have an arbitrary precision associated with them; for example, a precision of 2 would round its value to the second (hundredths) place, i.e. 1.2345 would round to 1.23. On Tasks, the Custom Field value will have a number_value property to represent this field.

Enum fields represent a selection from a list of options. On the metadata, they will contain all of the options in an array. Each option has 4 properties:

On the Task's Custom Field value, the enum will have an enum_value property which will be the same as one of the choices from the list defined in the Custom Field metadata.


Create a custom field

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/custom_fields \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /custom_fields

Creates a new custom field in a workspace. Every custom field is required to be created in a specific workspace, and this workspace cannot be changed once set.

A custom field’s name must be unique within a workspace and not conflict with names of existing task properties such as ‘Due Date’ or ‘Assignee’. A custom field’s type must be one of ‘text’, ‘enum’, or ‘number’.

Returns the full record of the newly created custom field.

Body parameter

{
  "data": {
    "name": "Bug Task",
    "type": "text",
    "enum_options": [
      {
        ...
      }
    ],
    "enum_value": null,
    "enabled": true,
    "text_value": "Some Value",
    "description": "Development team priority",
    "precision": 2,
    "has_notifications_enabled": true,
    "workspace": "1331"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjectfalseThe custom field object to create.
databodyobjectfalseCustom Fields store the metadata that is used in order to add user-specified information to tasks in Asana. Be sure to reference the Custom Fields developer documentation for more information about how custom fields relate to various resources in Asana.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the object.
resource_subtypebodystringfalseThe 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.
typebodystringfalseDeprecated: new integrations should prefer the resource_subtype field. The type of the custom field. Must be one of the given values.
enum_optionsbody[object]falseConditional. Only relevant for custom fields of type enum. This array specifies the possible values which an enum custom field can adopt. To modify the enum options, refer to working with enum options.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the enum option.
enabledbodybooleanfalseThe color of the enum option. Defaults to ‘none’.
colorbodystringfalseWhether or not the enum option is a selectable value for the custom field.
enum_valuebodyanyfalsenone
enabledbodybooleanfalseConditional. Determines if the custom field is enabled or not.
text_valuebodystringfalseConditional. This string is the value of a text custom field.
descriptionbodystringfalseOpt In. The description of the custom field.
precisionbodyintegerfalseOnly relevant for custom fields of type ‘Number’. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive.
is_global_to_workspacebodybooleanfalseThis flag describes whether this custom field is available to every container in the workspace. Before project-specific custom fields, this field was always true.
has_notifications_enabledbodybooleanfalseThis flag describes whether a follower of a task with this field should receive inbox notifications from changes to this field.
workspacebodystringtrueThe workspace to create a custom field in.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Enumerated Values

ParameterValue
typetext
typeenum
typenumber

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "custom_field",
    "name": "Bug Task",
    "resource_subtype": "milestone",
    "type": "text",
    "enum_options": [
      {
        ...
      }
    ],
    "enum_value": null,
    "enabled": true,
    "text_value": "Some Value",
    "description": "Development team priority",
    "precision": 2,
    "is_global_to_workspace": true,
    "has_notifications_enabled": true
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedCustom field successfully created.CustomField
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a custom field

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/custom_fields/{custom_field_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /custom_fields/{custom_field_gid}

Get the complete definition of a custom field’s metadata.

Since custom fields can be defined for one of a number of types, and these types have different data and behaviors, there are fields that are relevant to a particular type. For instance, as noted above, enum_options is only relevant for the enum type and defines the set of choices that the enum could represent. The examples below show some of these type-specific custom field definitions.

Parameters

NameInTypeRequiredDescription
custom_field_gidpathstringtrueGlobally unique identifier for the custom field.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "custom_field",
    "name": "Bug Task",
    "resource_subtype": "milestone",
    "type": "text",
    "enum_options": [
      {
        ...
      }
    ],
    "enum_value": null,
    "enabled": true,
    "text_value": "Some Value",
    "description": "Development team priority",
    "precision": 2,
    "is_global_to_workspace": true,
    "has_notifications_enabled": true
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the complete definition of a custom field’s metadata.CustomField
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Update a custom field

Code samples

# You can also use wget
curl -X PUT https://app.asana.com/api/1.0/custom_fields/{custom_field_gid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PUT /custom_fields/{custom_field_gid}

A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. A custom field’s type cannot be updated. An enum custom field’s enum_options cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update enum_options. Locked custom fields can only be updated by the user who locked the field. Returns the complete updated custom field record.

Body parameter

{
  "data": {
    "name": "Bug Task",
    "type": "text",
    "enum_options": [
      {
        ...
      }
    ],
    "enum_value": null,
    "enabled": true,
    "text_value": "Some Value",
    "description": "Development team priority",
    "precision": 2,
    "has_notifications_enabled": true
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyCustomFieldObjectfalseThe custom field object with all updated properties.
custom_field_gidpathstringtrueGlobally unique identifier for the custom field.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "custom_field",
    "name": "Bug Task",
    "resource_subtype": "milestone",
    "type": "text",
    "enum_options": [
      {
        ...
      }
    ],
    "enum_value": null,
    "enabled": true,
    "text_value": "Some Value",
    "description": "Development team priority",
    "precision": 2,
    "is_global_to_workspace": true,
    "has_notifications_enabled": true
  }
}

Responses

StatusMeaningDescriptionSchema
200OKThe custom field was successfully updated.CustomField
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Delete a custom field

Code samples

# You can also use wget
curl -X DELETE https://app.asana.com/api/1.0/custom_fields/{custom_field_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE /custom_fields/{custom_field_gid}

A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. Locked custom fields can only be deleted by the user who locked the field. Returns an empty data record.

Parameters

NameInTypeRequiredDescription
custom_field_gidpathstringtrueGlobally unique identifier for the custom field.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKThe custom field was successfully deleted.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a workspace's custom fields

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/workspaces/{workspace_gid}/custom_fields \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /workspaces/{workspace_gid}/custom_fields

Returns a list of the compact representation of all of the custom fields in a workspace.

Parameters

NameInTypeRequiredDescription
workspace_gidpathstringtrueGlobally unique identifier for the workspace or organization.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "custom_field",
      "name": "Bug Task",
      "resource_subtype": "milestone",
      "type": "text",
      "enum_options": [
        ...
      ],
      "enum_value": null,
      "enabled": true,
      "text_value": "Some Value"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved all custom fields for the given workspace.CustomField
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create an enum option

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/custom_fields/{custom_field_gid}/enum_options \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /custom_fields/{custom_field_gid}/enum_options

Creates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 50 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list. Locked custom fields can only have enum options added by the user who locked the field. Returns the full record of the newly created enum option.

Body parameter

{
  "data": {
    "name": "Low",
    "enabled": true,
    "color": "blue",
    "insert_before": "12345",
    "insert_after": "12345"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjectfalseThe enum option object to create.
databodyobjectfalseEnum options are the possible values which an enum custom field can adopt. An enum custom field must contain at least 1 enum option but no more than 50.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the enum option.
enabledbodybooleanfalseThe color of the enum option. Defaults to ‘none’.
colorbodystringfalseWhether or not the enum option is a selectable value for the custom field.
insert_beforebodystringfalseAn existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option.
insert_afterbodystringfalseAn existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option.
custom_field_gidpathstringtrueGlobally unique identifier for the custom field.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "enum_option",
    "name": "Low",
    "enabled": true,
    "color": "blue"
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedCustom field enum option successfully created.EnumOption
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Reorder a custom field's enum

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/custom_fields/{custom_field_gid}/enum_options/insert \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /custom_fields/{custom_field_gid}/enum_options/insert

Moves a particular enum option to be either before or after another specified enum option in the custom field. Locked custom fields can only be reordered by the user who locked the field.

Body parameter

{
  "data": {
    "name": "Low",
    "enabled": true,
    "color": "blue",
    "enum_option": "97285",
    "before_enum_option": "12345",
    "after_enum_option": "12345"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjectfalseThe enum option object to create.
databodyobjectfalseEnum options are the possible values which an enum custom field can adopt. An enum custom field must contain at least 1 enum option but no more than 50.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the enum option.
enabledbodybooleanfalseThe color of the enum option. Defaults to ‘none’.
colorbodystringfalseWhether or not the enum option is a selectable value for the custom field.
enum_optionbodystringtrueThe gid of the enum option to relocate.
before_enum_optionbodystringfalseAn existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option.
after_enum_optionbodystringfalseAn existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option.
custom_field_gidpathstringtrueGlobally unique identifier for the custom field.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "enum_option",
    "name": "Low",
    "enabled": true,
    "color": "blue"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKCustom field enum option successfully reordered.EnumOption
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Update an enum option

Code samples

# You can also use wget
curl -X PUT https://app.asana.com/api/1.0/enum_options/{enum_option_gid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PUT /enum_options/{enum_option_gid}

Updates an existing enum option. Enum custom fields require at least one enabled enum option. Locked custom fields can only be updated by the user who locked the field. Returns the full record of the updated enum option.

Body parameter

{
  "data": {
    "name": "Low",
    "enabled": true,
    "color": "blue"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjectfalseThe enum option object to update
databodyEnumOptionfalseEnum options are the possible values which an enum custom field can adopt. An enum custom field must contain at least 1 enum option but no more than 50.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the enum option.
enabledbodybooleanfalseThe color of the enum option. Defaults to ‘none’.
colorbodystringfalseWhether or not the enum option is a selectable value for the custom field.
enum_option_gidpathstringfalseGlobally unique identifier for the enum option.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "enum_option",
    "name": "Low",
    "enabled": true,
    "color": "blue"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully updated the specified custom field enum.EnumOption
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Custom Field Settings

GET /projects/{project_gid}/custom_field_settings
GET /portfolios/{portfolio_gid}/custom_field_settings

Custom fields are attached to a particular project with the Custom Field Settings resource. This resource both represents the many-to-many join of the Custom Field and Project as well as stores information that is relevant to that particular pairing; for instance, the is_important property determines some possible application-specific handling of that custom field.


Get a project's custom fields

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/projects/{project_gid}/custom_field_settings \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /projects/{project_gid}/custom_field_settings

Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, opt_fields can be used to include more data than is returned in the compact representation. See the getting started guide on input/output options for more information.

Parameters

NameInTypeRequiredDescription
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "custom_field_setting",
      "project": null,
      "is_important": false,
      "parent": null,
      "custom_field": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved custom field settings objects for a project.CustomFieldSetting
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a portfolio's custom fields

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/custom_field_settings \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /portfolios/{portfolio_gid}/custom_field_settings

Returns a list of all of the custom fields settings on a portfolio, in compact form.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "custom_field_setting",
      "project": null,
      "is_important": false,
      "parent": null,
      "custom_field": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved custom field settings objects for a portfolio.CustomFieldSetting
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Events

GET /events

An event is an object representing a change to a resource that was observed by an event subscription.

In general, requesting events on a resource is faster and subject to higher rate limits than requesting the resource itself. Additionally, change events bubble up - listening to events on a project would include when stories are added to tasks in the project, even on subtasks.

Establish an initial sync token by making a request with no sync token. The response will be a 412 error - the same as if the sync token had expired.

Subsequent requests should always provide the sync token from the immediately preceding call.

Sync tokens may not be valid if you attempt to go ‘backward’ in the history by requesting previous tokens, though re-requesting the current sync token is generally safe, and will always return the same results.

When you receive a 412 Precondition Failed error, it means that the sync token is either invalid or expired. If you are attempting to keep a set of data in sync, this signals you may need to re-crawl the data.

Sync tokens always expire after 24 hours, but may expire sooner, depending on load on the service.


Get events on a resource

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/events?resource=12345 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /events

Returns the full record for all events that have occurred since the sync token was created.

A GET request to the endpoint /[path_to_resource]/events can be made in lieu of including the resource ID in the data for the request.

Parameters

NameInTypeRequiredDescription
resourcequerystringtrueA resource ID to subscribe to. The resource can be a task or project.
syncquerystringfalseA sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Detailed descriptions

sync: A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated. Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token.If the sync token is too old (which may happen from time to time) the API will return a 412 Precondition Failed error, and include a fresh sync token in the response.

200 Response

{
  "data": [
    {
      "user": {
        ...
      },
      "resource": {
        ...
      },
      "type": "task",
      "action": "changed",
      "parent": {
        ...
      },
      "created_at": "2012-02-22T02:06:58.147Z"
    }
  ],
  "sync": "de4774f6915eae04714ca93bb2f5ee81"
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved events.Event
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Jobs

GET /jobs/{job_gid}

Jobs represent processes that handle asynchronous work. Jobs are created when an endpoint requests an action that will be handled asynchronously. Such as project or task duplication. Only the creator of the duplication process can access the duplication status of the new object.


Get a job by id

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/jobs/{job_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /jobs/{job_gid}

Returns the full record for a job.

Parameters

NameInTypeRequiredDescription
job_gidpathstringtrueGlobally unique identifier for the job.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "task",
    "resource_subtype": "milestone",
    "status": "in_progress",
    "new_project": {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy"
    },
    "new_task": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved Job.Job
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Organization Exports

POST /organization_exports
GET /organization_exports/{organization_export_gid}

An organization_export object represents a request to export the complete data of an Organization in JSON format.

To export an Organization using this API:

Note: These endpoints are only available to Service Accounts of an Enterprise Organization.


Create an organization export request

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/organization_exports \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /organization_exports

This method creates a request to export an Organization. Asana will complete the export at some point after you create the request.

Body parameter

{
  "data": {
    "organization": "1331"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe organization to export.
databodyobjectfalsenone
organizationbodystringfalseGlobally unique identifier for the workspace or organization.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "task",
    "created_at": "2012-02-22T02:06:58.147Z",
    "download_url": "https://asana-export.s3.amazonaws.com/export-4632784536274-20170127-43246.json.gz?AWSAccessKeyId=xxxxxxxx",
    "state": "started",
    "organization": {
      "gid": "14916",
      "name": "My Workspace"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created organization export request.Inline
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑

Response Schema

Status Code 201

NameTypeRequiredRestrictionsDescription
dataOrganizationExportfalsenoneAn organization_export object represents a request to export the complete data of an Organization in JSON format.
gidstringfalseread-onlyGlobally unique identifier of the object, as a string.
resource_typestringfalseread-onlyThe base type of this resource.
created_atstring(date-time)falseread-onlyThe time at which this resource was created.
download_urlstring(uri)¦nullfalseread-onlyDownload this URL to retreive the full export of the organization
in JSON format. It will be compressed in a gzip (.gz) container.

Note: May be null if the export is still in progress or
failed. If present, this URL may only be valid for 1 hour from
the time of retrieval. You should avoid persisting this URL
somewhere and rather refresh on demand to ensure you do not keep
stale URLs.
statestringfalseread-onlyThe current state of the export.
organizationobjectfalsenoneCreate-only: The Organization that is being exported. This can only be specified at create time.
gidstringfalsenonenone
namestringfalsenonenone

Enumerated Values

PropertyValue
statepending
statestarted
statefinished
stateerror


Get details on an org export request

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/organization_exports/{organization_export_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /organization_exports/{organization_export_gid}

Returns details of a previously-requested Organization export.

Parameters

NameInTypeRequiredDescription
organization_export_gidpathstringtrueGlobally unique identifier for the organization export.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "task",
    "created_at": "2012-02-22T02:06:58.147Z",
    "download_url": "https://asana-export.s3.amazonaws.com/export-4632784536274-20170127-43246.json.gz?AWSAccessKeyId=xxxxxxxx",
    "state": "started",
    "organization": {
      "gid": "14916",
      "name": "My Workspace"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved organization export object.Inline
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
dataOrganizationExportfalsenoneAn organization_export object represents a request to export the complete data of an Organization in JSON format.
gidstringfalseread-onlyGlobally unique identifier of the object, as a string.
resource_typestringfalseread-onlyThe base type of this resource.
created_atstring(date-time)falseread-onlyThe time at which this resource was created.
download_urlstring(uri)¦nullfalseread-onlyDownload this URL to retreive the full export of the organization
in JSON format. It will be compressed in a gzip (.gz) container.

Note: May be null if the export is still in progress or
failed. If present, this URL may only be valid for 1 hour from
the time of retrieval. You should avoid persisting this URL
somewhere and rather refresh on demand to ensure you do not keep
stale URLs.
statestringfalseread-onlyThe current state of the export.
organizationobjectfalsenoneCreate-only: The Organization that is being exported. This can only be specified at create time.
gidstringfalsenonenone
namestringfalsenonenone

Enumerated Values

PropertyValue
statepending
statestarted
statefinished
stateerror


Portfolios

GET /portfolios
POST /portfolios
GET /portfolios/{portfolio_gid}
PUT /portfolios/{portfolio_gid}
DELETE /portfolios/{portfolio_gid}
GET /portfolios/{portfolio_gid}/items
POST /portfolios/{portfolio_gid}/addItem
POST /portfolios/{portfolio_gid}/removeItem
POST /portfolios/{portfolio_gid}/addMembers
POST /portfolios/{portfolio_gid}/removeMembers
POST /portfolios/{portfolio_gid}/addCustomFieldSetting
POST /portfolios/{portfolio_gid}/removeCustomFieldSetting

A 'portfolio' gives a high-level overview of the status of multiple initiatives in Asana. Portfolios provide a dashboard overview of the state of multiple projects, including a progress report and the most recent project status update. Portfolios have some restrictions on size. Each portfolio has a max of 250 items and, like projects, a max of 20 custom fields.


Get multiple portfolios

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/portfolios \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /portfolios

Returns a list of the portfolios in compact representation that are owned by the current API user.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
workspacequerystringfalseThe workspace or organization to filter portfolios on.
ownerquerystringfalseThe user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "portfolio",
      "name": "Bug Task"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved portfolios.Portfolio
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a portfolio

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/portfolios \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /portfolios

Creates a new portfolio in the given workspace with the supplied name.

Note that portfolios created in the Asana UI may have some state (like the “Priority” custom field) which is automatically added to the portfolio when it is created. Portfolios created via our API will not be created with the same initial state to allow integrations to create their own starting state on a portfolio.

Body parameter

{
  "data": {
    "name": "Bug Task",
    "color": "light-green",
    "owner": null,
    "workspace": null,
    "members": null
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyPortfolioObjecttrueThe portfolio to create.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "portfolio",
      "name": "Bug Task"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully retrieved portfolios.Portfolio
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a portfolio

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/portfolios/{portfolio_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /portfolios/{portfolio_gid}

Returns the complete portfolio record for a single portfolio.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "portfolio",
    "name": "Bug Task",
    "created_at": "2012-02-22T02:06:58.147Z",
    "created_by": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "color": "light-green",
    "custom_field_settings": [
      {
        ...
      }
    ],
    "owner": null,
    "workspace": null,
    "members": null
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested portfolio.Portfolio
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Update a portfolio

Code samples

# You can also use wget
curl -X PUT https://app.asana.com/api/1.0/portfolios/{portfolio_gid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PUT /portfolios/{portfolio_gid}

An existing portfolio can be updated by making a PUT request on the URL for that portfolio. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged.

Returns the complete updated portfolio record.

Body parameter

{
  "data": {
    "name": "Bug Task",
    "color": "light-green",
    "owner": null,
    "workspace": null,
    "members": null
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyPortfolioObjecttrueThe updated fields for the portfolio.
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "portfolio",
    "name": "Bug Task",
    "created_at": "2012-02-22T02:06:58.147Z",
    "created_by": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "color": "light-green",
    "custom_field_settings": [
      {
        ...
      }
    ],
    "owner": null,
    "workspace": null,
    "members": null
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully updated the portfolio.Portfolio
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Delete a portfolio

Code samples

# You can also use wget
curl -X DELETE https://app.asana.com/api/1.0/portfolios/{portfolio_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE /portfolios/{portfolio_gid}

An existing portfolio can be deleted by making a DELETE request on the URL for that portfolio.

Returns an empty data record.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully deleted the specified portfolio.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get portfolio items

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/items \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /portfolios/{portfolio_gid}/items

Get a list of the items in compact form in a portfolio.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy",
      "created_at": "2012-02-22T02:06:58.147Z",
      "archived": false,
      "color": "light-green",
      "current_status": {
        ...
      },
      "custom_fields": [
        ...
      ],
      "custom_field_settings": [
        ...
      ],
      "default_view": "calendar",
      "due_date": "2012-03-26",
      "due_on": "2012-03-26",
      "followers": [
        ...
      ],
      "html_notes": "These are things we need to purchase.",
      "is_template": false,
      "layout": "list",
      "members": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "These are things we need to purchase.",
      "owner": null,
      "public": false,
      "section_migration_status": "not_migrated",
      "start_on": "2012-03-26",
      "team": null,
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested portfolio's items.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Add a portfolio item

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/addItem?item=1331&insert_before=1331&insert_after=1331 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /portfolios/{portfolio_gid}/addItem

Add an item to a portfolio. Returns an empty data block.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
itemquerystringtrueThe item to add to the portfolio.
insert_beforequerystringtrueAn id of an item in this portfolio. The new item will be added before the one specified here. insert_before and insert_after parameters cannot both be specified.
insert_afterquerystringtrueAn id of an item in this portfolio. The new item will be added after the one specified here. insert_before and insert_after parameters cannot both be specified.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully added the item to the portfolio.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Remove a portfolio item

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/removeItem?item=1331 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /portfolios/{portfolio_gid}/removeItem

Remove an item from a portfolio. Returns an empty data block.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
itemquerystringtrueThe item to remove from the portfolio.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully removed the item from the portfolio.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Add users to a portfolio

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/addMembers?members=521621%2C621373 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /portfolios/{portfolio_gid}/addMembers

Adds the specified list of users as members of the portfolio. Returns the updated portfolio record.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
membersquerystringtrueAn array of user ids.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully added members to the portfolio.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Remove users from a portfolio

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/removeMembers?members=521621%2C621373 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /portfolios/{portfolio_gid}/removeMembers

Removes the specified list of users from members of the portfolio. Returns the updated portfolio record.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
membersquerystringtrueAn array of user ids.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully removed the members from the portfolio.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Add a custom field to a portfolio

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/addCustomFieldSetting?custom_field=14916 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /portfolios/{portfolio_gid}/addCustomFieldSetting

Custom fields are associated with portfolios by way of custom field settings. This method creates a setting for the portfolio.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
custom_fieldquerystringtrueThe custom field to associate with this portfolio.
is_importantquerybooleanfalseWhether this field should be considered important to this portfolio (for instance, to display in the list view of items in the portfolio).
insert_beforequerystringfalseAn id of a Custom Field Setting on this portfolio, before which the new Custom Field Setting will be added. insert_before and insert_after parameters cannot both be specified.
insert_afterquerystringfalseAn id of a Custom Field Setting on this portfolio, after which the new Custom Field Setting will be added. insert_before and insert_after parameters cannot both be specified.
opt_prettyquerybooleanfalseProvides “pretty” output.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully added the custom field to the portfolio.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Remove a custom field from a portfolio

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/removeCustomFieldSetting?custom_field=14916 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /portfolios/{portfolio_gid}/removeCustomFieldSetting

Removes a custom field setting from a portfolio.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
custom_fieldquerystringtrueThe custom field to remove from this portfolio.
opt_prettyquerybooleanfalseProvides “pretty” output.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully removed the custom field from the portfolio.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Portfolio Memberships

GET /portfolio_memberships
GET /portfolio_memberships/{portfolio_membership_gid}
GET /portfolios/{portfolio_gid}/portfolio_memberships

This object determines if a user is a member of a portfolio.


Get multiple portfolio memberships

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/portfolio_memberships \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /portfolio_memberships

Returns a list of portfolio memberships in compact representation. You must specify portolio, portfolio and user, or workspace and user.

Parameters

NameInTypeRequiredDescription
portfolioquerystringfalseThe portfolio to filter results on.
workspacequerystringfalseThe workspace to filter results on.
userquerystring(email)falseThe user to filter results on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "portfolio",
      "name": "Bug Task"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved portfolio memberships.Portfolio
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a portfolio membership

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/portfolio_memberships/{portfolio_membership_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /portfolio_memberships/{portfolio_membership_gid}

Returns the complete portfolio record for a single portfolio membership.

Parameters

NameInTypeRequiredDescription
portfolio_membership_path_gidpathstringtruenone
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "portfolio_membership",
    "user": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "portfolio": {
      "gid": "12345",
      "resource_type": "portfolio",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested portfolio membership.PortfolioMembership
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get memberships from a portfolio

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/portfolios/{portfolio_gid}/portfolio_memberships \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /portfolios/{portfolio_gid}/portfolio_memberships

Returns the compact portfolio membership records for the portfolio.

Parameters

NameInTypeRequiredDescription
portfolio_gidpathstringtrueGlobally unique identifier for the portfolio.
userquerystring(email)falseThe user to filter results on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "portfolio_membership",
      "user": {
        ...
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested portfolio's memberships.PortfolioMembership
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Projects

GET /projects
POST /projects
GET /projects/{project_gid}
PUT /projects/{project_gid}
DELETE /projects/{project_gid}
POST /projects/{project_gid}/duplicate
GET /tasks/{task_gid}/projects
GET /teams/{team_gid}/projects
POST /teams/{team_gid}/projects
GET /workspaces/{workspace_gid}/projects
POST /workspaces/{workspace_gid}/projects
POST /projects/{project_gid}/addCustomFieldSetting
POST /projects/{project_gid}/removeCustomFieldSetting

A project represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions.

Projects in organizations are shared with a single team. You cannot currently change the team of a project via the API. Non-organization workspaces do not have teams and so you should not specify the team of project in a regular workspace.

Followers of a project are a subset of the members of that project. Followers of a project will receive all updates including tasks created, added and removed from that project. Members of the project have access to and will receive status updates of the project. Adding followers to a project will add them as members if they are not already, removing followers from a project will not affect membership.


Get multiple projects

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/projects \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /projects

Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
workspacequerystringfalseThe workspace or organization to filter projects on.
teamquerystringfalseThe team to filter projects on.
archivedquerybooleanfalseOnly return projects whose archived field takes on the value of this parameter.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy",
      "created_at": "2012-02-22T02:06:58.147Z",
      "archived": false,
      "color": "light-green",
      "current_status": {
        ...
      },
      "custom_fields": [
        ...
      ],
      "custom_field_settings": [
        ...
      ],
      "default_view": "calendar",
      "due_date": "2012-03-26",
      "due_on": "2012-03-26",
      "followers": [
        ...
      ],
      "html_notes": "These are things we need to purchase.",
      "is_template": false,
      "layout": "list",
      "members": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "These are things we need to purchase.",
      "owner": null,
      "public": false,
      "section_migration_status": "not_migrated",
      "start_on": "2012-03-26",
      "team": null,
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved projects.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a project

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/projects \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /projects

Create a new project in a workspace or team.

Every project is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization.

If the workspace for your project is an organization, you must also supply a team to share the project with.

Returns the full record of the newly created project.

Body parameter

{
  "data": {
    "name": "Bug Project",
    "notes": "For tracking pesky bugs.",
    "workspace": "1331",
    "team": "14916"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe project to create.
databodyobjectfalsenone
namebodystringfalseThe name of the project.
notesbodystringfalseThe description of the project.
workspacebodystringfalseThe workspace or organization to create the project in.
teambodystringfalseIf creating in an organization, the specific team to create the project in.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "project",
    "name": "Stuff to buy",
    "created_at": "2012-02-22T02:06:58.147Z",
    "archived": false,
    "color": "light-green",
    "current_status": {
      "color": "green",
      "text": "Everything is great",
      "author": {
        ...
      }
    },
    "custom_fields": [
      {
        ...
      }
    ],
    "custom_field_settings": [
      {
        ...
      }
    ],
    "default_view": "calendar",
    "due_date": "2012-03-26",
    "due_on": "2012-03-26",
    "followers": [
      {
        ...
      }
    ],
    "html_notes": "These are things we need to purchase.",
    "is_template": false,
    "layout": "list",
    "members": [
      {
        ...
      }
    ],
    "modified_at": "2012-02-22T02:06:58.147Z",
    "notes": "These are things we need to purchase.",
    "owner": null,
    "public": false,
    "section_migration_status": "not_migrated",
    "start_on": "2012-03-26",
    "team": null,
    "workspace": null
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully retrieved projects.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a project

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/projects/{project_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /projects/{project_gid}

Returns the complete project record for a single project.

Parameters

NameInTypeRequiredDescription
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "project",
    "name": "Stuff to buy",
    "created_at": "2012-02-22T02:06:58.147Z",
    "archived": false,
    "color": "light-green",
    "current_status": {
      "color": "green",
      "text": "Everything is great",
      "author": {
        ...
      }
    },
    "custom_fields": [
      {
        ...
      }
    ],
    "custom_field_settings": [
      {
        ...
      }
    ],
    "default_view": "calendar",
    "due_date": "2012-03-26",
    "due_on": "2012-03-26",
    "followers": [
      {
        ...
      }
    ],
    "html_notes": "These are things we need to purchase.",
    "is_template": false,
    "layout": "list",
    "members": [
      {
        ...
      }
    ],
    "modified_at": "2012-02-22T02:06:58.147Z",
    "notes": "These are things we need to purchase.",
    "owner": null,
    "public": false,
    "section_migration_status": "not_migrated",
    "start_on": "2012-03-26",
    "team": null,
    "workspace": null
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested project.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Update a project

Code samples

# You can also use wget
curl -X PUT https://app.asana.com/api/1.0/projects/{project_gid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PUT /projects/{project_gid}

A specific, existing project can be updated by making a PUT request on the URL for that project. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged.

When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task.

Returns the complete updated project record.

Body parameter

{
  "data": {
    "name": "Stuff to buy",
    "archived": false,
    "color": "light-green",
    "default_view": "calendar",
    "due_date": "2012-03-26",
    "due_on": "2012-03-26",
    "html_notes": "These are things we need to purchase.",
    "is_template": false,
    "notes": "These are things we need to purchase.",
    "owner": null,
    "public": false,
    "start_on": "2012-03-26",
    "team": null,
    "workspace": null
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyProjectObjecttrueThe updated fields for the project.
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "project",
    "name": "Stuff to buy",
    "created_at": "2012-02-22T02:06:58.147Z",
    "archived": false,
    "color": "light-green",
    "current_status": {
      "color": "green",
      "text": "Everything is great",
      "author": {
        ...
      }
    },
    "custom_fields": [
      {
        ...
      }
    ],
    "custom_field_settings": [
      {
        ...
      }
    ],
    "default_view": "calendar",
    "due_date": "2012-03-26",
    "due_on": "2012-03-26",
    "followers": [
      {
        ...
      }
    ],
    "html_notes": "These are things we need to purchase.",
    "is_template": false,
    "layout": "list",
    "members": [
      {
        ...
      }
    ],
    "modified_at": "2012-02-22T02:06:58.147Z",
    "notes": "These are things we need to purchase.",
    "owner": null,
    "public": false,
    "section_migration_status": "not_migrated",
    "start_on": "2012-03-26",
    "team": null,
    "workspace": null
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully updated the project.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Delete a project

Code samples

# You can also use wget
curl -X DELETE https://app.asana.com/api/1.0/projects/{project_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE /projects/{project_gid}

A specific, existing project can be deleted by making a DELETE request on the URL for that project.

Returns an empty data record.

Parameters

NameInTypeRequiredDescription
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully deleted the specified project.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Duplicate a project

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/projects/{project_gid}/duplicate \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /projects/{project_gid}/duplicate

Creates and returns a job that will asynchronously handle the duplication.

Body parameter

{
  "data": {
    "name": "New Project Name",
    "team": "12345",
    "include": [
      "members",
      "task_notes"
    ],
    "schedule_dates": {
      "should_skip_weekends": true,
      "due_on": "2019-05-21",
      "start_on": "2019-05-21"
    }
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjectfalseDescribes the duplicate's name and the elements that will be duplicated.
databodyobjectfalsenone
namebodystringtrueThe name of the new project.
teambodystringfalseSets the team of the new project. If team is not defined, the new project will be in the same team as the the original project.
includebodystringfalseThe elements that will be duplicated to the new project. Tasks are always included.
schedule_datesbodyobjectfalseA dictionary of options to auto-shift dates. task_dates must be included to use this option. Requires either start_on or due_on, but not both.
should_skip_weekendsbodybooleantrueDetermines if the auto-shifted dates should skip weekends.
due_onbodystringfalseSets the last due date in the duplicated project to the given date. The rest of the due dates will be offset by the same amount as the due dates in the original project.
start_onbodystringfalseSets the first start date in the duplicated project to the given date. The rest of the start dates will be offset by the same amount as the start dates in the original project.
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Enumerated Values

ParameterValue
includemembers
includenotes
includetask_notes
includetask_assignee
includetask_subtasks
includetask_attachments
includetask_dates
includetask_dependencies
includetask_followers
includetask_tags
includetask_projects

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "task",
    "resource_subtype": "milestone",
    "status": "in_progress",
    "new_project": {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy"
    },
    "new_task": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created the job to handle duplication.Job
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get projects a task is in

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tasks/{task_gid}/projects \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tasks/{task_gid}/projects

Returns a compact representation of all of the projects the task is in.

Parameters

NameInTypeRequiredDescription
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy",
      "created_at": "2012-02-22T02:06:58.147Z",
      "archived": false,
      "color": "light-green",
      "current_status": {
        ...
      },
      "custom_fields": [
        ...
      ],
      "custom_field_settings": [
        ...
      ],
      "default_view": "calendar",
      "due_date": "2012-03-26",
      "due_on": "2012-03-26",
      "followers": [
        ...
      ],
      "html_notes": "These are things we need to purchase.",
      "is_template": false,
      "layout": "list",
      "members": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "These are things we need to purchase.",
      "owner": null,
      "public": false,
      "section_migration_status": "not_migrated",
      "start_on": "2012-03-26",
      "team": null,
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the projects for the given task.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a team's projects

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/teams/{team_gid}/projects \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /teams/{team_gid}/projects

Returns the compact project records for all projects in the team.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
archivedquerybooleanfalseOnly return projects whose archived field takes on the value of this parameter.
team_gidpathstringtrueGlobally unique identifier for the team.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy",
      "created_at": "2012-02-22T02:06:58.147Z",
      "archived": false,
      "color": "light-green",
      "current_status": {
        ...
      },
      "custom_fields": [
        ...
      ],
      "custom_field_settings": [
        ...
      ],
      "default_view": "calendar",
      "due_date": "2012-03-26",
      "due_on": "2012-03-26",
      "followers": [
        ...
      ],
      "html_notes": "These are things we need to purchase.",
      "is_template": false,
      "layout": "list",
      "members": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "These are things we need to purchase.",
      "owner": null,
      "public": false,
      "section_migration_status": "not_migrated",
      "start_on": "2012-03-26",
      "team": null,
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested team's projects.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a project in a team

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/teams/{team_gid}/projects \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /teams/{team_gid}/projects

Creates a project shared with the given team.

Returns the full record of the newly created project.

Body parameter

{
  "data": {
    "name": "Stuff to buy",
    "archived": false,
    "color": "light-green",
    "default_view": "calendar",
    "due_date": "2012-03-26",
    "due_on": "2012-03-26",
    "html_notes": "These are things we need to purchase.",
    "is_template": false,
    "notes": "These are things we need to purchase.",
    "owner": null,
    "public": false,
    "start_on": "2012-03-26",
    "team": null,
    "workspace": null
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyProjectObjecttrueThe new project to create.
team_gidpathstringtrueGlobally unique identifier for the team.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "project",
    "name": "Stuff to buy",
    "created_at": "2012-02-22T02:06:58.147Z",
    "archived": false,
    "color": "light-green",
    "current_status": {
      "color": "green",
      "text": "Everything is great",
      "author": {
        ...
      }
    },
    "custom_fields": [
      {
        ...
      }
    ],
    "custom_field_settings": [
      {
        ...
      }
    ],
    "default_view": "calendar",
    "due_date": "2012-03-26",
    "due_on": "2012-03-26",
    "followers": [
      {
        ...
      }
    ],
    "html_notes": "These are things we need to purchase.",
    "is_template": false,
    "layout": "list",
    "members": [
      {
        ...
      }
    ],
    "modified_at": "2012-02-22T02:06:58.147Z",
    "notes": "These are things we need to purchase.",
    "owner": null,
    "public": false,
    "section_migration_status": "not_migrated",
    "start_on": "2012-03-26",
    "team": null,
    "workspace": null
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created the specified project.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get all projects in a workspace

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/workspaces/{workspace_gid}/projects \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /workspaces/{workspace_gid}/projects

Returns the compact project records for all projects in the workspace.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
archivedquerybooleanfalseOnly return projects whose archived field takes on the value of this parameter.
workspace_gidpathstringtrueGlobally unique identifier for the workspace or organization.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy",
      "created_at": "2012-02-22T02:06:58.147Z",
      "archived": false,
      "color": "light-green",
      "current_status": {
        ...
      },
      "custom_fields": [
        ...
      ],
      "custom_field_settings": [
        ...
      ],
      "default_view": "calendar",
      "due_date": "2012-03-26",
      "due_on": "2012-03-26",
      "followers": [
        ...
      ],
      "html_notes": "These are things we need to purchase.",
      "is_template": false,
      "layout": "list",
      "members": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "These are things we need to purchase.",
      "owner": null,
      "public": false,
      "section_migration_status": "not_migrated",
      "start_on": "2012-03-26",
      "team": null,
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested workspace's projects.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a project in a workspace

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/workspaces/{workspace_gid}/projects \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /workspaces/{workspace_gid}/projects

Returns the compact project records for all projects in the workspace.

If the workspace for your project is an organization, you must also supply a team to share the project with.

Returns the full record of the newly created project.

Body parameter

{
  "data": {
    "name": "Stuff to buy",
    "archived": false,
    "color": "light-green",
    "default_view": "calendar",
    "due_date": "2012-03-26",
    "due_on": "2012-03-26",
    "html_notes": "These are things we need to purchase.",
    "is_template": false,
    "notes": "These are things we need to purchase.",
    "owner": null,
    "public": false,
    "start_on": "2012-03-26",
    "team": null,
    "workspace": null
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyProjectObjecttrueThe new project to create.
workspace_gidpathstringtrueGlobally unique identifier for the workspace or organization.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "project",
    "name": "Stuff to buy",
    "created_at": "2012-02-22T02:06:58.147Z",
    "archived": false,
    "color": "light-green",
    "current_status": {
      "color": "green",
      "text": "Everything is great",
      "author": {
        ...
      }
    },
    "custom_fields": [
      {
        ...
      }
    ],
    "custom_field_settings": [
      {
        ...
      }
    ],
    "default_view": "calendar",
    "due_date": "2012-03-26",
    "due_on": "2012-03-26",
    "followers": [
      {
        ...
      }
    ],
    "html_notes": "These are things we need to purchase.",
    "is_template": false,
    "layout": "list",
    "members": [
      {
        ...
      }
    ],
    "modified_at": "2012-02-22T02:06:58.147Z",
    "notes": "These are things we need to purchase.",
    "owner": null,
    "public": false,
    "section_migration_status": "not_migrated",
    "start_on": "2012-03-26",
    "team": null,
    "workspace": null
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created a new project in the specified workspace.Project
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Add a custom field to a project

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/projects/{project_gid}/addCustomFieldSetting?custom_field=14916 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /projects/{project_gid}/addCustomFieldSetting

Custom fields are associated with projects by way of custom field settings. This method creates a setting for the project.

Parameters

NameInTypeRequiredDescription
project_gidpathstringtrueGlobally unique identifier for the project.
custom_fieldquerystringtrueThe custom field to associate with this project.
is_importantquerybooleanfalseWhether this field should be considered "important" to this project. This may cause it to be displayed more prominently, for example in the task grid.
insert_beforequerystringfalseAn id of a Custom Field Setting on this project, before which the new Custom Field Setting will be added. insert_before and insert_after parameters cannot both be specified.
insert_afterquerystringfalseAn id of a Custom Field Setting on this project, after which the new Custom Field Setting will be added. insert_before and insert_after parameters cannot both be specified.
opt_prettyquerybooleanfalseProvides “pretty” output.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully added the custom field to the project.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Remove a custom field from a project

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/projects/{project_gid}/removeCustomFieldSetting?custom_field=14916 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /projects/{project_gid}/removeCustomFieldSetting

Removes a custom field setting from a project.

Parameters

NameInTypeRequiredDescription
project_gidpathstringtrueGlobally unique identifier for the project.
custom_fieldquerystringtrueThe custom field to remove from this project.
opt_prettyquerybooleanfalseProvides “pretty” output.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully removed the custom field from the project.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Project Memberships

GET /project_memberships/{project_membership_gid}
GET /projects/{project_gid}/project_memberships

With the introduction of “comment-only” projects in Asana, a user’s membership in a project comes with associated permissions. These permissions (whether a user has full access to the project or comment-only access) are accessible through the project memberships endpoints described here.


Get a project membership

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/project_memberships/{project_membership_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /project_memberships/{project_membership_gid}

Returns the complete project record for a single project membership.

Parameters

NameInTypeRequiredDescription
project_membership_path_gidpathstringtruenone
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "project_membership",
    "user": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "project": {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy"
    },
    "write_access": "full_write"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested project membership.ProjectMembership
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get memberships from a project

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/projects/{project_gid}/project_memberships \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /projects/{project_gid}/project_memberships

Returns the compact project membership records for the project.

Parameters

NameInTypeRequiredDescription
project_gidpathstringtrueGlobally unique identifier for the project.
userquerystring(email)falseThe user to filter results on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "project_membership",
      "user": {
        ...
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested project's memberships.ProjectMembership
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Project Statuses

GET /project_statuses/{project_status_gid}
DELETE /project_statuses/{project_status_gid}
GET /projects/{project_gid}/project_statuses
POST /projects/{project_gid}/project_statuses

A project status is an update on the progress of a particular project, and is sent out to all project followers when created. These updates include both text describing the update and a color code intended to represent the overall state of the project: “green” for projects that are on track, “yellow” for projects at risk, and “red” for projects that are behind.

Project statuses can be created and deleted, but not modified.


Get a project status

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/project_statuses/{project_status_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /project_statuses/{project_status_gid}

Returns the complete record for a single status update.

Parameters

NameInTypeRequiredDescription
project_status_path_gidpathstringtrueThe project status update to get.

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "project_status",
    "title": "Status Update - Jun 15",
    "created_at": "2012-02-22T02:06:58.147Z",
    "created_by": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "text": "The project is moving forward according to plan...",
    "html-text": "'&lt;body&gt;The project &lt;strong&gt;is&lt;/strong&gt; moving forward according to plan...&lt;/body&gt;'",
    "color": "green"
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified project's status updates.ProjectStatus
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Delete a project status

Code samples

# You can also use wget
curl -X DELETE https://app.asana.com/api/1.0/project_statuses/{project_status_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE /project_statuses/{project_status_gid}

Deletes a specific, existing project status update.

Returns an empty data record.

Parameters

NameInTypeRequiredDescription
project_status_path_gidpathstringtrueThe project status update to get.

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully deleted the specified product status.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get statuses from a project

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/projects/{project_gid}/project_statuses \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /projects/{project_gid}/project_statuses

Returns the compact project status update records for all updates on the project.

Parameters

NameInTypeRequiredDescription
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "project_status",
      "title": "Status Update - Jun 15",
      "created_at": "2012-02-22T02:06:58.147Z",
      "created_by": {
        ...
      },
      "text": "The project is moving forward according to plan...",
      "html-text": "'&lt;body&gt;The project &lt;strong&gt;is&lt;/strong&gt; moving forward according to plan...&lt;/body&gt;'",
      "color": "green"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified project's status updates.ProjectStatus
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a project status

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/projects/{project_gid}/project_statuses \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /projects/{project_gid}/project_statuses

Creates a new status update on the project. Returns the full record of the newly created project status update.

Body parameter

{
  "data": {
    "project": "123456",
    "text": "The project is on track to ship next month!",
    "color": "green"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe project status to create.
databodyobjectfalsenone
projectbodystringtrueGlobally unique identifier for the project.
textbodystringtrueThe text of the project status update.
colorbodyanytrueThe color to associate with the status update.
project_gidpathstringtrueGlobally unique identifier for the project.

Enumerated Values

ParameterValue
colorgreen
coloryellow
colorred

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "project_status",
    "title": "Status Update - Jun 15",
    "created_at": "2012-02-22T02:06:58.147Z",
    "created_by": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "text": "The project is moving forward according to plan...",
    "html-text": "'&lt;body&gt;The project &lt;strong&gt;is&lt;/strong&gt; moving forward according to plan...&lt;/body&gt;'",
    "color": "green"
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created a new story.ProjectStatus
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Sections

GET /sections/{section_gid}
PUT /sections/{section_gid}
DELETE /sections/{section_gid}
GET /projects/{project_gid}/sections
POST /projects/{project_gid}/sections
POST /sections/{section_gid}/addTask
POST /projects/{project_gid}/sections/insert

A section is a subdivision of a project that groups tasks together. It can either be a header above a list of tasks in a list view or a column in a board view of a project.

Sections are largely a shared idiom in Asana’s API for both list and board views of a project regardless of the project’s layout.

The ‘memberships’ property when getting a task will return the information for the section or the column under ‘section’ in the response.


Get a section

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/sections/{section_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /sections/{section_gid}

Returns the complete record for a single section.

Parameters

NameInTypeRequiredDescription
section_gidpathstringtrueThe globally unique identified for the section.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "section",
    "name": "Next Actions",
    "created_at": "2012-02-22T02:06:58.147Z",
    "projects": [
      {
        ...
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved section.Section
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Update a section

Code samples

# You can also use wget
curl -X PUT https://app.asana.com/api/1.0/sections/{section_gid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PUT /sections/{section_gid}

A specific, existing section can be updated by making a PUT request on the URL for that project. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged. (note that at this time, the only field that can be updated is the name field.)

When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task.

Returns the complete updated section record.

Body parameter

{
  "data": {
    "name": "Next Actions",
    "projects": [
      {
        ...
      }
    ]
  }
}

Parameters

NameInTypeRequiredDescription
bodybodySectionObjecttrueThe section to create.
section_gidpathstringtrueThe globally unique identified for the section.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "section",
    "name": "Next Actions",
    "created_at": "2012-02-22T02:06:58.147Z",
    "projects": [
      {
        ...
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully updated the specified section.Section
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Delete a section

Code samples

# You can also use wget
curl -X DELETE https://app.asana.com/api/1.0/sections/{section_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE /sections/{section_gid}

A specific, existing section can be deleted by making a DELETE request on the URL for that section.

Note that sections must be empty to be deleted.

The last remaining section in a board view cannot be deleted.

Returns an empty data block.

Parameters

NameInTypeRequiredDescription
section_gidpathstringtrueThe globally unique identified for the section.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully deleted the specified section.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get sections in a project

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/projects/{project_gid}/sections \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /projects/{project_gid}/sections

Returns the compact records for all sections in the specified project.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions",
      "created_at": "2012-02-22T02:06:58.147Z",
      "projects": [
        ...
      ]
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved sections in project.Section
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a section in a project

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/projects/{project_gid}/sections \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /projects/{project_gid}/sections

Creates a new section in a project. Returns the full record of the newly created section.

Body parameter

{
  "data": {
    "project": "13579",
    "name": "Next Actions"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe section to create.
databodyobjectfalsenone
projectbodystringtrueThe project to create the section in
namebodystringtrueThe text to be displayed as the section name. This cannot be an empty string.
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "section",
    "name": "Next Actions",
    "created_at": "2012-02-22T02:06:58.147Z",
    "projects": [
      {
        ...
      }
    ]
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created the specified section.Section
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Add task to section

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/sections/{section_gid}/addTask \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /sections/{section_gid}/addTask

Add a task to a specific, existing section. This is remove the task from other sections of the project.

The task will be inserted at the top of a section unless an insert_before or insert_after parameter is declared.

This does not work for separators (tasks with the resource_subtype of section).

Body parameter

{
  "data": {
    "task": "123456",
    "insert_before": "86420",
    "insert_after": "987654"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe task and optionally the insert location.
databodyobjectfalsenone
taskbodystringtrueThe task to add to this section.
insert_beforebodystringfalseAn existing task within this section before which the added task should be inserted. Cannot be provided together with insert_after.
insert_afterbodystringfalseAn existing task within this section after which the added task should be inserted. Cannot be provided together with insert_before.
section_gidpathstringtrueThe globally unique identified for the section.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully added the task.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Move sections

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/projects/{project_gid}/sections/insert \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /projects/{project_gid}/sections/insert

Move sections relative to each other in a board view. One of before_section or after_section is required.

Sections cannot be moved between projects.

At this point in time, moving sections is not supported in list views, only board views.

Returns an empty data block.

Body parameter

{
  "data": {
    "project": "123456",
    "section": "321654",
    "before_section": "86420",
    "after_section": "987654"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe section's move action.
databodyobjectfalsenone
projectbodystringtrueThe project in which to reorder the given section.
sectionbodystringtrueThe section to reorder.
before_sectionbodystringfalseInsert the given section immediately before the section specified by this parameter.
after_sectionbodystringfalseInsert the given section immediately after the section specified by this parameter.
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully moved the specified section.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Stories

GET /stories/{story_gid}
PUT /stories/{story_gid}
DELETE /stories/{story_gid}
GET /tasks/{task_gid}/stories
POST /tasks/{task_gid}/stories

See our forum post for more info on when conditional fields are returned.

A story represents an activity associated with an object in the Asana system. Stories are generated by the system whenever users take actions such as creating or assigning tasks, or moving tasks between projects. Comments are also a form of user-generated story.


Get a story

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/stories/{story_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /stories/{story_gid}

Returns the full record for a single story.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
story_gidpathstringtrueGlobally unique identifier for the story.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "story",
    "resource_subtype": "milestone",
    "created_at": "2012-02-22T02:06:58.147Z",
    "created_by": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "text": "marked today",
    "type": "comment",
    "html_text": "Get whatever Sashimi has.",
    "is_edited": false,
    "is_pinned": false,
    "hearted": false,
    "hearts": [
      {
        ...
      }
    ],
    "num_hearts": 5,
    "liked": false,
    "likes": [
      {
        ...
      }
    ],
    "num_likes": 5,
    "previews": [
      {
        ...
      }
    ],
    "old_name": "This was the Old Name",
    "new_name": "This is the New Name",
    "old_dates": {
      "start_on": "2019-09-15",
      "due_at": "2012-02-22T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "new_dates": {
      "start_on": "2019-09-15",
      "due_at": "2012-02-22T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "old_resource_subtype": "default_task",
    "new_resource_subtype": "milestone",
    "story": {
      "gid": "12345",
      "resource_type": "story",
      "resource_subtype": "milestone",
      "created_at": "2012-02-22T02:06:58.147Z",
      "created_by": {
        ...
      },
      "text": "marked today",
      "type": "comment"
    },
    "assignee": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "follower": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "old_section": {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions"
    },
    "new_section": {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions"
    },
    "task": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "project": {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy"
    },
    "tag": {
      "gid": "12345",
      "resource_type": "tag",
      "name": "Stuff to buy"
    },
    "custom_field": {
      "gid": "12345",
      "resource_type": "custom_field",
      "name": "Bug Task",
      "resource_subtype": "milestone",
      "type": "text",
      "enum_options": [
        ...
      ],
      "enum_value": null,
      "enabled": true,
      "text_value": "Some Value"
    },
    "old_text_value": "This was the Old Text",
    "new_text_value": "This is the New Text",
    "old_number_value": 1,
    "new_number_value": 2,
    "old_enum_value": {
      "gid": "12345",
      "resource_type": "enum_option",
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "new_enum_value": {
      "gid": "12345",
      "resource_type": "enum_option",
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "duplicate_of": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "duplicated_from": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "dependency": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "source": "web",
    "target": {
      "gid": "1234",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified story.Story
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Update a story

Code samples

# You can also use wget
curl -X PUT https://app.asana.com/api/1.0/stories/{story_gid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PUT /stories/{story_gid}

Updates the story and returns the full record for the updated story. Only comment stories can have their text updated, and only comment stories and attachment stories can be pinned. Only one of text and html_text can be specified.

Body parameter

{
  "data": {
    "text": "marked today",
    "html_text": "Get whatever Sashimi has.",
    "is_pinned": false,
    "old_name": "This was the Old Name",
    "story": {
      "text": "marked today"
    },
    "assignee": {
      "name": "Greg Sanchez"
    },
    "follower": {
      "name": "Greg Sanchez"
    },
    "old_section": {
      "name": "Next Actions"
    },
    "new_section": {
      "name": "Next Actions"
    },
    "task": {
      "name": "Bug Task"
    },
    "project": {
      "name": "Stuff to buy"
    },
    "tag": {
      "name": "Stuff to buy"
    },
    "custom_field": {
      "name": "Bug Task",
      "type": "text",
      "enum_options": [
        ...
      ],
      "enum_value": null,
      "enabled": true,
      "text_value": "Some Value"
    },
    "old_enum_value": {
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "new_enum_value": {
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "duplicate_of": {
      "name": "Bug Task"
    },
    "duplicated_from": {
      "name": "Bug Task"
    },
    "dependency": {
      "name": "Bug Task"
    }
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyStoryObjecttrueThe comment story to update.
story_gidpathstringtrueGlobally unique identifier for the story.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "story",
    "resource_subtype": "milestone",
    "created_at": "2012-02-22T02:06:58.147Z",
    "created_by": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "text": "marked today",
    "type": "comment",
    "html_text": "Get whatever Sashimi has.",
    "is_edited": false,
    "is_pinned": false,
    "hearted": false,
    "hearts": [
      {
        ...
      }
    ],
    "num_hearts": 5,
    "liked": false,
    "likes": [
      {
        ...
      }
    ],
    "num_likes": 5,
    "previews": [
      {
        ...
      }
    ],
    "old_name": "This was the Old Name",
    "new_name": "This is the New Name",
    "old_dates": {
      "start_on": "2019-09-15",
      "due_at": "2012-02-22T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "new_dates": {
      "start_on": "2019-09-15",
      "due_at": "2012-02-22T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "old_resource_subtype": "default_task",
    "new_resource_subtype": "milestone",
    "story": {
      "gid": "12345",
      "resource_type": "story",
      "resource_subtype": "milestone",
      "created_at": "2012-02-22T02:06:58.147Z",
      "created_by": {
        ...
      },
      "text": "marked today",
      "type": "comment"
    },
    "assignee": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "follower": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "old_section": {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions"
    },
    "new_section": {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions"
    },
    "task": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "project": {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy"
    },
    "tag": {
      "gid": "12345",
      "resource_type": "tag",
      "name": "Stuff to buy"
    },
    "custom_field": {
      "gid": "12345",
      "resource_type": "custom_field",
      "name": "Bug Task",
      "resource_subtype": "milestone",
      "type": "text",
      "enum_options": [
        ...
      ],
      "enum_value": null,
      "enabled": true,
      "text_value": "Some Value"
    },
    "old_text_value": "This was the Old Text",
    "new_text_value": "This is the New Text",
    "old_number_value": 1,
    "new_number_value": 2,
    "old_enum_value": {
      "gid": "12345",
      "resource_type": "enum_option",
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "new_enum_value": {
      "gid": "12345",
      "resource_type": "enum_option",
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "duplicate_of": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "duplicated_from": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "dependency": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "source": "web",
    "target": {
      "gid": "1234",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified story.Story
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Delete a story

Code samples

# You can also use wget
curl -X DELETE https://app.asana.com/api/1.0/stories/{story_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE /stories/{story_gid}

Deletes a story. A user can only delete stories they have created. Returns an empty data record.

Returns an empty data record.

Parameters

NameInTypeRequiredDescription
story_gidpathstringtrueGlobally unique identifier for the story.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully deleted the specified story.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get stories from a task

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tasks/{task_gid}/stories \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tasks/{task_gid}/stories

Returns the compact records for all stories on the task.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "story",
      "resource_subtype": "milestone",
      "created_at": "2012-02-22T02:06:58.147Z",
      "created_by": {
        ...
      },
      "text": "marked today",
      "type": "comment",
      "html_text": "Get whatever Sashimi has.",
      "is_edited": false,
      "is_pinned": false,
      "hearted": false,
      "hearts": [
        ...
      ],
      "num_hearts": 5,
      "liked": false,
      "likes": [
        ...
      ],
      "num_likes": 5,
      "previews": [
        ...
      ],
      "old_name": "This was the Old Name",
      "new_name": "This is the New Name",
      "old_dates": {
        ...
      },
      "new_dates": {
        ...
      },
      "old_resource_subtype": "default_task",
      "new_resource_subtype": "milestone",
      "story": {
        ...
      },
      "assignee": {
        ...
      },
      "follower": {
        ...
      },
      "old_section": {
        ...
      },
      "new_section": {
        ...
      },
      "task": {
        ...
      },
      "project": {
        ...
      },
      "tag": {
        ...
      },
      "custom_field": {
        ...
      },
      "old_text_value": "This was the Old Text",
      "new_text_value": "This is the New Text",
      "old_number_value": 1,
      "new_number_value": 2,
      "old_enum_value": {
        ...
      },
      "new_enum_value": {
        ...
      },
      "duplicate_of": {
        ...
      },
      "duplicated_from": {
        ...
      },
      "dependency": {
        ...
      },
      "source": "web",
      "target": {
        ...
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified task's stories.Story
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a comment on a task

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/tasks/{task_gid}/stories \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /tasks/{task_gid}/stories

Adds a comment to a task. The comment will be authored by the currently authenticated user, and timestamped when the server receives the request.

Returns the full record for the new story added to the task.

Body parameter

{
  "data": {
    "task": "123456",
    "text": "This is a comment."
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe comment story to create.
databodyobjectfalsenone
taskbodystringtrueGlobally unique identifier for the task.
textbodystringtrueThe plain text of the comment to add.
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "story",
    "resource_subtype": "milestone",
    "created_at": "2012-02-22T02:06:58.147Z",
    "created_by": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "text": "marked today",
    "type": "comment",
    "html_text": "Get whatever Sashimi has.",
    "is_edited": false,
    "is_pinned": false,
    "hearted": false,
    "hearts": [
      {
        ...
      }
    ],
    "num_hearts": 5,
    "liked": false,
    "likes": [
      {
        ...
      }
    ],
    "num_likes": 5,
    "previews": [
      {
        ...
      }
    ],
    "old_name": "This was the Old Name",
    "new_name": "This is the New Name",
    "old_dates": {
      "start_on": "2019-09-15",
      "due_at": "2012-02-22T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "new_dates": {
      "start_on": "2019-09-15",
      "due_at": "2012-02-22T02:06:58.158Z",
      "due_on": "2019-09-15"
    },
    "old_resource_subtype": "default_task",
    "new_resource_subtype": "milestone",
    "story": {
      "gid": "12345",
      "resource_type": "story",
      "resource_subtype": "milestone",
      "created_at": "2012-02-22T02:06:58.147Z",
      "created_by": {
        ...
      },
      "text": "marked today",
      "type": "comment"
    },
    "assignee": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "follower": {
      "gid": "12345",
      "resource_type": "user",
      "name": "Greg Sanchez"
    },
    "old_section": {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions"
    },
    "new_section": {
      "gid": "12345",
      "resource_type": "section",
      "name": "Next Actions"
    },
    "task": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "project": {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy"
    },
    "tag": {
      "gid": "12345",
      "resource_type": "tag",
      "name": "Stuff to buy"
    },
    "custom_field": {
      "gid": "12345",
      "resource_type": "custom_field",
      "name": "Bug Task",
      "resource_subtype": "milestone",
      "type": "text",
      "enum_options": [
        ...
      ],
      "enum_value": null,
      "enabled": true,
      "text_value": "Some Value"
    },
    "old_text_value": "This was the Old Text",
    "new_text_value": "This is the New Text",
    "old_number_value": 1,
    "new_number_value": 2,
    "old_enum_value": {
      "gid": "12345",
      "resource_type": "enum_option",
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "new_enum_value": {
      "gid": "12345",
      "resource_type": "enum_option",
      "name": "Low",
      "enabled": true,
      "color": "blue"
    },
    "duplicate_of": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "duplicated_from": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "dependency": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    },
    "source": "web",
    "target": {
      "gid": "1234",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created a new story.Story
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Tags

GET /tags
POST /tags
GET /tags/{tag_gid}
PUT /tags/{tag_gid}
GET /tasks/{task_gid}/tags
GET /workspaces/{workspace_gid}/tags
POST /workspaces/{workspace_gid}/tags

A tag is a label that can be attached to any task in Asana. It exists in a single workspace or organization.

Tags have some metadata associated with them, but it is possible that we will simplify them in the future so it is not encouraged to rely too heavily on it. Unlike projects, tags do not provide any ordering on the tasks they are associated with.


Get multiple tags

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tags \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tags

Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
workspacequerystringfalseThe workspace to filter tags on.
archivedquerybooleanfalseOnly return tags whose archived field takes on the value of this parameter.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "tag",
      "name": "Stuff to buy",
      "followers": [
        ...
      ],
      "color": "light-green",
      "workspace": {
        ...
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified set of tags.Tag
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a tag

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/tags \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /tags

Creates a new tag in a workspace or organization.

Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization.

Returns the full record of the newly created tag.

Body parameter

{
  "data": {
    "name": "Stuff to buy",
    "color": "light-green",
    "workspace": {
      "name": "Bug Task"
    }
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyTagObjecttrueThe tag to create.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "tag",
    "name": "Stuff to buy",
    "followers": [
      {
        ...
      }
    ],
    "color": "light-green",
    "workspace": {
      "gid": "12345",
      "resource_type": "workspace",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created the newly specified tag.Tag
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a tag

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tags/{tag_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tags/{tag_gid}

Returns the complete tag record for a single tag.

Parameters

NameInTypeRequiredDescription
tag_gidpathstringtrueGlobally unique identifier for the tag.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "tag",
    "name": "Stuff to buy",
    "followers": [
      {
        ...
      }
    ],
    "color": "light-green",
    "workspace": {
      "gid": "12345",
      "resource_type": "workspace",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified tag.Tag
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Update a tag

Code samples

# You can also use wget
curl -X PUT https://app.asana.com/api/1.0/tags/{tag_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PUT /tags/{tag_gid}

Updates the properties of a tag. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged.

When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task.

Returns the complete updated tag record.

Parameters

NameInTypeRequiredDescription
tag_gidpathstringtrueGlobally unique identifier for the tag.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "tag",
    "name": "Stuff to buy",
    "followers": [
      {
        ...
      }
    ],
    "color": "light-green",
    "workspace": {
      "gid": "12345",
      "resource_type": "workspace",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully updated the specified tag.Tag
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a task's tags

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tasks/{task_gid}/tags \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tasks/{task_gid}/tags

Get a compact representation of all of the tags the task has.

Parameters

NameInTypeRequiredDescription
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "tag",
      "name": "Stuff to buy",
      "followers": [
        ...
      ],
      "color": "light-green",
      "workspace": {
        ...
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the tags for the given task.Tag
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get tags in a workspace

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/workspaces/{workspace_gid}/tags \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /workspaces/{workspace_gid}/tags

Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
workspace_gidpathstringtrueGlobally unique identifier for the workspace or organization.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "tag",
      "name": "Stuff to buy",
      "followers": [
        ...
      ],
      "color": "light-green",
      "workspace": {
        ...
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified set of tags.Tag
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a tag in a workspace

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/workspaces/{workspace_gid}/tags \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /workspaces/{workspace_gid}/tags

Creates a new tag in a workspace or organization.

Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization.

Returns the full record of the newly created tag.

Body parameter

{
  "data": {
    "name": "Stuff to buy",
    "color": "light-green",
    "workspace": {
      "name": "Bug Task"
    }
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyTagObjecttrueThe tag to create.
workspace_gidpathstringtrueGlobally unique identifier for the workspace or organization.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "tag",
      "name": "Stuff to buy",
      "followers": [
        ...
      ],
      "color": "light-green",
      "workspace": {
        ...
      }
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified set of tags.Tag
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Tasks

GET /tasks
POST /tasks
GET /tasks/{task_gid}
PUT /tasks/{task_gid}
DELETE /tasks/{task_gid}
POST /tasks/{task_gid}/duplicate
GET /projects/{project_gid}/tasks
GET /sections/{section_gid}/tasks
GET /tags/{tag_gid}/tasks
GET /tasks/{task_gid}/subtasks
POST /tasks/{task_gid}/subtasks
POST /tasks/{task_gid}/setParent
GET /tasks/{task_gid}/dependencies
POST /tasks/{task_gid}/addDependencies
POST /tasks/{task_gid}/removeDependencies
GET /tasks/{task_gid}/dependents
POST /tasks/{task_gid}/addDependents
POST /tasks/{task_gid}/removeDependents
POST /tasks/{task_gid}/addProject
POST /tasks/{task_gid}/removeProject
POST /tasks/{task_gid}/addTag
POST /tasks/{task_gid}/removeTag
POST /tasks/{task_gid}/addFollowers
POST /tasks/{task_gid}/removeFollowers
GET /workspaces/{workspace_gid}/tasks/search

The task is the basic object around which many operations in Asana are centered. In the Asana application, multiple tasks populate the middle pane according to some view parameters, and the set of selected tasks determines the more detailed information presented in the details pane.

Sections are unique in that they will be included in the memberships field of task objects returned in the API when the task is within a section. They can also be used to manipulate the ordering of a task within a project.

Queries return a compact representation of each object which is typically the id and name fields. Interested in a specific set of fields or all of the fields? Use field selectors to manipulate what data is included in a response.


Get multiple tasks

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tasks \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tasks

Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a project or tag if you do not specify assignee and workspace.

For more complex task retrieval, use workspaces/{workspace_gid}/tasks/search.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
assigneequerystringfalseThe assignee to filter tasks on.
projectquerystringfalseThe project to filter tasks on.
sectionquerystringfalseThe section to filter tasks on.
workspacequerystringfalseThe workspace to filter tasks on.
completed_sincequerystring(date-time)falseOnly return tasks that are either incomplete or that have been completed since this time.
modified_sincequerystring(date-time)falseOnly return tasks that have been modified since the given time.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Detailed descriptions

assignee: The assignee to filter tasks on. Note: If you specify assignee, you must also specify the workspace to filter on.

section: The section to filter tasks on. Note: Currently, this is only supported in board views.

workspace: The workspace to filter tasks on. Note: If you specify workspace, you must also specify the assignee to filter on.

modified_since: Only return tasks that have been modified since the given time.

Note: A task is considered “modified” if any of its properties change, or associations between it and other objects are modified (e.g. a task being added to a project). A task is not considered modified just because another object it is associated with (e.g. a subtask) is modified. Actions that count as modifying the task include assigning, renaming, completing, and adding stories.

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "task",
      "name": "Buy catnip",
      "created_at": "2012-02-22T02:06:58.147Z",
      "resource_subtype": "default_task",
      "assignee": null,
      "assignee_status": "upcoming",
      "completed": false,
      "completed_at": "2012-02-22T02:06:58.147Z",
      "custom_fields": [
        ...
      ],
      "dependencies": [
        ...
      ],
      "dependents": [
        ...
      ],
      "due_at": "2012-02-22T02:06:58.147Z",
      "due_on": "2012-03-26",
      "external": {
        ...
      },
      "followers": [
        ...
      ],
      "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
      "hearted": true,
      "hearts": [
        ...
      ],
      "is_rendered_as_separator": false,
      "liked": true,
      "likes": [
        ...
      ],
      "memberships": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "Mittens really likes the stuff from Humboldt.",
      "num_hearts": 5,
      "num_likes": 5,
      "num_subtasks": 3,
      "parent": null,
      "projects": [
        ...
      ],
      "start_on": "2012-03-26",
      "tags": [
        ...
      ],
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved requested tasks.Task
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a task

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/tasks \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /tasks

Creating a new task is as easy as POSTing to the /tasks endpoint with a data block containing the fields you’d like to set on the task. Any unspecified fields will take on default values.

Every task is required to be created in a specific workspace, and this workspace cannot be changed once set. The workspace need not be set explicitly if you specify projects or a parent task instead.

Body parameter

{
  "data": {
    "name": "Buy catnip",
    "assignee": "12345",
    "assignee_status": "upcoming",
    "completed": false,
    "due_at": "2012-02-22T02:06:58.147Z",
    "due_on": "2012-03-26",
    "external": {
      "gid": "my_gid",
      "data": "A blob of information"
    },
    "followers": [
      "12345"
    ],
    "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
    "notes": "Mittens really likes the stuff from Humboldt.",
    "parent": "12345",
    "projects": [
      "12345"
    ],
    "start_on": "2012-03-26",
    "tags": [
      "12345"
    ],
    "workspace": "12345"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe task to create.
databodyobjectfalseThe task is the basic object around which many operations in Asana are centered.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
created_atbodystring(date-time)falseThe time at which this resource was created.
resource_subtypebodystringfalseThe 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.
assigneebodystringfalseGid of an object.
assignee_statusbodystringfalseScheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null.
completedbodybooleanfalseTrue if the task is currently marked complete, false if not.
completed_atbodystring(date-time)¦nullfalseThe time at which this task was completed, or null if the task is incomplete.
custom_fieldsbody[object]falseArray of custom field values applied to the project. These represent the custom field values recorded on this project for a particular custom field. For example, these custom field values will contain an enum_value property for custom fields of type enum, a string_value property for custom fields of type string, and so on. Please note that the gid returned on each custom field value is identical to the gid of the custom field, which allows referencing the custom field metadata through the /custom_fields/custom_field-gid endpoint.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the object.
resource_subtypebodystringfalseThe 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.
typebodystringfalseDeprecated: new integrations should prefer the resource_subtype field. The type of the custom field. Must be one of the given values.
enum_optionsbody[object]falseConditional. Only relevant for custom fields of type enum. This array specifies the possible values which an enum custom field can adopt. To modify the enum options, refer to working with enum options.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the enum option.
enabledbodybooleanfalseThe color of the enum option. Defaults to ‘none’.
colorbodystringfalseWhether or not the enum option is a selectable value for the custom field.
enum_valuebodyanyfalsenone
enabledbodybooleanfalseConditional. Determines if the custom field is enabled or not.
text_valuebodystringfalseConditional. This string is the value of a text custom field.
descriptionbodystringfalseOpt In. The description of the custom field.
precisionbodyintegerfalseOnly relevant for custom fields of type ‘Number’. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive.
is_global_to_workspacebodybooleanfalseThis flag describes whether this custom field is available to every container in the workspace. Before project-specific custom fields, this field was always true.
has_notifications_enabledbodybooleanfalseThis flag describes whether a follower of a task with this field should receive inbox notifications from changes to this field.
dependenciesbody[object]falseOpt In. Array of resources referencing tasks that this task depends on. The objects contain only the gid of the dependency.
gidbodystringfalsenone
dependentsbody[object]falseOpt In. Array of resources referencing tasks that depend on this task. The objects contain only the ID of the dependent.
gidbodystringfalsenone
due_atbodystring(date)¦nullfalseDate and time on which this task is due, or null if the task has no due time. This takes a UTC timestamp and should not be used together with due_on.
due_onbodystring(date)¦nullfalseDate on which this task is due, or null if the task has no due date. This takes a date with YYYY-MM-DD format and should not be used together with due_at.
externalbodyobjectfalseOAuth Required. Conditional. This field is returned only if external values are set or included by using Opt In.
gidbodystringfalsenone
databodystringfalsenone
followersbody[string]falseArray of object Gids.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
html_notesbodystringfalseOpt In. The notes of the text with formatting as HTML.
heartedbodybooleanfalseDeprecated - please use liked instead True if the task is hearted by the authorized user, false if not.
heartsbody[object]falseDeprecated - please use likes instead Array of users who have hearted this task.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
is_rendered_as_separatorbodybooleanfalseOpt In. In some contexts tasks can be rendered as a visual separator; for instance, subtasks can appear similar to sections without being true section objects. If a task object is rendered this way in any context it will have the property is_rendered_as_separator set to true.

Note: Until the default behavior for our API changes integrations must opt in to the new_sections change to modify the is_rendered_as_separator property.
likedbodybooleanfalseTrue if the task is liked by the authorized user, false if not.
likesbody[object]falseArray of users who have liked this task.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
membershipsbody[object]falseCreate-only. Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections. After task creation, these associations can be modified using the addProject and removeProject endpoints. Note that over time, more types of memberships may be added to this property.
projectbodyobjectfalseA project represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
sectionbodyobjectfalseA section is a subdivision of a project that groups tasks together. It can either be a header above a list of tasks in a list view or a column in a board view of a project.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the section (i.e. the text displayed as the section header).
modified_atbodystring(date-time)falseThe time at which this task was last modified.
notesbodystringfalseMore detailed, free-form textual information associated with the task.
num_heartsbodyintegerfalseDeprecated - please use likes instead The number of users who have hearted this task.
num_likesbodyintegerfalseThe number of users who have liked this task.
num_subtasksbodyintegerfalseOpt In. The number of subtasks on this task.
parentbodystringfalseGid of an object.
projectsbody[string]falseArray of object Gids.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
start_onbodystring(date)¦nullfalseThe day on which work begins for the task , or null if the task has no start date. This takes a date with YYYY-MM-DD format.
tagsbody[string]falseArray of object Gids.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the tag. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
workspacebodystringfalseGid of an object.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Detailed descriptions

resource_subtype: 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. Note: The resource_subtype of section is under active migration—please see our forum post for more information.

external: OAuth Required. Conditional. This field is returned only if external values are set or included by using Opt In. The external field allows you to store app-specific metadata on tasks, including a gid that can be used to retrieve tasks and a data blob that can store app-specific character strings. Note that you will need to authenticate with Oauth to access or modify this data. Once an external gid is set, you can use the notation external:custom_gid to reference your object anywhere in the API where you may use the original object gid. See the page on Custom External Data for more details.

html_notes: Opt In. The notes of the text with formatting as HTML. Note: This field is under active migration—please see our blog post for more information.

modified_at: The time at which this task was last modified.

Note: This does not currently reflect any changes in associations such as projects or comments that may have been added or removed from the task.

start_on: The day on which work begins for the task , or null if the task has no start date. This takes a date with YYYY-MM-DD format. Note: due_on or due_at must be present in the request when setting or unsetting the start_on parameter.

Enumerated Values

ParameterValue
resource_subtypedefault_task
resource_subtypemilestone
resource_subtypesection
assignee_statustoday
assignee_statusupcoming
assignee_statuslater
assignee_statusnew
assignee_statusinbox
typetext
typeenum
typenumber

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "task",
    "name": "Buy catnip",
    "created_at": "2012-02-22T02:06:58.147Z",
    "resource_subtype": "default_task",
    "assignee": null,
    "assignee_status": "upcoming",
    "completed": false,
    "completed_at": "2012-02-22T02:06:58.147Z",
    "custom_fields": [
      {
        ...
      }
    ],
    "dependencies": [
      {
        ...
      },
      {
        ...
      }
    ],
    "dependents": [
      {
        ...
      },
      {
        ...
      }
    ],
    "due_at": "2012-02-22T02:06:58.147Z",
    "due_on": "2012-03-26",
    "external": {
      "gid": "my_gid",
      "data": "A blob of information"
    },
    "followers": [
      {
        ...
      }
    ],
    "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
    "hearted": true,
    "hearts": [
      {
        ...
      }
    ],
    "is_rendered_as_separator": false,
    "liked": true,
    "likes": [
      {
        ...
      }
    ],
    "memberships": [
      {
        ...
      }
    ],
    "modified_at": "2012-02-22T02:06:58.147Z",
    "notes": "Mittens really likes the stuff from Humboldt.",
    "num_hearts": 5,
    "num_likes": 5,
    "num_subtasks": 3,
    "parent": null,
    "projects": [
      {
        ...
      }
    ],
    "start_on": "2012-03-26",
    "tags": [
      {
        ...
      }
    ],
    "workspace": null
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created a new task.Task
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get a task

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tasks/{task_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tasks/{task_gid}

Returns the complete task record for a single task.

Parameters

NameInTypeRequiredDescription
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "task",
    "name": "Buy catnip",
    "created_at": "2012-02-22T02:06:58.147Z",
    "resource_subtype": "default_task",
    "assignee": null,
    "assignee_status": "upcoming",
    "completed": false,
    "completed_at": "2012-02-22T02:06:58.147Z",
    "custom_fields": [
      {
        ...
      }
    ],
    "dependencies": [
      {
        ...
      },
      {
        ...
      }
    ],
    "dependents": [
      {
        ...
      },
      {
        ...
      }
    ],
    "due_at": "2012-02-22T02:06:58.147Z",
    "due_on": "2012-03-26",
    "external": {
      "gid": "my_gid",
      "data": "A blob of information"
    },
    "followers": [
      {
        ...
      }
    ],
    "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
    "hearted": true,
    "hearts": [
      {
        ...
      }
    ],
    "is_rendered_as_separator": false,
    "liked": true,
    "likes": [
      {
        ...
      }
    ],
    "memberships": [
      {
        ...
      }
    ],
    "modified_at": "2012-02-22T02:06:58.147Z",
    "notes": "Mittens really likes the stuff from Humboldt.",
    "num_hearts": 5,
    "num_likes": 5,
    "num_subtasks": 3,
    "parent": null,
    "projects": [
      {
        ...
      }
    ],
    "start_on": "2012-03-26",
    "tags": [
      {
        ...
      }
    ],
    "workspace": null
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified task.Task
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Update a task

Code samples

# You can also use wget
curl -X PUT https://app.asana.com/api/1.0/tasks/{task_gid} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PUT /tasks/{task_gid}

A specific, existing task can be updated by making a PUT request on the URL for that task. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged.

When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task.

Returns the complete updated task record.

Body parameter

{
  "data": {
    "name": "Buy catnip",
    "assignee": "12345",
    "assignee_status": "upcoming",
    "completed": false,
    "due_at": "2012-02-22T02:06:58.147Z",
    "due_on": "2012-03-26",
    "external": {
      "gid": "my_gid",
      "data": "A blob of information"
    },
    "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
    "notes": "Mittens really likes the stuff from Humboldt.",
    "parent": "12345",
    "start_on": "2012-03-26",
    "workspace": null
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe task to update.
databodyobjectfalseThe task is the basic object around which many operations in Asana are centered.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
created_atbodystring(date-time)falseThe time at which this resource was created.
resource_subtypebodystringfalseThe 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.
assigneebodystringfalseGid of an object.
assignee_statusbodystringfalseScheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null.
completedbodybooleanfalseTrue if the task is currently marked complete, false if not.
completed_atbodystring(date-time)¦nullfalseThe time at which this task was completed, or null if the task is incomplete.
custom_fieldsbody[object]falseArray of custom field values applied to the project. These represent the custom field values recorded on this project for a particular custom field. For example, these custom field values will contain an enum_value property for custom fields of type enum, a string_value property for custom fields of type string, and so on. Please note that the gid returned on each custom field value is identical to the gid of the custom field, which allows referencing the custom field metadata through the /custom_fields/custom_field-gid endpoint.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the object.
resource_subtypebodystringfalseThe 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.
typebodystringfalseDeprecated: new integrations should prefer the resource_subtype field. The type of the custom field. Must be one of the given values.
enum_optionsbody[object]falseConditional. Only relevant for custom fields of type enum. This array specifies the possible values which an enum custom field can adopt. To modify the enum options, refer to working with enum options.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the enum option.
enabledbodybooleanfalseThe color of the enum option. Defaults to ‘none’.
colorbodystringfalseWhether or not the enum option is a selectable value for the custom field.
enum_valuebodyanyfalsenone
enabledbodybooleanfalseConditional. Determines if the custom field is enabled or not.
text_valuebodystringfalseConditional. This string is the value of a text custom field.
descriptionbodystringfalseOpt In. The description of the custom field.
precisionbodyintegerfalseOnly relevant for custom fields of type ‘Number’. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive.
is_global_to_workspacebodybooleanfalseThis flag describes whether this custom field is available to every container in the workspace. Before project-specific custom fields, this field was always true.
has_notifications_enabledbodybooleanfalseThis flag describes whether a follower of a task with this field should receive inbox notifications from changes to this field.
dependenciesbody[object]falseOpt In. Array of resources referencing tasks that this task depends on. The objects contain only the gid of the dependency.
gidbodystringfalsenone
dependentsbody[object]falseOpt In. Array of resources referencing tasks that depend on this task. The objects contain only the ID of the dependent.
gidbodystringfalsenone
due_atbodystring(date)¦nullfalseDate and time on which this task is due, or null if the task has no due time. This takes a UTC timestamp and should not be used together with due_on.
due_onbodystring(date)¦nullfalseDate on which this task is due, or null if the task has no due date. This takes a date with YYYY-MM-DD format and should not be used together with due_at.
externalbodyobjectfalseOAuth Required. Conditional. This field is returned only if external values are set or included by using Opt In.
gidbodystringfalsenone
databodystringfalsenone
followersbody[object]falseArray of users following this task.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
html_notesbodystringfalseOpt In. The notes of the text with formatting as HTML.
heartedbodybooleanfalseDeprecated - please use liked instead True if the task is hearted by the authorized user, false if not.
heartsbody[object]falseDeprecated - please use likes instead Array of users who have hearted this task.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
is_rendered_as_separatorbodybooleanfalseOpt In. In some contexts tasks can be rendered as a visual separator; for instance, subtasks can appear similar to sections without being true section objects. If a task object is rendered this way in any context it will have the property is_rendered_as_separator set to true.

Note: Until the default behavior for our API changes integrations must opt in to the new_sections change to modify the is_rendered_as_separator property.
likedbodybooleanfalseTrue if the task is liked by the authorized user, false if not.
likesbody[object]falseArray of users who have liked this task.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
membershipsbody[object]falseCreate-only. Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections. After task creation, these associations can be modified using the addProject and removeProject endpoints. Note that over time, more types of memberships may be added to this property.
projectbodyobjectfalseA project represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
sectionbodyobjectfalseA section is a subdivision of a project that groups tasks together. It can either be a header above a list of tasks in a list view or a column in a board view of a project.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the section (i.e. the text displayed as the section header).
modified_atbodystring(date-time)falseThe time at which this task was last modified.
notesbodystringfalseMore detailed, free-form textual information associated with the task.
num_heartsbodyintegerfalseDeprecated - please use likes instead The number of users who have hearted this task.
num_likesbodyintegerfalseThe number of users who have liked this task.
num_subtasksbodyintegerfalseOpt In. The number of subtasks on this task.
parentbodystringfalseGid of an object.
projectsbody[object]falseCreate-only. Array of projects this task is associated with. At task creation time, this array can be used to add the task to many projects at once. After task creation, these associations can be modified using the addProject and removeProject endpoints.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
start_onbodystring(date)¦nullfalseThe day on which work begins for the task , or null if the task has no start date. This takes a date with YYYY-MM-DD format.
tagsbody[object]falseCreate-only. Array of tags associated with this task. This property may be specified on creation using just an array of tag gids. In order to change tags on an existing task use addTag and removeTag.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the tag. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
workspacebodyanyfalsenone
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Detailed descriptions

resource_subtype: 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. Note: The resource_subtype of section is under active migration—please see our forum post for more information.

external: OAuth Required. Conditional. This field is returned only if external values are set or included by using Opt In. The external field allows you to store app-specific metadata on tasks, including a gid that can be used to retrieve tasks and a data blob that can store app-specific character strings. Note that you will need to authenticate with Oauth to access or modify this data. Once an external gid is set, you can use the notation external:custom_gid to reference your object anywhere in the API where you may use the original object gid. See the page on Custom External Data for more details.

html_notes: Opt In. The notes of the text with formatting as HTML. Note: This field is under active migration—please see our blog post for more information.

modified_at: The time at which this task was last modified.

Note: This does not currently reflect any changes in associations such as projects or comments that may have been added or removed from the task.

start_on: The day on which work begins for the task , or null if the task has no start date. This takes a date with YYYY-MM-DD format. Note: due_on or due_at must be present in the request when setting or unsetting the start_on parameter.

Enumerated Values

ParameterValue
resource_subtypedefault_task
resource_subtypemilestone
resource_subtypesection
assignee_statustoday
assignee_statusupcoming
assignee_statuslater
assignee_statusnew
assignee_statusinbox
typetext
typeenum
typenumber

200 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "task",
    "name": "Buy catnip",
    "created_at": "2012-02-22T02:06:58.147Z",
    "resource_subtype": "default_task",
    "assignee": null,
    "assignee_status": "upcoming",
    "completed": false,
    "completed_at": "2012-02-22T02:06:58.147Z",
    "custom_fields": [
      {
        ...
      }
    ],
    "dependencies": [
      {
        ...
      },
      {
        ...
      }
    ],
    "dependents": [
      {
        ...
      },
      {
        ...
      }
    ],
    "due_at": "2012-02-22T02:06:58.147Z",
    "due_on": "2012-03-26",
    "external": {
      "gid": "my_gid",
      "data": "A blob of information"
    },
    "followers": [
      {
        ...
      }
    ],
    "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
    "hearted": true,
    "hearts": [
      {
        ...
      }
    ],
    "is_rendered_as_separator": false,
    "liked": true,
    "likes": [
      {
        ...
      }
    ],
    "memberships": [
      {
        ...
      }
    ],
    "modified_at": "2012-02-22T02:06:58.147Z",
    "notes": "Mittens really likes the stuff from Humboldt.",
    "num_hearts": 5,
    "num_likes": 5,
    "num_subtasks": 3,
    "parent": null,
    "projects": [
      {
        ...
      }
    ],
    "start_on": "2012-03-26",
    "tags": [
      {
        ...
      }
    ],
    "workspace": null
  }
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully updated the specified task.Task
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Delete a task

Code samples

# You can also use wget
curl -X DELETE https://app.asana.com/api/1.0/tasks/{task_gid} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE /tasks/{task_gid}

A specific, existing task can be deleted by making a DELETE request on the URL for that task. Deleted tasks go into the “trash” of the user making the delete request. Tasks can be recovered from the trash within a period of 30 days; afterward they are completely removed from the system.

Returns an empty data record.

Parameters

NameInTypeRequiredDescription
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": {}
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully deleted the specified task.Empty
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Duplicate a task

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/tasks/{task_gid}/duplicate \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /tasks/{task_gid}/duplicate

Creates and returns a job that will asynchronously handle the duplication.

Body parameter

{
  "data": {
    "name": "New Task Name",
    "include": [
      "notes",
      "assignee"
    ]
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueDescribes the duplicate's name and the fields that will be duplicated.
databodyobjectfalsenone
namebodystringfalseThe name of the new task.
includebodystringfalseThe fields that will be duplicated to the new task.
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

Enumerated Values

ParameterValue
includenotes
includeassignee
includesubtasks
includeattachments
includetags
includefollowers
includeprojects
includedates
includedependencies
includeparent

201 Response

{
  "data": {
    "gid": "12345",
    "resource_type": "task",
    "resource_subtype": "milestone",
    "status": "in_progress",
    "new_project": {
      "gid": "12345",
      "resource_type": "project",
      "name": "Stuff to buy"
    },
    "new_task": {
      "gid": "12345",
      "resource_type": "task",
      "name": "Bug Task"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
201CreatedSuccessfully created the job to handle duplication.Job
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get tasks from a project

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/projects/{project_gid}/tasks \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /projects/{project_gid}/tasks

Returns the compact task records for all tasks within the given project, ordered by their priority within the project. Tasks can exist in more than one project at a time.

Parameters

NameInTypeRequiredDescription
project_gidpathstringtrueGlobally unique identifier for the project.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "task",
      "name": "Buy catnip",
      "created_at": "2012-02-22T02:06:58.147Z",
      "resource_subtype": "default_task",
      "assignee": null,
      "assignee_status": "upcoming",
      "completed": false,
      "completed_at": "2012-02-22T02:06:58.147Z",
      "custom_fields": [
        ...
      ],
      "dependencies": [
        ...
      ],
      "dependents": [
        ...
      ],
      "due_at": "2012-02-22T02:06:58.147Z",
      "due_on": "2012-03-26",
      "external": {
        ...
      },
      "followers": [
        ...
      ],
      "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
      "hearted": true,
      "hearts": [
        ...
      ],
      "is_rendered_as_separator": false,
      "liked": true,
      "likes": [
        ...
      ],
      "memberships": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "Mittens really likes the stuff from Humboldt.",
      "num_hearts": 5,
      "num_likes": 5,
      "num_subtasks": 3,
      "parent": null,
      "projects": [
        ...
      ],
      "start_on": "2012-03-26",
      "tags": [
        ...
      ],
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the requested project's tasks.Task
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get tasks from a section

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/sections/{section_gid}/tasks \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /sections/{section_gid}/tasks

Board view only: Returns the compact section records for all tasks within the given section.

Parameters

NameInTypeRequiredDescription
section_gidpathstringtrueThe globally unique identified for the section.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "task",
      "name": "Buy catnip",
      "created_at": "2012-02-22T02:06:58.147Z",
      "resource_subtype": "default_task",
      "assignee": null,
      "assignee_status": "upcoming",
      "completed": false,
      "completed_at": "2012-02-22T02:06:58.147Z",
      "custom_fields": [
        ...
      ],
      "dependencies": [
        ...
      ],
      "dependents": [
        ...
      ],
      "due_at": "2012-02-22T02:06:58.147Z",
      "due_on": "2012-03-26",
      "external": {
        ...
      },
      "followers": [
        ...
      ],
      "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
      "hearted": true,
      "hearts": [
        ...
      ],
      "is_rendered_as_separator": false,
      "liked": true,
      "likes": [
        ...
      ],
      "memberships": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "Mittens really likes the stuff from Humboldt.",
      "num_hearts": 5,
      "num_likes": 5,
      "num_subtasks": 3,
      "parent": null,
      "projects": [
        ...
      ],
      "start_on": "2012-03-26",
      "tags": [
        ...
      ],
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the section's tasks.Task
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get tasks from a tag

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tags/{tag_gid}/tasks \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tags/{tag_gid}/tasks

Returns the compact task records for all tasks with the given tag. Tasks can have more than one tag at a time.

Parameters

NameInTypeRequiredDescription
tag_gidpathstringtrueGlobally unique identifier for the tag.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "task",
      "name": "Buy catnip",
      "created_at": "2012-02-22T02:06:58.147Z",
      "resource_subtype": "default_task",
      "assignee": null,
      "assignee_status": "upcoming",
      "completed": false,
      "completed_at": "2012-02-22T02:06:58.147Z",
      "custom_fields": [
        ...
      ],
      "dependencies": [
        ...
      ],
      "dependents": [
        ...
      ],
      "due_at": "2012-02-22T02:06:58.147Z",
      "due_on": "2012-03-26",
      "external": {
        ...
      },
      "followers": [
        ...
      ],
      "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
      "hearted": true,
      "hearts": [
        ...
      ],
      "is_rendered_as_separator": false,
      "liked": true,
      "likes": [
        ...
      ],
      "memberships": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "Mittens really likes the stuff from Humboldt.",
      "num_hearts": 5,
      "num_likes": 5,
      "num_subtasks": 3,
      "parent": null,
      "projects": [
        ...
      ],
      "start_on": "2012-03-26",
      "tags": [
        ...
      ],
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the tasks associated with the specified tag.Task
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Get subtasks from a task

Code samples

# You can also use wget
curl -X GET https://app.asana.com/api/1.0/tasks/{task_gid}/subtasks \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /tasks/{task_gid}/subtasks

Returns a compact representation of all of the subtasks of a task.

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseResults per page.
offsetquerystringfalseOffset token.
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters ↑

200 Response

{
  "data": [
    {
      "gid": "12345",
      "resource_type": "task",
      "name": "Buy catnip",
      "created_at": "2012-02-22T02:06:58.147Z",
      "resource_subtype": "default_task",
      "assignee": null,
      "assignee_status": "upcoming",
      "completed": false,
      "completed_at": "2012-02-22T02:06:58.147Z",
      "custom_fields": [
        ...
      ],
      "dependencies": [
        ...
      ],
      "dependents": [
        ...
      ],
      "due_at": "2012-02-22T02:06:58.147Z",
      "due_on": "2012-03-26",
      "external": {
        ...
      },
      "followers": [
        ...
      ],
      "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
      "hearted": true,
      "hearts": [
        ...
      ],
      "is_rendered_as_separator": false,
      "liked": true,
      "likes": [
        ...
      ],
      "memberships": [
        ...
      ],
      "modified_at": "2012-02-22T02:06:58.147Z",
      "notes": "Mittens really likes the stuff from Humboldt.",
      "num_hearts": 5,
      "num_likes": 5,
      "num_subtasks": 3,
      "parent": null,
      "projects": [
        ...
      ],
      "start_on": "2012-03-26",
      "tags": [
        ...
      ],
      "workspace": null
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully retrieved the specified task's subtasks.Task
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.Error
401UnauthorizedA valid authentication token was not provided with the request, so the API could not associate a user with the request.Error
403ForbiddenThe 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.Error
404Not FoundEither 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.Error
500Internal Server ErrorThere 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.Error
↓ Show Common Responses ↓↑ Hide Common Responses ↑


Create a subtask

Code samples

# You can also use wget
curl -X POST https://app.asana.com/api/1.0/tasks/{task_gid}/subtasks \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /tasks/{task_gid}/subtasks

Creates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask.

Body parameter

{
  "data": {
    "name": "Buy catnip",
    "assignee": "12345",
    "assignee_status": "upcoming",
    "completed": false,
    "due_at": "2012-02-22T02:06:58.147Z",
    "due_on": "2012-03-26",
    "external": {
      "gid": "my_gid",
      "data": "A blob of information"
    },
    "followers": [
      "12345"
    ],
    "html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
    "notes": "Mittens really likes the stuff from Humboldt.",
    "projects": [
      "12345"
    ],
    "start_on": "2012-03-26",
    "tags": [
      "12345"
    ],
    "workspace": "12345"
  }
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe new subtask to create.
databodyobjectfalseThe task is the basic object around which many operations in Asana are centered.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
created_atbodystring(date-time)falseThe time at which this resource was created.
resource_subtypebodystringfalseThe 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.
assigneebodystringfalseGid of an object.
assignee_statusbodystringfalseScheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null.
completedbodybooleanfalseTrue if the task is currently marked complete, false if not.
completed_atbodystring(date-time)¦nullfalseThe time at which this task was completed, or null if the task is incomplete.
custom_fieldsbody[object]falseArray of custom field values applied to the project. These represent the custom field values recorded on this project for a particular custom field. For example, these custom field values will contain an enum_value property for custom fields of type enum, a string_value property for custom fields of type string, and so on. Please note that the gid returned on each custom field value is identical to the gid of the custom field, which allows referencing the custom field metadata through the /custom_fields/custom_field-gid endpoint.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the object.
resource_subtypebodystringfalseThe 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.
typebodystringfalseDeprecated: new integrations should prefer the resource_subtype field. The type of the custom field. Must be one of the given values.
enum_optionsbody[object]falseConditional. Only relevant for custom fields of type enum. This array specifies the possible values which an enum custom field can adopt. To modify the enum options, refer to working with enum options.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the enum option.
enabledbodybooleanfalseThe color of the enum option. Defaults to ‘none’.
colorbodystringfalseWhether or not the enum option is a selectable value for the custom field.
enum_valuebodyanyfalsenone
enabledbodybooleanfalseConditional. Determines if the custom field is enabled or not.
text_valuebodystringfalseConditional. This string is the value of a text custom field.
descriptionbodystringfalseOpt In. The description of the custom field.
precisionbodyintegerfalseOnly relevant for custom fields of type ‘Number’. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive.
is_global_to_workspacebodybooleanfalseThis flag describes whether this custom field is available to every container in the workspace. Before project-specific custom fields, this field was always true.
has_notifications_enabledbodybooleanfalseThis flag describes whether a follower of a task with this field should receive inbox notifications from changes to this field.
dependenciesbody[object]falseOpt In. Array of resources referencing tasks that this task depends on. The objects contain only the gid of the dependency.
gidbodystringfalsenone
dependentsbody[object]falseOpt In. Array of resources referencing tasks that depend on this task. The objects contain only the ID of the dependent.
gidbodystringfalsenone
due_atbodystring(date)¦nullfalseDate and time on which this task is due, or null if the task has no due time. This takes a UTC timestamp and should not be used together with due_on.
due_onbodystring(date)¦nullfalseDate on which this task is due, or null if the task has no due date. This takes a date with YYYY-MM-DD format and should not be used together with due_at.
externalbodyobjectfalseOAuth Required. Conditional. This field is returned only if external values are set or included by using Opt In.
gidbodystringfalsenone
databodystringfalsenone
followersbody[string]falseArray of object Gids.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
html_notesbodystringfalseOpt In. The notes of the text with formatting as HTML.
heartedbodybooleanfalseDeprecated - please use liked instead True if the task is hearted by the authorized user, false if not.
heartsbody[object]falseDeprecated - please use likes instead Array of users who have hearted this task.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
is_rendered_as_separatorbodybooleanfalseOpt In. In some contexts tasks can be rendered as a visual separator; for instance, subtasks can appear similar to sections without being true section objects. If a task object is rendered this way in any context it will have the property is_rendered_as_separator set to true.

Note: Until the default behavior for our API changes integrations must opt in to the new_sections change to modify the is_rendered_as_separator property.
likedbodybooleanfalseTrue if the task is liked by the authorized user, false if not.
likesbody[object]falseArray of users who have liked this task.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseRead-only except when same user as requester. The user’s name.
membershipsbody[object]falseCreate-only. Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections. After task creation, these associations can be modified using the addProject and removeProject endpoints. Note that over time, more types of memberships may be added to this property.
projectbodyobjectfalseA project represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
sectionbodyobjectfalseA section is a subdivision of a project that groups tasks together. It can either be a header above a list of tasks in a list view or a column in a board view of a project.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseThe name of the section (i.e. the text displayed as the section header).
modified_atbodystring(date-time)falseThe time at which this task was last modified.
notesbodystringfalseMore detailed, free-form textual information associated with the task.
num_heartsbodyintegerfalseDeprecated - please use likes instead The number of users who have hearted this task.
num_likesbodyintegerfalseThe number of users who have liked this task.
num_subtasksbodyintegerfalseOpt In. The number of subtasks on this task.
parentbodyanyfalsenone
projectsbody[string]falseArray of object Gids.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
start_onbodystring(date)¦nullfalseThe day on which work begins for the task , or null if the task has no start date. This takes a date with YYYY-MM-DD format.
tagsbody[string]falseArray of object Gids.
gidbodystringfalseGlobally unique identifier of the object, as a string.
resource_typebodystringfalseThe base type of this resource.
namebodystringfalseName of the tag. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
workspacebodystringfalseGid of an object.
task_gidpathstringtrueThe task to operate on.
opt_prettyquerybooleanfalseProvides “pretty” output.
opt_fieldsqueryarray[string]falseDefines fields to return.
↓ Show Common Parameters ↓↑ Hide Common Parameters &uar