Skip to main content

Insights

POST Load projects' data trends​

https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/data_trends/projects

Returns the projects' data trends projects from a workspace.

curl -X POST https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/data_trends/projects \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","start_date":"string"}' \
-u <email>:<password>

Parameters​

Path​

nametyperequireddescription
workspace_idintegertrueWorkspace ID

Body​

nametypedescription
billablebooleanWhether the project is set as billable, optional, premium feature.
end_datestringEnd date, example time.DateOnly. Should be greater than Start date.
previous_period_startstringPrevious start date, example time.DateOnly.
project_idsArray of integerProject IDs, optional.
roundingintegerRounding, optional, duration rounding settings, premium feature.
rounding_minutesintegerRoundingMinutes, optional, duration rounding minutes settings, premium feature.
start_datestringStart date, example time.DateOnly. Should be less than End date.

Response​

200​

Returns filtered projects

Array of:

nametypedescription
current_period_secondsArray of integer-
previous_period_secondsArray of integer-
project_idinteger-
startstring-
user_idsArray of integer-

400​

Possible error messages:

* At least one parameter must be set
* Invalid workspace id
* Wrong format date

402​

Workspace needs to have the {feature} feature enabled

403​

Possible error messages:

* Workspace not found/accessible
* Admin permissions required

500​

Internal Server Error

POST Export employee profitability insights​

https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension}

Downloads employee profitability insights in the specified format: csv or xlsx.

curl -X POST https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension} \
-H "Content-Type: application/json" \
-d '{"currency":"string","end_date":"string","group_ids":"string","resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","user_ids":"string"}' \
-u <email>:<password>

Parameters​

Body​

nametypedescription
currencystring-
end_datestring-
group_idsstring-
resolutionstring-
roundinginteger-
rounding_minutesinteger-
start_datestring-
user_idsstring-

Response​

200​

A stream with the csv or xlsx for the report being exported

400​

Invalid parameters

403​

User has no access to workspace or is not admin

500​

Internal Server Error

POST Export profitability project insights​

https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension}

Downloads profitability project insights in the specified format: csv or xlsx.

curl -X POST https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension} \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","client_ids":["integer"],"currency":"string","end_date":"string","project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string"}' \
-u <email>:<password>

Parameters​

Path​

nametyperequireddescription
extensionstringtruecsv,xlsx

Body​

nametypedescription
billablebooleanWhether the project is set as billable, optional, premium feature.
client_idsArray of integerClient IDs, optional. A nil entry on this list means that only projects without client will be selected.
currencystringCurrency, example: "usd".
end_datestringEnd date, optional, example: time.DateOnly. Should be greater than Start date.
project_idsArray of integerProject IDS, optional.
resolutionstringResolution, optional. Can be "day", "week" or "month".
roundingintegerRounding, optional, duration rounding settings, premium feature.
rounding_minutesintegerRoundingMinutes, optional, duration rounding minutes settings, premium feature.
start_datestringStart date, optional, example: time.DateOnly. Should be less than End date.

Response​

200​

A stream with the csv or xlsx for the report being exported

400​

Possible error messages:

* Invalid parameters
* Invalid workspace ID

403​

User has no access to workspace or is not admin

500​

Internal Server Error

POST Export projects data trends​

https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}

Downloads projects data trends in the specified format: csv or xlsx.

curl -X POST https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension} \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","start_date":"string"}' \
-u <email>:<password>

Parameters​

Path​

nametyperequireddescription
workspace_idintegertrueWorkspace ID
extensionstringtruecsv,xlsx

Body​

nametypedescription
billablebooleanWhether the project is set as billable, optional, premium feature.
end_datestringEnd date, example time.DateOnly. Should be greater than Start date.
previous_period_startstringPrevious start date, example time.DateOnly.
project_idsArray of integerProject IDs, optional.
roundingintegerRounding, optional, duration rounding settings, premium feature.
rounding_minutesintegerRoundingMinutes, optional, duration rounding minutes settings, premium feature.
start_datestringStart date, example time.DateOnly. Should be less than End date.

Response​

200​

Returns data projects data trends

Array of:

nametypedescription
current_period_secondsArray of integer-
previous_period_secondsArray of integer-
project_idinteger-
startstring-
user_idsArray of integer-

400​

Possible error messages:

* At least one parameter must be set
* Invalid workspace id
* wrong format date
* start should come after end

403​

Possible error messages:

* Workspace not found/accessible"
* user has no required access to asked workspace

500​

Internal Server Error
© 2024 Toggl. All rights reserved.