Sample - Asana API
POST/tasks/{task_gid}/duplicate

Duplicate a task

Creates a job that asynchronously duplicates a task and the selected related data. Supply the new task name and use include to select fields such as assignee, attachments, dates, dependencies, followers, notes, parent, projects, subtasks, or tags for duplication. The response confirms job creation; use the returned job record to monitor the asynchronous process.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 1 body field
opt_fieldsarray<string>optional
A comma-separated list of job properties to include in the response, including `new_graph_export`, `new_graph_export.completed_at`, `new_graph_export.created_at`, `new_graph_export.download_url`, `new_portfolio`, and `new_portfolio.name`, among others.

The duplication configuration, including the new task name and the related fields to duplicate.

dataobjectoptional
The duplication settings for the new task.

6 status codes
201Returns the created job object, including its identifier, status, and references to resources created by the duplication process.
dataobjectoptional
A *job* is an object representing a process that handles asynchronous work.
400Returned when a parameter is missing or malformed, including an invalid duplication configuration.
errorsarray<object>optional
401Returned when a valid authentication token was not provided.
errorsarray<object>optional
403Returned when the authenticated user does not have access to the task or duplication operation.
errorsarray<object>optional
404Returned when the request does not specify a known action or the specified task does not exist.
errorsarray<object>optional
500Returned when a server-side problem prevents the duplication job from being created.
errorsarray<object>optional

Error handling

A 400 is returned when the request is missing or malformed, including an invalid include value. A 401 is returned when you do not provide a valid authentication token, and a 403 is returned when the authenticated user lacks access to the task or duplication operation. A 404 indicates that the task does not exist or that the request path is not a known action; a 500 indicates a server-side failure. The request also requires the tasks:write scope.