Capacities
GET Get capacity computations
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group}
Returns working minutes plus gross and remaining scheduled estimates for each requested user or resource. 'working_minutes' covers the full requested period; 'elapsed_working_minutes' covers only dates through the requester's local today. Both working-minute fields exclude public holidays and deduct overlapping PTO. 'estimated_minutes' is gross timeline work from non-draft task estimates, projected recurring tasks, and planned calendar events. When 'include_drafts' is true, 'estimated_minutes' also includes task estimates from draft projects. 'estimated_remaining_minutes' nets each assignee's tracked time and places unfinished work from the requester's local today. Placement uses future working days. Weekends and public holidays are excluded. Past and overdue task slices are zero; planned events count only from today.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group}")
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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group}')
req = Net::HTTP::Get.new(uri)
req['Content-Type'] = "application/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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group}", {
method: "GET",
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.get('https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group}', 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::GET, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| group | string | true | group of computations |
Query
| name | type | required | description |
|---|---|---|---|
| user_id | []integer | true | get capacity computations for the user given their ID |
| start_date | string | true | start date of computation |
| end_date | string | true | end date of computation |
| private | boolean | false | task privacy used to compute for capacity |
| task_source | []string | false | filter task sources |
| unit | string | false | unit of time for computation. default: day |
| include_drafts | boolean | false | include draft-project tasks; requires view_draft_projects permission |
| include_task_estimates | boolean | false | break each user's estimated minutes down per task |
Response
200
Computations grouped
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| computations | Array of object | The computations that belong to the grouping entity |
| id | integer | The ID of the entity that groups the computations |
| task_estimates | Array of object | TaskEstimates breaks the computations' estimated minutes down per task, only populated when include_task_estimates is requested. |
| type | string | The type of the entity that groups the computations. Valid values: user. |
computations
| Name | Type | Description |
|---|---|---|
| assigned_tasks_count | integer | Number of tasks assigned to the user on the specified Date |
| date | string | The date of the computation |
| elapsed_working_minutes | integer | Working minutes through the requester's local today. |
| estimated_minutes | integer | The summation of a user's tasks' estimated minutes in the day |
| estimated_remaining_minutes | integer | EstimatedRemainingMinutes is unfinished scheduled work placed from the requester's local today. |
| time_off_minutes | integer | TimeOffMinutes is the PTO overlap deducted from WorkingMinutes. |
| working_minutes | integer | The user's per day working minutes set in their user preferences |
task_estimates
| Name | Type | Description |
|---|---|---|
| daily_estimated_minutes | number | DailyEstimatedMinutes is the assignee's per-working-day share, after allocations, the assignee split, and their own working days and public holidays. Unrounded, because Computation.EstimatedMinutes rounds once after summing every task's share: round each part first and the parts stop adding up to the total. Clients round for display. |
| task_id | integer | - |
400
Invalid request
403
Insufficient permissions
500
Internal Server Error