Create a time tracking entry
Creates a time tracking entry on a given task.
Returns the record of the newly created time tracking entry.
Access requirements
Access to this endpoint has two levels:
-
Endpoint access requires time tracking to be available through the domain's plan or add-ons. A request from a domain without time tracking access returns a 402 Payment Required error for every request to this endpoint.
-
Field access for some request fields requires the Timesheets and Budgets add-on. Fields with this requirement are noted in the request schema. Including one of these fields without the add-on returns a 402 Payment Required error, even when the rest of the request is valid.
Because the field-level requirement is separate, the same endpoint may return 201 or 402 for the same domain depending on which fields are sent: a request that only uses fields available with endpoint access succeeds on any domain that meets the endpoint requirement, while a request that includes a field requiring the add-on also requires the add-on.
Request
- Base URL: https://app.asana.com/api/1.0
- URL: https://app.asana.com/api/1.0/tasks/{task_gid}/time_tracking_entries
- Auth: one of:
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://app.asana.com/-/oauth_authorize, token URL https://app.asana.com/-/oauth_token)
Query parameters
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.
Request body
Example request
{
"data": {
"duration_minutes": 12,
"entered_on": "2023-03-19",
"attributable_to": "987654",
"assignee": "12345",
"billable_status": "billable",
"description": "My description of work done on this entry",
"categories": [
"12345"
]
}
}Response
Successfully created a time tracking entry for the task.
Example response
{
"data": {
"gid": "12345",
"resource_type": "time_tracking_entry",
"duration_minutes": 12,
"entered_on": "2015-03-14",
"attributable_to": {
"gid": "12345",
"resource_type": "project",
"name": "Stuff to buy",
"resource_subtype": "default_project"
},
"assignee": {
"gid": "12345",
"resource_type": "user",
"name": "Greg Sanchez"
},
"created_by": {
"gid": "12345",
"resource_type": "user",
"name": "Greg Sanchez"
},
"categories": [
{
"gid": "12345",
"resource_type": "time_tracking_category",
"name": "Development",
"color": "blue"
}
],
"task": {
"gid": "12345",
"resource_type": "task",
"name": "Bug Task",
"resource_subtype": "default_task",
"created_by": {
"gid": "1111",
"resource_type": "user"
}
},
"created_at": "2012-02-22T02:06:58.147Z",
"approval_status": "DRAFT",
"billable_status": "billable",
"description": "My description of work done on this entry"
}
}Changes
No recorded changes to this operation across all 2 revisions of this API.