Sample - Asana API
POST/sections/{section_gid}/addTask

Add a task to a section

Adds an existing task to a specific section in a project. Supply task and optionally place it with insert_before or insert_after; adding the task removes it from other sections in the project. The task is placed at the top by default, and separators cannot be added.

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

1 body field

The task to add to the section and its optional insertion location.

dataobjectoptional

6 status codes
200Returns an empty `data` object confirming that the task was added to the section.
dataobjectoptional
An empty object. Some endpoints do not return an object on success. The success is conveyed through a 2-- status code and returning an empty object.
400Returned when a required value is missing or a request parameter is malformed, including conflicting insertion fields.
errorsarray<object>optional
401Returned when a valid authentication token was not provided with the request.
errorsarray<object>optional
403Returned when the authenticated user does not have access to modify the section or task.
errorsarray<object>optional
404Returned when the specified section or task does not exist.
errorsarray<object>optional
500Returned when a server-side problem prevents the task from being added.
errorsarray<object>optional

Error handling

A 400 is returned when the request is missing or malformed. A 401 is returned when no valid authentication token is provided, and a 403 is returned when the authenticated user lacks permission to modify the section. A 404 is returned when the section or task does not exist, while a 500 indicates a server-side failure; task must identify an existing task, and insert_before and insert_after cannot be supplied together.