API endpoint for `Add a project to a task`

Hi, I have problems with the insert_after parameter. I’m setting a null, for this, and my task going in another column, although it should move on top of the same column.

My cURL:

curl --location --request POST 'https://app.asana.com/api/1.0/tasks/{task_id}/addProject' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--header 'Cookie: TooBusyRedirectCount=0' \
--data-raw '{
    "data":
    {
        "insert_after": null, 
        "project":"{project_id}"
    }
}'

Hi @Shota_Sivsivadze,

Per the documentation, I think you’ll have to find the ID of the current top task in the desired column and use insert_before with that ID.

Just using insert_before = null will put the task at the top of the project task list:

or null to insert at the beginning of the list.

and if you think about it, you haven’t specified a section/column so there’s no way Asana would know what “the same column” means.