Skip to content

Create a task

API Reference

opt_fields

array of strings

This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.

opt_fields ADD string

opt_pretty

boolean

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.

truetruefalse

The task to create.

data

object

Full object requires scope:tasks:read

The task is the basic object around which many operations in Asana are centered.

dataobject

``201 Successfully created a new task.

object

data

object

Full object requires scope:tasks:read

The task is the basic object around which many operations in Asana are centered.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.

resource_subtype

string

enum

The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. The resource_subtype milestone represent a single moment in time. This means tasks with this subtype cannot have a start_date.

default_task``milestone``approval``custom

created_by

object

Opt In. A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

created_by object

approval_status

string

enum

Conditional Reflects the approval status of this task. This field is kept in sync with completed, meaning pending translates to false while approved, rejected, and changes_requested translate to true. If you set completed to true, this field will be set to approved.

pending``approved``rejected``changes_requested

assignee_status

string

enum

Deprecated Scheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null. Setting this field to "inbox" or "upcoming" inserts it at the top of the section, while the other options will insert at the bottom.

today``upcoming``later``new``inbox

assigned_by

object | null

The user who assigned the task. This field is only returned when requesting it via opt_fields, and will be null if the task has no specific assigner (e.g., tasks created without an explicit assigner).

assigned_by object | null

completed

boolean

True if the task is currently marked complete, false if not.

completed_at

date-time | null

The time at which this task was completed, or null if the task is incomplete.

completed_by

object | null

A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

completed_by object | null

created_at

date-time

The time at which this resource was created.

dependencies

array of objects

Opt In. Array of resources referencing tasks that this task depends on. The objects contain only the gid of the dependency.

dependencies

object

A generic Asana Resource, containing a globally unique identifier.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

dependents

array of objects

Opt In. Array of resources referencing tasks that depend on this task. The objects contain only the ID of the dependent.

dependents

object

A generic Asana Resource, containing a globally unique identifier.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

due_at

date-time | null

The UTC date and time on which this task is due, or null if the task has no due time. This takes an ISO 8601 date string in UTC and should not be used together with due_on.

due_on

date | null

The localized date on which this task is due, or null if the task has no due date. This takes a date with YYYY-MM-DD format and should not be used together with due_at.

external

object

OAuth Required. Conditional. This field is returned only if external values are set or included by using Opt In. The external field allows you to store app-specific metadata on tasks, including a gid that can be used to retrieve tasks and a data blob that can store app-specific character strings. Note that you will need to authenticate with Oauth to access or modify this data. Once an external gid is set, you can use the notation external:custom_gid to reference your object anywhere in the API where you may use the original object gid. See the page on Custom External Data for more details.

external object

html_notes

string

Opt In. The notes of the text with formatting as HTML.

hearted

boolean

Deprecated - please use liked instead True if the task is hearted by the authorized user, false if not.

hearts

array of objects

Deprecated - please use likes instead Array of likes for users who have hearted this task.

hearts

object

An object to represent a user's like.

gid

string

Globally unique identifier of the object, as a string.

user

object

A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

user object

is_rendered_as_separator

boolean

Opt In. In some contexts tasks can be rendered as a visual separator; for instance, subtasks can appear similar to sections without being true section objects. If a task object is rendered this way in any context it will have the property is_rendered_as_separator set to true. This parameter only applies to regular tasks with resource_subtype of default_task. Tasks with resource_subtype of milestone, approval, or custom task types will not have this property and cannot be rendered as separators.

liked

boolean

True if the task is liked by the authorized user, false if not.

likes

array of objects

Array of likes for users who have liked this task.

likes

object

An object to represent a user's like.

gid

string

Globally unique identifier of the object, as a string.

user

object

A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

user object

memberships

array of objects

Full object requires scope:projects:read, project_sections:read

Create-only. Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections. After task creation, these associations can be modified using the addProject and removeProject endpoints. Note that over time, more types of memberships may be added to this property.

memberships

object

project

object

A project represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions.

project object

section

object

A section is a subdivision of a project that groups tasks together. It can either be a header above a list of tasks in a list view or a column in a board view of a project.

section object

modified_at

date-time

The time at which this task was last modified.

The following conditions will change modified_at:

  • story is created on a task
  • story is trashed on a task
  • attachment is trashed on a task
  • task is assigned or unassigned
  • custom field value is changed
  • the task itself is trashed
  • Or if any of the following fields are updated:
    • completed
    • name
    • due_date
    • description
    • attachments
    • items
    • schedule_status

The following conditions will not change modified_at:

  • moving to a new container (project, portfolio, etc)
  • comments being added to the task (but the stories they generate will affect modified_at)

notes

string

Free-form textual information associated with the task (i.e. its description).

num_hearts

integer

Deprecated - please use likes instead The number of users who have hearted this task.

num_likes

integer

The number of users who have liked this task.

num_subtasks

integer

Opt In. The number of subtasks on this task.

start_at

date-time | null

Date and time on which work begins for the task, or null if the task has no start time. This takes an ISO 8601 date string in UTC and should not be used together with start_on. Note: due_at must be present in the request when setting or unsetting the start_at parameter.

start_on

date | null

The day on which work begins for the task , or null if the task has no start date. This takes a date with YYYY-MM-DD format and should not be used together with start_at. Note: due_on or due_at must be present in the request when setting or unsetting the start_on parameter.

actual_time_minutes

number | null

Full object requires scope:time_tracking_entries:read

This value represents the sum of all the Time Tracking entries in the Actual Time field on a given Task. It is represented as a nullable long value.

assignee

object | null

A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

assignee object | null

assignee_section

object

The assignee section is a subdivision of a project that groups tasks together in the assignee's "My tasks" list. It can either be a header above a list of tasks in a list view or a column in a board view of "My tasks." The assignee_section property will be returned in the response only if the request was sent by the user who is the assignee of the task. Note that you can only write to assignee_section with the gid of an existing section visible in the user's "My tasks" list.

assignee_section object

custom_fields

array of objects

Array of custom field values applied to the task. These represent the custom field values recorded on this project for a particular custom field. For example, these custom field values will contain an enum_value property for custom fields of type enum, a text_value property for custom fields of type text, and so on. Please note that the gid returned on each custom field value is identical to the gid of the custom field, which allows referencing the custom field metadata through the /custom_fields/custom_field_gid endpoint.

custom_fields

object

Custom Fields store the metadata that is used in order to add user-specified information to tasks in Asana. Be sure to reference the custom fields developer documentation for more information about how custom fields relate to various resources in Asana.

Users in Asana can lock custom fields, which will make them read-only when accessed by other users. Attempting to edit a locked custom field will return HTTP error code 403 Forbidden.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

The name of the custom field.

type

string

enum

Deprecated: new integrations should prefer the resource_subtype field. The type of the custom field. Must be one of the given values.

text``enum``multi_enum``number``date``people

enum_options

array of objects

Conditional. Only relevant for custom fields of type enum or multi_enum. This array specifies the possible values which an enum custom field can adopt. To modify the enum options, refer to working with enum options.

enum_options

object

Enum options are the possible values which an enum custom field can adopt. An enum custom field must contain at least 1 enum option but no more than 500.

You can add enum options to a custom field by using the POST /custom_fields/custom_field_gid/enum_options endpoint.

It is not possible to remove or delete an enum option. Instead, enum options can be disabled by updating the enabled field to false with the PUT /enum_options/enum_option_gid endpoint. Other attributes can be updated similarly.

On creation of an enum option, enabled is always set to true, meaning the enum option is a selectable value for the custom field. Setting enabled=false is equivalent to “trashing” the enum option in the Asana web app within the “Edit Fields” dialog. The enum option will no longer be selectable but, if the enum option value was previously set within a task, the task will retain the value.

Enum options are an ordered list and by default new enum options are inserted at the end. Ordering in relation to existing enum options can be specified on creation by using insert_before or insert_after to reference an existing enum option. Only one of insert_before and insert_after can be provided when creating a new enum option.

An enum options list can be reordered with the POST /custom_fields/custom_field_gid/enum_options/insert endpoint.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

The name of the enum option.

enabled

boolean

Whether or not the enum option is a selectable value for the custom field.

color

string

The color of the enum option. Defaults to none.

enabled

boolean

Conditional. This field applies only to custom field values and is not available for custom field definitions. Determines if the custom field is enabled or not. For more details, see the Custom Fields documentation.

representation_type

string

enum

This field tells the type of the custom field.

text``enum``multi_enum``number``date``people``formula``custom_id``reference

text``enum``multi_enum``number``date``people``formula``custom_id

id_prefix

string | null

This field is the unique custom ID string for the custom field.

input_restrictions

array of strings

Conditional. Only relevant for custom fields of type reference. This array of strings reflects the allowed types of objects that can be written to a reference custom field value.

is_formula_field

boolean

Conditional. This flag describes whether a custom field is a formula custom field.

date_value

object | null

Conditional. Only relevant for custom fields of type date. This object reflects the chosen date (and optionally, time) value of a date custom field. If no date is selected, the value of date_value will be null.

date_value object | null

enum_value

object

Conditional. Only relevant for custom fields of type enum. This object is the chosen value of an enum custom field.

enum_value object

multi_enum_values

array of objects

Conditional. Only relevant for custom fields of type multi_enum. This object is the chosen values of a multi_enum custom field.

multi_enum_values

object

Enum options are the possible values which an enum custom field can adopt. An enum custom field must contain at least 1 enum option but no more than 500.

You can add enum options to a custom field by using the POST /custom_fields/custom_field_gid/enum_options endpoint.

It is not possible to remove or delete an enum option. Instead, enum options can be disabled by updating the enabled field to false with the PUT /enum_options/enum_option_gid endpoint. Other attributes can be updated similarly.

On creation of an enum option, enabled is always set to true, meaning the enum option is a selectable value for the custom field. Setting enabled=false is equivalent to “trashing” the enum option in the Asana web app within the “Edit Fields” dialog. The enum option will no longer be selectable but, if the enum option value was previously set within a task, the task will retain the value.

Enum options are an ordered list and by default new enum options are inserted at the end. Ordering in relation to existing enum options can be specified on creation by using insert_before or insert_after to reference an existing enum option. Only one of insert_before and insert_after can be provided when creating a new enum option.

An enum options list can be reordered with the POST /custom_fields/custom_field_gid/enum_options/insert endpoint.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

The name of the enum option.

enabled

boolean

Whether or not the enum option is a selectable value for the custom field.

color

string

The color of the enum option. Defaults to none.

number_value

number | null

Conditional. This number is the value of a number custom field.

text_value

string | null

Conditional. This string is the value of a text custom field.

display_value

string | null

A string representation for the value of the custom field. Integrations that don't require the underlying type should use this field to read values. Using this field will future-proof an app against new custom field types.

description

string

Opt In. The description of the custom field.

precision

integer

Only relevant for custom fields of type Number. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive. For percentage format, this may be unintuitive, as a value of 0.25 has a precision of 0, while a value of 0.251 has a precision of 1. This is due to 0.25 being displayed as 25%. The identifier format will always have a precision of 0.

format

string

enum

The format of this custom field.

currency``identifier``percentage``custom``duration``none

currency_code

string | null

ISO 4217 currency code to format this custom field. This will be null if the format is not currency.

custom_label

string | null

This is the string that appears next to the custom field value. This will be null if the format is not custom.

custom_label_position

string | null

enum

Only relevant for custom fields with custom format. This depicts where to place the custom label. This will be null if the format is not custom.

prefix``suffix``null

is_global_to_workspace

boolean

This flag describes whether this custom field is available to every container in the workspace. Before project-specific custom fields, this field was always true.

has_notifications_enabled

boolean

Conditional. This flag describes whether a follower of a task with this field should receive inbox notifications from changes to this field.

asana_created_field

string | null

enum

Conditional. A unique identifier to associate this field with the template source of truth.

a_v_requirements``account_name``actionable``align_shipping_link``align_status``allotted_time``appointment``approval_stage``approved``article_series``board_committee``browser``campaign_audience``campaign_project_status``campaign_regions``channel_primary``client_topic_type``complete_by``contact``contact_email_address``content_channels``content_channels_needed``content_stage``content_type``contract``contract_status``cost``creation_stage``creative_channel``creative_needed``creative_needs``data_sensitivity``deal_size``delivery_appt``delivery_appt_date``department``department_responsible``design_request_needed``design_request_type``discussion_category``do_this_task``editorial_content_status``editorial_content_tag``editorial_content_type``effort``effort_level``est_completion_date``estimated_time``estimated_value``expected_cost``external_steps_needed``favorite_idea``feedback_type``financial``funding_amount``grant_application_process``hiring_candidate_status``idea_status``ids_link``ids_patient_link``implementation_stage``insurance``interview_area``interview_question_score``itero_scan_link``job_s_applied_to``lab``launch_status``lead_status``localization_language``localization_market_team``localization_status``meeting_minutes``meeting_needed``minutes``mrr``must_localize``name_of_foundation``need_to_follow_up``next_appointment``next_steps_sales``num_people``number_of_user_reports``office_location``onboarding_activity``owner``participants_needed``patient_date_of_birth``patient_email``patient_phone``patient_status``phone_number``planning_category``point_of_contact``position``post_format``prescription``priority``priority_level``product``product_stage``progress``project_size``project_status``proposed_budget``publish_status``reason_for_scan``referral``request_type``research_status``responsible_department``responsible_team``risk_assessment_status``room_name``sales_counterpart``sentiment``shipping_link``social_channels``stage``status``status_design``status_of_initiative``system_setup``task_progress``team``team_marketing``team_responsible``time_it_takes_to_complete_tasks``timeframe``treatment_type``type_work_requests_it``use_agency``user_name``vendor_category``vendor_type``word_count``null

is_value_read_only

boolean

Conditional. This flag describes whether a custom field is read only.

created_by

object | null

A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

created_by object | null

people_value

array of objects

Conditional. Only relevant for custom fields of type people. This array of compact user objects reflects the values of a people custom field.

people_value

object

A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

Read-only except when same user as requester. The user's name.

reference_value

array of objects

Conditional. Only relevant for custom fields of type reference. This array of objects reflects the values of a reference custom field.

reference_value

object

A generic Asana Resource, containing a globally unique identifier.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

The name of the object.

html_text_value

string | null

Conditional. Only relevant for custom fields of type text. This is the HTML representation of the text value of a custom field, corresponding to the text_value plain-text field.

privacy_setting

string

enum

The privacy setting of the custom field. Note: Administrators in your organization may restrict the values of privacy_setting.

public_with_guests``public``private

default_access_level

string

enum

The default access level when inviting new members to the custom field. This isn't applied when the privacy_setting is private, or the user is a guest. For local fields in a project or portfolio, the user must additionally have permission to modify the container itself.

admin``editor``user

resource_subtype

string

enum

The type of the custom field. Must be one of the given values.

text``enum``multi_enum``number``date``people``reference

custom_type

object | null

Custom Types extend the types of Asana Objects, currently only Custom Tasks are supported.

custom_type object | null

custom_type_status_option

object | null

A generic Asana Resource, containing a globally unique identifier.

custom_type_status_option object | null

followers

array of objects

Array of users following this task.

followers

object

A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

Read-only except when same user as requester. The user's name.

parent

object

The parent of this task, or null if this is not a subtask. This property cannot be modified using a PUT request but you can change it with the setParent endpoint. You can create subtasks by using the subtasks endpoint.

parent object

projects

array of objects

Create-only. Array of projects this task is associated with. At task creation time, this array can be used to add the task to many projects at once. After task creation, these associations can be modified using the addProject and removeProject endpoints.

projects

object

A project represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

Name of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.

tags

array of objects

Array of tags associated with this task. In order to change tags on an existing task use addTag and removeTag.

tags

object

A tag is a label that can be attached to any task in Asana. It exists in a single workspace or organization.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

name

string

Name of the tag. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.

workspace

object

Create-only. The workspace this task is associated with. Once created, task cannot be moved to a different workspace. This attribute can only be specified at creation time.

workspace object

permalink_url

string

A url that points directly to the object within Asana.

``400 This usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.

``401 A valid authentication token was not provided with the request, so the API could not associate a user with the request.

``403 The authentication and request syntax was valid but the server is refusing to complete the request. This can happen if you try to read or write to objects or properties that the user does not have access to.

``404 Either the request method and path supplied do not specify a known action in the API, or the object specified by the request does not exist.

``500 There was a problem on Asana’s end. In the event of a server error the response body should contain an error phrase. These phrases can be used by Asana support to quickly look up the incident that caused the server error. Some errors are due to server load, and will not supply an error phrase.

Updated 28 days ago


Did this page help you?

Yes

No

ShellNodeRubyPHPPython


xxxxxxxxxx

curl --request POST \

     --url https://app.asana.com/api/1.0/tasks \

     --header 'accept: application/json' \

     --header 'content-type: application/json'

xxxxxxxxxx

{

  "data": {

    "gid": "12345",

    "resource_type": "task",

    "name": "Bug Task",

    "resource_subtype": "default_task",

    "created_by": {

      "gid": "1111",

      "resource_type": "user"

    }

  }

}

Updated28 days ago


Did this page help you?

Yes

No