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

Create a time tracking entry

Creates a time tracking entry on a task. Supply duration_minutes and use entered_on, attributable_to, billable_status, description, or categories to provide additional entry details. Fields requiring the Timesheets and Budgets add-on return a premium-access error when that add-on is unavailable.

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

1 parameter · 1 body field
opt_fieldsarray<string>optional
A comma-separated list of properties to include in the response, including nested properties; accepted values include `approval_status`, `attributable_to`, `attributable_to.name`, `attributable_to.resource_subtype`, `billable_status`, `categories`, `categories.color`, `categories.name`, `created_at`, `created_by`, `created_by.name`, and `description`. Omit this parameter to use the default response fields.

Information for the time tracking entry to create.

dataobjectoptional
Object containing the time tracking entry details.

7 status codes
201Returns the newly created time tracking entry for the task.
dataobjectoptional
400Returned when a parameter or request value is missing or malformed.
errorsarray<object>optional
401Returned when a valid authentication token was not provided with the request.
errorsarray<object>optional
402Returned when time tracking is unavailable through the domain's plan or add-ons, or when a submitted field requires the Timesheets and Budgets add-on that the domain does not have.
errorsarray<object>optional
403Returned when the authenticated user does not have access to the requested objects or properties.
errorsarray<object>optional
404Returned when the request method and path do not specify a known action, or the specified object does not exist.
errorsarray<object>optional
500Returned when a server-side problem occurs; the response may include an error phrase for support diagnosis.
errorsarray<object>optional

Error handling

A 400 is returned when a parameter or request value is missing or malformed. A 401 is returned when a valid authentication token is not provided, a 402 is returned when time tracking or a submitted premium field is unavailable on the domain's plan, and a 403 is returned when the authenticated user lacks access. A 404 is returned when the task or specified object does not exist, while a 500 indicates a server-side problem. duration_minutes must be greater than 0, billable_status must be one of billable, nonBillable, or notApplicable, and categories can contain at most one category.