Sample - Asana API
POST/tasks

Create a task

Creates a new task from the attributes supplied in the data object. Unspecified task fields receive their default values, and the task must belong to a workspace identified directly or through projects or a parent task. Use opt_fields to request optional properties in the created task response.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 1 body field
opt_fieldsarray<string>optional
Comma-separated properties to include in the response, including nested properties such as `assignee.name` and `assigned_by.name`. Supported values include actual_time_minutes, approval_status, assigned_by, assigned_by.name, assignee, assignee.name, assignee_section, assignee_section.name, assignee_status, completed, completed_at, and completed_by, plus additional documented values.

The task to create, supplied in the data object.

dataobjectoptional
Task attributes for the new task, including supported fields such as followers, projects, tags, and workspace. Establish the task's workspace directly or through `projects` or `parent`.

6 status codes
201Returns the newly created task record, including the task attributes and any properties requested through `opt_fields.
dataobjectoptional
400Returned when the request is malformed or task creation data is invalid, including when the task cannot be associated with a workspace.
errorsarray<object>optional
401Returned when a valid authentication token is not provided with the request.
errorsarray<object>optional
403Returned when the authenticated user is not permitted to create the task or lacks the required access scope.
errorsarray<object>optional
404Returned when a referenced object or requested action does not exist.
errorsarray<object>optional
500Returned when a server-side problem prevents the task from being created.
errorsarray<object>optional

Error handling

A 400 is returned when the request is malformed or required task information is invalid; provide a valid data object and establish a workspace directly or through projects or parent. A 401 is returned when no valid authentication token is provided, and a 403 is returned when the authenticated user lacks the tasks:write scope or access to the target workspace. A 404 is returned when a referenced object or action does not exist, while a 500 indicates a server-side failure.