Projects
August 13, 2020 ยท View on GitHub
Project has the following properties
- name: The name of the project (string, required, unique for client and workspace)
- wid: workspace ID, where the project will be saved (integer, required)
- cid: client ID (integer, not required)
- active: whether the project is archived or not (boolean, by default true)
- is_private: whether project is accessible for only project users or for all workspace users (boolean, default true)
- template: whether the project can be used as a template (boolean, not required)
- template_id: id of the template project used on current project's creation
- billable: whether the project is billable or not (boolean, default true, available only for pro workspaces)
- auto_estimates: whether the estimated hours are automatically calculated based on task estimations or manually fixed based on the value of 'estimated_hours' (boolean, default false, not required, premium functionality)
- estimated_hours: if auto_estimates is true then the sum of task estimations is returned, otherwise user inserted hours (integer, not required, premium functionality)
- at: timestamp that is sent in the response for PUT, indicates the time task was last updated (read-only)
- color: id of the color selected for the project
- rate: hourly rate of the project (float, not required, premium functionality)
- created_at: timestamp indicating when the project was created (UTC time), read-only
Create project
POST https://api.track.toggl.com/api/v8/projects
Example request
curl -v -u 1971800d4d82861d8f2c1651fea4d212:api_token \
-H "Content-Type: application/json" \
-d '{"project":{"name":"An awesome project","wid":777,"template_id":10237,"is_private":true,"cid":123397}}' \
-X POST https://api.track.toggl.com/api/v8/projects
Successful response
{
"data": {
"id":193838628,
"wid":777,
"cid":123397,
"name":"An awesome project",
"billable":false,
"is_private":true,
"active":true,
"at":"2013-03-06T12:15:37+00:00",
"template_id":10237,
"color": "5"
}
}
Get project data
GET https://api.track.toggl.com/api/v8/projects/{project_id}
Example request
curl -v -u 1971800d4d82861d8f2c1651fea4d212:api_token \
-X GET https://api.track.toggl.com/api/v8/projects/193838628
Successful response
{
"data": {
"id":193838628,
"wid":777,
"cid":123397,
"name":"An awesome project",
"billable":false,
"is_private":true,
"active":true,
"at":"2013-03-06T12:15:37+00:00",
"template":true,
"color": "5"
}
}
Update project data
PUT https://api.track.toggl.com/api/v8/projects/{project_id}
Example request
curl -v -u 1971800d4d82861d8f2c1651fea4d212:api_token \
-H "Content-Type: application/json" \
-d '{"project":{"name":"Changed the name","is_private":false,"cid":123398, "color": "6"}}' \
-X PUT https://api.track.toggl.com/api/v8/projects/193838628
Successful response
{
"data": {
"id":193838628,
"wid":777,
"cid":123398,
"name":"Changed the name",
"billable":false,
"active":true,
"at":"2013-03-06T12:15:37+00:00",
"template":true,
"color":"6"
}
}
Delete a project
DELETE https://api.track.toggl.com/api/v8/projects/{project_id}
Example request
curl -v -u 1971800d4d82861d8f2c1651fea4d212:api_token \
-X DELETE https://api.track.toggl.com/api/v8/projects/4692190
Get project users
GET https://api.track.toggl.com/api/v8/projects/{project_id}/project_users
Read more about project user fields from here.
Example request
curl -v -u 1971800d4d82861d8f2c1651fea4d212:api_token \
-X GET https://api.track.toggl.com/api/v8/projects/193838628/project_users
Successful response is an array of the project's users
[
{
"id":4692190,
"pid":777,
"uid":123,
"wid":99,
"manager":true,
"rate":4
},
{
"id":4692193,
"pid":777,
"uid":125,
"wid":99,
"manager":false,
"rate":4
}
]
Get project tasks
Available for Starter, Premium and Enterprise workspaces
GET https://api.track.toggl.com/api/v8/projects/{project_id}/tasks
Read more about task fields from here.
Example request
curl -v -u 1971800d4d82861d8f2c1651fea4d212:api_token \
-X GET https://api.track.toggl.com/api/v8/projects/777/tasks
Successful response is an array of the project's tasks
[
{
"name":"A new task",
"id":1335076912,
"wid":888,
"pid":777,
"active":false,
"at":"2013-02-26T15:09:52+00:00",
"estimated_seconds":3600
}, {
"name":"Another task",
"id":1335076911,
"uid": 12309,
"wid":888,
"pid":777,
"active":false,
"at":"2013-02-26T15:09:52+00:00"
}
]
Get workspace projects
Retrieving workspace projects is documented here.
Mass Actions
Delete multiple projects
By supplying multiple projectuser ids, you can mass delete projects.
DELETE https://api.track.toggl.com/api/v8/projects/{project_ids}
Example request
curl -v -u 1971800d4d82861d8f2c1651fea4d212:api_token \
-X DELETE https://api.track.toggl.com/api/v8/projects/4692190,4692192,4692193