Cannot create task with memberships via API

Hey, I’m trying to create a task using node asana API.

Everything works great if I’m specifying only projects: projectId, but I need also specify the section, so my code is “memberships”: [
{“project”: 12345, “section”: 09876}

And I always getting this error: Error: Invalid Request

I think you must do 2 requests, first create your task in the project, then add task to the section.
You don’t set the section of the task, you add the task to the section, as described there:

According to this threads it’s possible to set the section on creation.

Also as I understand from here Asana , I can specify section on creation.

1 Like

I just tried it in our app to see how we do this :smiley: and I found that we also pass the “projects” parameter. So, the post looks like:


But, when I tried without the “projects” parameter, I got a 400 bad request response, but in the response info, I got informations about what is going wrong:

“message=You should specify one of workspace, parent, projects”

So, you should look at the “body” of non-200 responses, sometimes they give informations about why it doesn’t work.


Wow Frederic, thanks a lot, it works, you really helped me.

1 Like