POST /tasks/{task_gid}/addProject
Required scope: tasks:write
Adds the task to the specified project, in the optional location specified. If no location arguments are given, the task will be added to the end of the project.
addProject can also be used to reorder a task within a project or
section that already contains it.
Positioning the task:
- Use
insert_beforeorinsert_afterwith a task ID to position relative to another task - Use
sectionalone to add the task to the end of a section - Use
sectionwithinsert_after: nullto add to the beginning of a section - Use
sectionwithinsert_before: nullto add to the end of a section - Use
sectionwithinsert_beforeorinsert_after(non-null) to position relative to a task within that section. The anchor task must be in the specified section.
At most one of insert_before or insert_after should be specified (both cannot be used together).
A task can have at most 20 projects multi-homed to it.
Returns an empty data block.
Servers
- https://app.asana.com/api/1.0
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
task_gid |
String | Yes |
The task to operate on. |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
opt_pretty |
Boolean | No |
Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
data |
Object | No | |
data.insert_after |
String | No |
A task in the project to insert the task after, or |
data.section |
String | No |
A section in the project to insert the task into. The task will be inserted at the bottom of the section unless combined with |
data.project |
String | Yes |
The project to add the task to. |
data.insert_before |
String | No |
A task in the project to insert the task before, or |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.