Skip to main content

Time entries

GET TimeEntries

https://api.track.toggl.com/api/v9/me/time_entries

Lists latest time entries.

curl  https://api.track.toggl.com/api/v9/me/time_entries \
-H "Content-Type: application/json" \
-u <email>:<password>

Parameters

Query

nametyperequireddescription
beforestringfalsebefore
sincestringfalsesince
start_datestringfalsestart date
end_datestringfalseend date

Response

[
{
"at": {
"type": "string"
},
"billable": {
"type": "boolean"
},
"description": {
"type": "string"
},
"duration": {
"description": "DurationInSeconds for running entries should be -1 * (Unix start time).",
"type": "integer"
},
"duronly": {
"type": "boolean"
},
"id": {
"type": "integer"
},
"pid": {
"type": "integer"
},
"project_id": {
"type": "integer"
},
"server_deleted_at": {
"type": "string"
},
"start": {
"type": "string"
},
"stop": {
"type": "string"
},
"tag_ids": {
"description": "tag IDs parsed into this, after select",
"type": [
"integer"
]
},
"tags": {
"description": "tag names parsed into this, after select",
"type": [
"string"
]
},
"task_id": {
"type": "integer"
},
"tid": {
"type": "integer"
},
"uid": {
"description": "Ideally we'd want object_id type things, but for usual reasons we need to keep both around, so, that's that",
"type": "integer"
},
"user_id": {
"type": "integer"
},
"wid": {
"type": "integer"
},
"workspace_id": {
"type": "integer"
}
}
]

GET Get current time entry

https://api.track.toggl.com/api/v9/me/time_entries/current

Load running time entry for user ID.

curl  https://api.track.toggl.com/api/v9/me/time_entries/current \
-H "Content-Type: application/json" \
-u <email>:<password>

Response

{
"at": {
"type": "string"
},
"billable": {
"type": "boolean"
},
"description": {
"type": "string"
},
"duration": {
"description": "DurationInSeconds for running entries should be -1 * (Unix start time).",
"type": "integer"
},
"duronly": {
"type": "boolean"
},
"id": {
"type": "integer"
},
"pid": {
"type": "integer"
},
"project_id": {
"type": "integer"
},
"server_deleted_at": {
"type": "string"
},
"start": {
"type": "string"
},
"stop": {
"type": "string"
},
"tag_ids": {
"description": "tag IDs parsed into this, after select",
"type": [
"integer"
]
},
"tags": {
"description": "tag names parsed into this, after select",
"type": [
"string"
]
},
"task_id": {
"type": "integer"
},
"tid": {
"type": "integer"
},
"uid": {
"description": "Ideally we'd want object_id type things, but for usual reasons we need to keep both around, so, that's that",
"type": "integer"
},
"user_id": {
"type": "integer"
},
"wid": {
"type": "integer"
},
"workspace_id": {
"type": "integer"
}
}

POST TimeEntries

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries

Creates a new workspace TimeEntry.

curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","created_with":"string","description":"string","duration":"integer","duronly":"boolean","pid":"integer","postedFields":["string"],"project_id":"integer","start":"string","start_date":"string","stop":"string","tag_action":"string","tag_ids":["integer"],"tags":["string"],"task_id":"integer","tid":"integer","uid":"integer","user_id":"integer","wid":"integer","workspace_id":"integer"}' \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace

Body

nametypedescription
billableboolean-
created_withstring-
descriptionstring-
durationinteger-
duronlyboolean-
pidinteger-
postedFieldsArray of string-
project_idinteger-
startstring-
start_datestring-
stopstring-
tag_actionstring-
tag_idsArray of integer-
tagsArray of string-
task_idinteger-
tidinteger-
uidinteger-
user_idinteger-
widinteger-
workspace_idinteger-

Response

{
"at": {
"type": "string"
},
"billable": {
"type": "boolean"
},
"description": {
"type": "string"
},
"duration": {
"description": "DurationInSeconds for running entries should be -1 * (Unix start time).",
"type": "integer"
},
"duronly": {
"type": "boolean"
},
"id": {
"type": "integer"
},
"pid": {
"type": "integer"
},
"project_id": {
"type": "integer"
},
"server_deleted_at": {
"type": "string"
},
"start": {
"type": "string"
},
"stop": {
"type": "string"
},
"tag_ids": {
"description": "tag IDs parsed into this, after select",
"type": [
"integer"
]
},
"tags": {
"description": "tag names parsed into this, after select",
"type": [
"string"
]
},
"task_id": {
"type": "integer"
},
"tid": {
"type": "integer"
},
"uid": {
"description": "Ideally we'd want object_id type things, but for usual reasons we need to keep both around, so, that's that",
"type": "integer"
},
"user_id": {
"type": "integer"
},
"wid": {
"type": "integer"
},
"workspace_id": {
"type": "integer"
}
}

PATCH Bulk editing time entries

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries/{time_entry_ids}

In short: http://tools.ietf.org/html/rfc6902 and http://tools.ietf.org/html/rfc6901 with some additions. Patch will be executed partially when there are errors with some records. No transaction, no rollback.

curl -X PATCH https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries/{time_entry_ids} \
-H "Content-Type: application/json" \
-d '{"array":[{"op":{"type":"string"},"path":{"type":"string"}}]}' \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
time_entry_idsstringtrueNumeric IDs of time_entries, separated by comma. E.g.: 204301830,202700150,202687559

Body

nametypedescription
arrayArray of
nametypedescription
opstring-
pathstring-
Array of batch operations

Response

{
"failure": {
"items": [
{
"id": {
"type": "integer"
},
"message": {
"type": "string"
}
}
]
},
"success": {
"type": [
"integer"
]
}
}

PUT TimeEntries

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries/{time_entry_id}

Updates a workspace time entry.

curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries/{time_entry_id} \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","created_with":"string","description":"string","duration":"integer","duronly":"boolean","pid":"integer","postedFields":["string"],"project_id":"integer","start":"string","start_date":"string","stop":"string","tag_action":"string","tag_ids":["integer"],"tags":["string"],"task_id":"integer","tid":"integer","uid":"integer","user_id":"integer","wid":"integer","workspace_id":"integer"}' \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
time_entry_idintegertrueTimeEntry ID.

Body

nametypedescription
billableboolean-
created_withstring-
descriptionstring-
durationinteger-
duronlyboolean-
pidinteger-
postedFieldsArray of string-
project_idinteger-
startstring-
start_datestring-
stopstring-
tag_actionstring-
tag_idsArray of integer-
tagsArray of string-
task_idinteger-
tidinteger-
uidinteger-
user_idinteger-
widinteger-
workspace_idinteger-

Response

{
"at": {
"type": "string"
},
"billable": {
"type": "boolean"
},
"description": {
"type": "string"
},
"duration": {
"description": "DurationInSeconds for running entries should be -1 * (Unix start time).",
"type": "integer"
},
"duronly": {
"type": "boolean"
},
"id": {
"type": "integer"
},
"pid": {
"type": "integer"
},
"project_id": {
"type": "integer"
},
"server_deleted_at": {
"type": "string"
},
"start": {
"type": "string"
},
"stop": {
"type": "string"
},
"tag_ids": {
"description": "tag IDs parsed into this, after select",
"type": [
"integer"
]
},
"tags": {
"description": "tag names parsed into this, after select",
"type": [
"string"
]
},
"task_id": {
"type": "integer"
},
"tid": {
"type": "integer"
},
"uid": {
"description": "Ideally we'd want object_id type things, but for usual reasons we need to keep both around, so, that's that",
"type": "integer"
},
"user_id": {
"type": "integer"
},
"wid": {
"type": "integer"
},
"workspace_id": {
"type": "integer"
}
}

DELETE TimeEntries

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries/{time_entry_id}

Deletes a workspace time entry.

curl -X DELETE https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries/{time_entry_id} \
-H "Content-Type: application/json" \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
time_entry_idintegertrueTimeEntry ID.

Response

Returns only status code.

PATCH TimeEntries

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries/{time_entry_id}/stop

Stops a workspace time entry.

curl -X PATCH https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entries/{time_entry_id}/stop \
-H "Content-Type: application/json" \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
time_entry_idintegertrueTimeEntry ID.

Response

{
"at": {
"type": "string"
},
"billable": {
"type": "boolean"
},
"description": {
"type": "string"
},
"duration": {
"description": "DurationInSeconds for running entries should be -1 * (Unix start time).",
"type": "integer"
},
"duronly": {
"type": "boolean"
},
"id": {
"type": "integer"
},
"pid": {
"type": "integer"
},
"project_id": {
"type": "integer"
},
"server_deleted_at": {
"type": "string"
},
"start": {
"type": "string"
},
"stop": {
"type": "string"
},
"tag_ids": {
"description": "tag IDs parsed into this, after select",
"type": [
"integer"
]
},
"tags": {
"description": "tag names parsed into this, after select",
"type": [
"string"
]
},
"task_id": {
"type": "integer"
},
"tid": {
"type": "integer"
},
"uid": {
"description": "Ideally we'd want object_id type things, but for usual reasons we need to keep both around, so, that's that",
"type": "integer"
},
"user_id": {
"type": "integer"
},
"wid": {
"type": "integer"
},
"workspace_id": {
"type": "integer"
}
}
© 2022 Toggl. All rights reserved.