Detailed reports
POST Search time entries
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries
Returns time entries for detailed report according to the given filters. Supports pagination via X-Next-ID and X-Next-Row-Number headers returned in the response. See Overview
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries \
-H "Content-Type: application/json" \
-d '\{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = "application/json"
req.body = \{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}.to_json
req.basic_auth '<email>', '<password>'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries", {
method: "POST",
body: \{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries', json=\{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new().basic_auth("<email>", "<password>");
let json = client.request(Method::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries".to_string())
.json(&serde_json::json!(\{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
Body
| Name | Type | Description |
|---|---|---|
| billable | boolean | Whether the time entry is set as billable, optional, premium feature. |
| client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. |
| description | string | Description, optional, filtering attribute. |
| end_date | string | End date, example time.DateOnly. Should be greater than Start date. Inclusive calendar date: the whole day is covered, evaluated in each time entry creator's own Toggl profile time zone (UTC when that user has none set). Entries are matched on their start, so an entry starting on End date is included even if it stops after it. |
| enrich_response | boolean | EnrichResponse, optional, default false. It will force the detailed report to return as much information as possible, as it does for the export. |
| first_id | integer | - |
| first_row_number | integer | - |
| first_timestamp | integer | - |
| group_ids | Array of integer | Group IDs, optional, filtering attribute. |
| grouped | boolean | Whether time entries should be grouped, optional, default false. |
| hide_amounts | boolean | Whether amounts should be hidden, optional, default false. |
| max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. |
| min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. |
| order_by | string | Order by field, optional, default "date". Can be "date", "user", "duration", "description" or "last_update". |
| order_dir | string | Order direction, optional. Can be ASC or DESC. |
| page_size | integer | PageSize defines the number of items per page, optional, default 50. |
| project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. |
| rounding | integer | Whether time should be rounded, optional, default from user preferences. |
| rounding_minutes | integer | Rounding minutes value, optional, default from user preferences. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. |
| start_date | string | Start date, example time.DateOnly. Should be less than End date. Inclusive calendar date: it is evaluated in each time entry creator's own Toggl profile time zone (UTC when that user has none set), not in the caller's or the workspace's time zone. |
| tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. |
| task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. |
| time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. |
| user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response
200
Returns grouped time entries for detailed report
400
Possible error messages:
- At least one parameter must be set
- Invalid workspace id
- Invalid '{parameter}' value, allowed values are: '{valid_values}'
402
Workspace needs to have this feature enabled
403
Workspace not found/accessible
500
Internal Server Error
POST Export detailed report
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf
Downloads detailed report in pdf format.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf \
-H "Content-Type: application/json" \
-d '\{"billable":"boolean","cents_separator":"string","client_ids":[\{\}],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"billable":"boolean","cents_separator":"string","client_ids":[\{\}],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = "application/json"
req.body = \{"billable":"boolean","cents_separator":"string","client_ids":[\{\}],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}.to_json
req.basic_auth '<email>', '<password>'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf", {
method: "POST",
body: \{"billable":"boolean","cents_separator":"string","client_ids":[\{\}],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf', json=\{"billable":"boolean","cents_separator":"string","client_ids":[\{\}],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new().basic_auth("<email>", "<password>");
let json = client.request(Method::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf".to_string())
.json(&serde_json::json!(\{"billable":"boolean","cents_separator":"string","client_ids":[\{\}],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
Body
| Name | Type | Description |
|---|---|---|
| billable | boolean | Whether the time entry is set as billable, optional, premium feature. |
| cents_separator | string | - |
| client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. |
| date_format | string | Valid values: MM/DD/YYYY, DD-MM-YYYY, MM-DD-YYYY, YYYY-MM-DD, DD/MM/YYYY, DD.MM.YYYY. |
| description | string | Description, optional, filtering attribute. |
| display_mode | string | - |
| duration_format | string | Duration format, optional, default "classic". Can be "classic", "decimal" or "improved". |
| end_date | string | End date, example time.DateOnly. Should be greater than Start date. Inclusive calendar date: the whole day is covered, evaluated in each time entry creator's own Toggl profile time zone (UTC when that user has none set). Entries are matched on their start, so an entry starting on End date is included even if it stops after it. |
| enrich_response | boolean | EnrichResponse, optional, default false. It will force the detailed report to return as much information as possible, as it does for the export. |
| first_id | integer | - |
| first_row_number | integer | - |
| first_timestamp | integer | - |
| group_ids | Array of integer | Group IDs, optional, filtering attribute. |
| grouped | boolean | Whether time entries should be grouped, optional, default false. |
| hide_amounts | boolean | Whether amounts should be hidden, optional, default false. |
| hour_format | string | - |
| max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. |
| min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. |
| order_by | string | Order by field, optional, default "date". Can be "date", "user", "duration", "description" or "last_update". |
| order_dir | string | Order direction, optional. Can be ASC or DESC. |
| page_size | integer | PageSize defines the number of items per page, optional, default 50. |
| project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. |
| rounding | integer | Whether time should be rounded, optional, default from user preferences. |
| rounding_minutes | integer | Rounding minutes value, optional, default from user preferences. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. |
| start_date | string | Start date, example time.DateOnly. Should be less than End date. Inclusive calendar date: it is evaluated in each time entry creator's own Toggl profile time zone (UTC when that user has none set), not in the caller's or the workspace's time zone. |
| tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. |
| task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. |
| time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. |
| user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response
200
Returns the detailed report in pdf format
400
Possible error messages:
- At least one parameter must be set
- Invalid workspace id
- Invalid '{parameter}' value, allowed values are: '{valid_values}'
402
Workspace needs to have this feature enabled
403
Workspace not found/accessible
500
Internal Server Error
POST Export detailed report
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}
Downloads detailed report in the specified format: csv or xlsx.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension} \
-H "Content-Type: application/json" \
-d '\{"billable":"boolean","client_ids":[\{\}],"description":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"billable":"boolean","client_ids":[\{\}],"description":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = "application/json"
req.body = \{"billable":"boolean","client_ids":[\{\}],"description":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}.to_json
req.basic_auth '<email>', '<password>'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}", {
method: "POST",
body: \{"billable":"boolean","client_ids":[\{\}],"description":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}', json=\{"billable":"boolean","client_ids":[\{\}],"description":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new().basic_auth("<email>", "<password>");
let json = client.request(Method::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}".to_string())
.json(&serde_json::json!(\{"billable":"boolean","client_ids":[\{\}],"description":"string","duration_format":"string","end_date":"string","enrich_response":"boolean","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":[\{\}],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","project_ids":[\{\}],"rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
| extension | string | true | csv,xlsx |
Body
| Name | Type | Description |
|---|---|---|
| billable | boolean | Whether the time entry is set as billable, optional, premium feature. |
| client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. |
| description | string | Description, optional, filtering attribute. |
| duration_format | string | Duration format, optional, default "classic". Can be "classic", "decimal" or "improved". |
| end_date | string | End date, example time.DateOnly. Should be greater than Start date. Inclusive calendar date: the whole day is covered, evaluated in each time entry creator's own Toggl profile time zone (UTC when that user has none set). Entries are matched on their start, so an entry starting on End date is included even if it stops after it. |
| enrich_response | boolean | EnrichResponse, optional, default false. It will force the detailed report to return as much information as possible, as it does for the export. |
| first_id | integer | - |
| first_row_number | integer | - |
| first_timestamp | integer | - |
| group_ids | Array of integer | Group IDs, optional, filtering attribute. |
| grouped | boolean | Whether time entries should be grouped, optional, default false. |
| hide_amounts | boolean | Whether amounts should be hidden, optional, default false. |
| max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. |
| min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. |
| order_by | string | Order by field, optional, default "date". Can be "date", "user", "duration", "description" or "last_update". |
| order_dir | string | Order direction, optional. Can be ASC or DESC. |
| page_size | integer | PageSize defines the number of items per page, optional, default 50. |
| project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. |
| rounding | integer | Whether time should be rounded, optional, default from user preferences. |
| rounding_minutes | integer | Rounding minutes value, optional, default from user preferences. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. |
| start_date | string | Start date, example time.DateOnly. Should be less than End date. Inclusive calendar date: it is evaluated in each time entry creator's own Toggl profile time zone (UTC when that user has none set), not in the caller's or the workspace's time zone. |
| tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. |
| task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. |
| time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. |
| user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response
200
Returns the detailed report in the specified format: csv or xlsx
400
Possible error messages:
- At least one parameter must be set
- Invalid workspace id
- Invalid '{parameter}' value, allowed values are: '{valid_values}'
402
Workspace needs to have this feature enabled
403
Workspace not found/accessible
500
Internal Server Error
POST Load totals detailed report
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries/totals
Returns totals sums for detailed report.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries/totals \
-H "Content-Type: application/json" \
-d '\{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","granularity":"string","group_ids":[\{\}],"grouped":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","project_ids":[\{\}],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}],"with_graph":"boolean"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","granularity":"string","group_ids":[\{\}],"grouped":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","project_ids":[\{\}],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}],"with_graph":"boolean"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries/totals", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries/totals')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = "application/json"
req.body = \{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","granularity":"string","group_ids":[\{\}],"grouped":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","project_ids":[\{\}],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}],"with_graph":"boolean"\}.to_json
req.basic_auth '<email>', '<password>'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries/totals", {
method: "POST",
body: \{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","granularity":"string","group_ids":[\{\}],"grouped":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","project_ids":[\{\}],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}],"with_graph":"boolean"\},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries/totals', json=\{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","granularity":"string","group_ids":[\{\}],"grouped":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","project_ids":[\{\}],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}],"with_graph":"boolean"\}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new().basic_auth("<email>", "<password>");
let json = client.request(Method::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries/totals".to_string())
.json(&serde_json::json!(\{"billable":"boolean","client_ids":[\{\}],"description":"string","end_date":"string","granularity":"string","group_ids":[\{\}],"grouped":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","project_ids":[\{\}],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","tag_ids":[\{\}],"task_ids":[\{\}],"time_entry_ids":[\{\}],"user_ids":[\{\}],"with_graph":"boolean"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | Workspace ID |
Body
| Name | Type | Description |
|---|---|---|
| billable | boolean | Whether the time entry is set as billable, optional, premium feature. |
| client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. |
| description | string | Description, optional, filtering attribute. |
| end_date | string | End date, example time.DateOnly. Should be greater than Start date. Inclusive calendar date: the whole day is covered, evaluated in each time entry creator's own Toggl profile time zone (UTC when that user has none set). Entries are matched on their start, so an entry starting on End date is included even if it stops after it. |
| granularity | string | Totals granularity, optional, overrides resolution values. Possible values: day, week and month. |
| group_ids | Array of integer | Group IDs, optional, filtering attribute. |
| grouped | boolean | Whether time entries should be grouped, optional, default false. |
| max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. |
| min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. |
| project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. |
| resolution | string | Graph resolution, optional. Allow clients to explicitly request a resolution. |
| rounding | integer | Whether time should be rounded, optional, default from user preferences. |
| rounding_minutes | integer | Rounding minutes value, optional, default from user preferences. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. |
| start_date | string | Start date, example time.DateOnly. Should be less than End date. Inclusive calendar date: it is evaluated in each time entry creator's own Toggl profile time zone (UTC when that user has none set), not in the caller's or the workspace's time zone. |
| tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. |
| task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. |
| time_entry_ids | Array of integer | Time entry IDs, optional. |
| user_ids | Array of integer | User IDs, optional, filtering attribute. |
| with_graph | boolean | Whether Graph information should be loaded, optional, default false. |
Response
200
Returns totals values sums for detailed report
400
Possible error messages:
- At least one parameter must be set
- Invalid workspace id
- Invalid '{parameter}' value, allowed values are: '{valid_values}'
402
Workspace needs to have this feature enabled
403
Workspace not found/accessible
500
Internal Server Error