{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"<b>Required scope: </b><code>tasks:write</code>\n\nCreates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask.","properties":{"path":{"type":"object","properties":{"task_gid":{"type":"string","examples":["321654"],"description":"The task to operate on."}},"required":["task_gid"],"additionalProperties":false},"query":{"type":"object","properties":{"opt_pretty":{"type":"boolean","examples":[true],"description":"Provides “pretty” output.\nProvides 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."},"opt_fields":{"type":"array","items":{"type":"string","enum":["actual_time_minutes","approval_status","assigned_by","assigned_by.name","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.default_access_level","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.html_text_value","custom_fields.id_prefix","custom_fields.input_restrictions","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_lookup_field","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.privacy_setting","custom_fields.reference_value","custom_fields.reference_value.name","custom_fields.representation_type","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","custom_type","custom_type.asana_created_type_identifier","custom_type.name","custom_type_status_option","custom_type_status_option.name","dependencies","dependents","due_at","due_on","effective_memberships","external","external.data","followers","followers.name","has_subtasks_date_mismatch","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.project.resource_subtype","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","projects.resource_subtype","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"]},"examples":[["actual_time_minutes","approval_status","assigned_by","assigned_by.name","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.default_access_level","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.html_text_value","custom_fields.id_prefix","custom_fields.input_restrictions","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_lookup_field","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.privacy_setting","custom_fields.reference_value","custom_fields.reference_value.name","custom_fields.representation_type","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","custom_type","custom_type.asana_created_type_identifier","custom_type.name","custom_type_status_option","custom_type_status_option.name","dependencies","dependents","due_at","due_on","effective_memberships","external","external.data","followers","followers.name","has_subtasks_date_mismatch","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.project.resource_subtype","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","projects.resource_subtype","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"]],"description":"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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields)."}},"required":[],"additionalProperties":false},"body":{"type":"object","properties":{"data":{"$ref":"#/definitions/TaskCreateRequest"}}}},"required":["path","body"],"additionalProperties":false,"definitions":{"TaskCreateRequest":{"allOf":[{"$ref":"#/definitions/TaskRequestBase"},{"type":"object","properties":{"followers":{"type":"array","description":"*Create-Only* An array of strings identifying users. These can either be the string \"me\", an email, or the gid of a user. In order to change followers on an existing task use `addFollowers` and `removeFollowers`.","items":{"type":"string","description":"A string identifying a user. This can either be the string \"me\", an email, or the gid of a user."},"examples":[["12345"]]},"projects":{"type":"array","description":"*Create-Only* Array of project gids. In order to change projects on an existing task use `addProject` and `removeProject`.","items":{"type":"string","description":"Gid of a project."},"examples":[["12345"]]},"tags":{"type":"array","description":"*Create-Only* Array of tag gids. In order to change tags on an existing task use `addTag` and `removeTag`.","items":{"type":"string","description":"Gid of a tag."},"examples":[["12345"]]},"workspace":{"type":"string","description":"Gid of a workspace.","examples":["12345"]}}}]},"TaskRequestBase":{"allOf":[{"$ref":"#/definitions/TaskBase"},{"type":"object","properties":{"assignee":{"type":["string","null"],"description":"A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.","examples":["12345"]},"assignee_section":{"type":["string","null"],"description":"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.\"\nThe `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.","examples":["12345"]},"custom_fields":{"description":"An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, object, or array (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values.","type":"object","additionalProperties":{"type":"string","description":"\"{custom_field_gid}\" => Value (can be text, a number, etc.). For date, use format \"YYYY-MM-DD\" (e.g., 2019-09-15). For date-time, use ISO 8601 date string in UTC (e.g., 2019-09-15T02:06:58.147Z)."},"examples":[{"5678904321":"On Hold","4578152156":"Not Started"}]},"custom_type":{"type":["string","null"],"description":"*Conditional:* You can only set custom_type if task `resource_subtype` is `custom`. GID or globally-unique identifier of a task's custom type. The type must be valid for tasks, and some Asana-created custom types cannot be assigned via the API; attempting either returns an error explaining which condition failed.","examples":["12345"]},"custom_type_status_option":{"type":["string","null"],"description":"*Conditional:* You can only set custom_type_status_option if task `resource_subtype` is `custom` GID or globally-unique identifier of a custom type's status option.","examples":["12345"]},"html_custom_fields":{"description":"An object where each key is the GID of a text custom field and the corresponding value is a rich text HTML string. Only text-type custom fields support this parameter. Values must be wrapped in <body></body> tags. See the [custom fields guide](/docs/custom-fields-guide) and [rich text](/docs/rich-text) for details on supported formatting.","type":"object","additionalProperties":{"type":"string","description":"\"{custom_field_gid}\" => HTML string (e.g., \"<body>Text content</body>\")"},"examples":[{"5678904321":"<body><strong>Bold text</strong></body>","4578152156":"<body><code>Code block</code></body>"}]},"parent":{"type":["string","null"],"description":"Gid of a task.","examples":["12345"]}}}]},"TaskBase":{"allOf":[{"$ref":"#/definitions/TaskCompact"},{"type":"object","properties":{"approval_status":{"type":"string","description":"*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`.","enum":["pending","approved","rejected","changes_requested"],"examples":["pending"]},"assignee_status":{"description":"*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.","type":"string","enum":["today","upcoming","later","new","inbox"],"examples":["upcoming"]},"assigned_by":{"allOf":[{"$ref":"#/definitions/UserCompact"},{"description":"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)."}]},"completed":{"description":"True if the task is currently marked complete, false if not.","type":"boolean","examples":[false]},"completed_by":{"allOf":[{"$ref":"#/definitions/UserCompact"},{}]},"due_at":{"description":"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`.","type":["string","null"],"format":"date-time","examples":["2019-09-15T02:06:58.147Z"]},"due_on":{"description":"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`.","type":["string","null"],"format":"date","examples":["2019-09-15"]},"external":{"description":"*OAuth Required*. *Conditional*. This field is returned only if external values are set or included by using [Opt In](/docs/inputoutput-options).\nThe 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.","type":"object","properties":{"gid":{"type":"string","examples":["1234"]},"data":{"type":"string","examples":["A blob of information."]}},"examples":[{"gid":"my_gid","data":"A blob of information"}]},"html_notes":{"description":"[Opt In](/docs/inputoutput-options). The notes of the text with formatting as HTML. See [rich text](/docs/rich-text).","type":"string","examples":["<body>Mittens <em>really</em> likes the stuff from Humboldt.</body>"]},"liked":{"description":"True if the task is liked by the authorized user, false if not.","type":"boolean","examples":[true]},"name":{"description":"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.","type":"string","examples":["Buy catnip"]},"notes":{"description":"Free-form textual information associated with the task (i.e. its description).","type":"string","examples":["Mittens really likes the stuff from Humboldt."]},"start_at":{"description":"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`.\n*Note: `due_at` must be present in the request when setting or unsetting the `start_at` parameter.*","type":["string","null"],"format":"date-time","examples":["2019-09-14T02:06:58.147Z"]},"start_on":{"description":"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`.\n*Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter.*","type":["string","null"],"format":"date","examples":["2019-09-14"]}}}]},"TaskCompact":{"description":"The *task* is the basic object around which many operations in Asana are centered.","type":"object","properties":{"name":{"description":"The name of the task.","type":"string","examples":["Bug Task"]},"resource_subtype":{"type":"string","description":"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.\nThe resource_subtype `milestone` represent a single moment in time. This means tasks with this subtype cannot have a start_date.","enum":["default_task","milestone","approval","custom"],"examples":["default_task"]}}},"UserCompact":{"description":"A *user* object represents an account in Asana that can be given access to various workspaces, projects, and tasks.","type":"object","properties":{"name":{"type":"string","description":"*Read-only except when same user as requester*. The user's name.","examples":["Greg Sanchez"]}}}}},"name":"Create a subtask","id":"asana.createsubtaskfortask","example":{"path":{"task_gid":"321654"},"body":{}},"maxRequests":1,"summary":false}}