# Assigning section when using API to create new task

**URL:** <https://forum.asana.com/t/assigning-section-when-using-api-to-create-new-task/121590>\
**Category:** API & Developers\
**Tags:** api, sections, projects, tasks\
**Created:** [17 May 2021 15:54 UTC](https://forum.asana.com/t/assigning-section-when-using-api-to-create-new-task/121590 "2021-05-17T15:54:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![FreshyJon](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/freshyjon/32/6475_2.png) [@FreshyJon](https://forum.asana.com/u/FreshyJon)\
**Post date:** [17 May 2021 17:41 UTC](https://forum.asana.com/t/assigning-section-when-using-api-to-create-new-task/121590/2 "2021-05-17T17:41:11Z")

</div>

I figured it out by changing:

```
"projects": [
  "22446688"
],

```

With:

```
"memberships" : [ 
  {
    "project" : "22446688",
    "section" : "999444222666"
  }
]

```

Thanks to this post: [Add task to a section upon creation via API request - #5 by Joe\_Trollo](https://forum.asana.com/t/add-task-to-a-section-upon-creation-via-api-request/51957/5)

---

_[View the full topic](https://forum.asana.com/t/assigning-section-when-using-api-to-create-new-task/121590)._
