Create a task
POST
/tasks
Tasks
/tasks
endpoint with adata block containing the fields you’d like to set on the task. Any
unspecified fields will take on default values.
workspace cannot be changed once set. The workspace need not be set
explicitly if you specify
projects
or a parent
task instead.Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://app.asana.com/api/1.0/tasks' \
--header 'Content-Type: application/json' \
--data-raw ''
Response Response Example
201 - Example 1
{
"data": {
"gid": "12345",
"resource_type": "task",
"name": "Buy catnip",
"approval_status": "pending",
"assignee_status": "upcoming",
"completed": false,
"completed_at": "2012-02-22T02:06:58.147Z",
"completed_by": {
"gid": "12345",
"resource_type": "task",
"name": "Greg Sanchez"
},
"created_at": "2012-02-22T02:06:58.147Z",
"dependencies": [
{
"gid": "12345",
"resource_type": "task"
}
],
"dependents": [
{
"gid": "12345",
"resource_type": "task"
}
],
"due_at": "2019-09-15T02:06:58.147Z",
"due_on": "2019-09-15",
"external": {
"data": "A blob of information",
"gid": "my_gid"
},
"hearted": true,
"hearts": [
{
"gid": "12345",
"user": {
"gid": "12345",
"resource_type": "task",
"name": "Greg Sanchez"
}
}
],
"html_notes": "<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>",
"is_rendered_as_separator": false,
"liked": true,
"likes": [
{
"gid": "12345",
"user": {
"gid": "12345",
"resource_type": "task",
"name": "Greg Sanchez"
}
}
],
"memberships": [
{
"project": {
"gid": "12345",
"resource_type": "task",
"name": "Stuff to buy"
},
"section": {
"gid": "12345",
"resource_type": "task",
"name": "Next Actions"
}
}
],
"modified_at": "2012-02-22T02:06:58.147Z",
"notes": "Mittens really likes the stuff from Humboldt.",
"num_hearts": 5,
"num_likes": 5,
"num_subtasks": 3,
"resource_subtype": "default_task",
"start_on": "2019-09-14",
"assignee": {
"gid": "12345",
"resource_type": "task",
"name": "Greg Sanchez"
},
"assignee_section": {
"gid": "12345",
"resource_type": "task",
"name": "Next Actions"
},
"custom_fields": [
{
"gid": "12345",
"resource_type": "task",
"display_value": "blue",
"enabled": true,
"enum_options": [
{
"gid": "12345",
"resource_type": "task",
"color": "blue",
"enabled": true,
"name": "Low"
}
],
"name": "Status",
"number_value": 5.2,
"resource_subtype": "text",
"text_value": "Some Value",
"type": "text",
"currency_code": "EUR",
"custom_label": "gold pieces",
"custom_label_position": "suffix",
"description": "Development team priority",
"format": "custom",
"has_notifications_enabled": true,
"is_global_to_workspace": true,
"precision": 2,
"created_by": {
"gid": "12345",
"resource_type": "task",
"name": "Greg Sanchez"
},
"enum_value": {
"gid": "12345",
"resource_type": "task",
"color": "blue",
"enabled": true,
"name": "Low"
},
"multi_enum_values": [
{
"gid": "12345",
"resource_type": "task",
"color": "blue",
"enabled": true,
"name": "Low"
}
]
}
],
"followers": [
{
"gid": "12345",
"resource_type": "task",
"name": "Greg Sanchez"
}
],
"parent": {
"gid": "12345",
"resource_type": "task",
"name": "Bug Task"
},
"permalink_url": "https://app.asana.com/0/resource/123456789/list",
"projects": [
{
"gid": "12345",
"resource_type": "task",
"name": "Stuff to buy"
}
],
"tags": [
{
"gid": "59746",
"name": "Grade A"
}
],
"workspace": {
"gid": "12345",
"resource_type": "task",
"name": "My Company Workspace"
}
}
}
Request
Body Params application/json
Responses
Modified at 2022-09-13 02:00:32