Task-groups
GET Gets tasks in groups
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}
Gets tasks in groups depending on name
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{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}/tasks/groups/{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}/tasks/groups/{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}/tasks/groups/{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}/tasks/groups/{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}/tasks/groups/{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 name |
Query
| name | type | required | description |
|---|---|---|---|
| source | []string | false | filter by sources |
| priority | string | false | filter by priority |
| status_id | []integer | false | filter by statuses |
| project_id | []integer | false | filter by project IDs |
| client_id | []integer | false | filter by client IDs |
| assignee_user_id | []integer | false | filter by assignee user IDs |
| tag_id | []integer | false | filter by tag IDs |
| team_id | []integer | false | filter by team IDs (resolves to member user IDs) |
| user_tag_id | []integer | false | filter by assignee member-tag IDs (resolves to member user IDs) |
| group_id | []integer | false | filter by group IDs |
| creator_id | []integer | false | filter in by creator IDs |
| name | string | false | filter in by task name |
| start_date | string | false | filter tasks overlapping date range (start). Used with end_date to find tasks where task.start_date <= end_date AND task.end_date >= start_date |
| end_date | string | false | filter tasks overlapping date range (end). Used with start_date to find tasks where task.start_date <= end_date AND task.end_date >= start_date |
| start_date_from | string | false | [LEGACY] use start_date instead |
| start_date_to | string | false | [LEGACY] use start_date instead |
| end_date_from | string | false | [LEGACY] use end_date instead |
| end_date_to | string | false | [LEGACY] use end_date instead |
| private | boolean | false | filter by project privacy (true for private, false for public) |
| exclude_empty | boolean | false | filter groups with no tasks |
| include_unassigned | boolean | false | append the id=0 no-assignee group without restricting results to unassigned tasks, available for /users only. The group accompanies every non-empty page (it is outside the user pagination), so paginating clients must dedupe it |
| include_unmaterialized | boolean | false | include projected tasks from unmaterialized recurring periods; available for /users only; requires start_date and end_date |
| include_assignees | boolean | false | include the unified user and team assignees list on each task |
| min_days | integer | false | filters tasks with a minimum number of days. based on start_date and end_date |
| include_drafts | boolean | false | include tasks belonging to draft projects (default false hides them; requires view_draft_projects permission) |
| cf_filter | []string | false | filter by the task's own custom field values. Repeatable; each entry is 'fieldID:value1,value2' (values within an entry are OR, separate entries AND). Trailing colon 'fieldID:' selects the no-value bucket (select/multi_select only). |
| page | integer | false | page number |
| per_page | integer | false | results per page |
| order_by | []string | false | order by |
Response
200
Tasks grouped by type
| Name | Type | Description |
|---|---|---|
| data | Array of object | - |
| page | integer | - |
| per_page | integer | - |
data
| Name | Type | Description |
|---|---|---|
| id | integer | The ID of one of the entities: projects/users/tags determined by Type. |
| name | string | Display name of the group entity. Null for the users dimension, where the consumer resolves the name from ID via Accounts. |
| tasks | Array of object | The tasks that belong to the group. |
| type | string | Type determines what kind of group this is, and what table to look for based on ID. Valid values: projects, users, tags. |
tasks
| Name | Type | Description |
|---|---|---|
| allocation_unit | string | How the task's estimate allocations express their value. Valid values: percent, flat. |
| assignee_user_ids | Array of integer | - |
| assignees | Array of object | Assignees is the read-only unified user/team assignment list, only populated when include_assignees is requested. Mirrors the task endpoint. |
| client | object | - |
| color | string | - |
| created_at | string | CreatedAt is omitted for virtual entries. |
| end_date | string | When a task ends |
| estimate_type | string | Type of EstimatedMins. Total is spread throughout the task date range, and daily is a per day estimate. Valid values: daily, total. |
| estimated_mins | integer | Estimated minutes of the task |
| id | integer | The task's ID |
| masked | boolean | Masked indicates the task belongs to a private project the user doesn't have access to. When true, sensitive fields (Name, Client) are nulled. |
| name | string | Name of the task |
| parent_task | object | - |
| period_end | string | PeriodEnd is the recurring project period's last day. |
| period_start | string | PeriodStart is the recurring project period's first day. |
| private | boolean | - |
| project | object | - |
| project_id | integer | Project ID fo the task |
| projection_revision | string | ProjectionRevision identifies the projected period version. |
| source | string | - |
| source_template_task_id | integer | SourceTemplateTaskID identifies the task template used for this entry. |
| start_date | string | When a task starts |
| status_id | integer | Status ID of the task |
| template_project_id | integer | TemplateProjectID identifies the recurring project template. |
| virtual | boolean | Virtual indicates the entry is an unmaterialized recurring task. |
| weight | integer | The weight of a task in the timeline. This is not unique, and one or more tasks may have the same weight as long as their dates do not conflict. |
assignees
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| type | string | Valid values: user, team. |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
parent_task
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
project
| Name | Type | Description |
|---|---|---|
| archived_at | string | - |
| client | object | - |
| color | string | - |
| custom_field_values | Array of object | CustomFieldValues are the parent project's CF values, hydrated by callers that surface them (currently the task list, via task.service.hydrateTaskProjectCustomFieldValues which routes through customfield.Service.GetFieldsByIDs and respects the PermissionViewWorkspaceProjectCustomFields gate). Producers that don't hydrate (e.g. timeentry) leave the slice empty; omitempty hides it on those responses. |
| draft | boolean | - |
| id | integer | - |
| is_template | boolean | - |
| name | string | - |
| permissions | Array of string | - |
| private | boolean | - |
| rate | object | - |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
custom_field_values
| Name | Type | Description |
|---|---|---|
| custom_field_id | integer | - |
| custom_field_name | string | - |
| field_type | string | - |
| selected_options | Array of object | - |
| value | object | - |
rate
| Name | Type | Description |
|---|---|---|
| billable | boolean | - |
| currency | string | - |
| end_at | string | - |
| has_more_rates | boolean | - |
| hourly_rate | number | - |
| project_color | string | - |
| project_created_at | string | - |
| project_id | integer | - |
| project_name | string | - |
| project_rate_id | integer | - |
| start_at | string | - |
| workspace_rate_id | integer | - |
400
Invalid request
403
Insufficient permissions
500
Internal Server Error
PATCH Updates task groups and their entries' weights/parent group
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}
Updates task groups and their entries' weights/parent group. On the users dimension a move with an explicit null target_group_id lands the task in the no-assignee bucket (the id=0 group on reads); OMITTING the property on a move is rejected, so a forgotten field can never read as an unassign. The bucket move enforces its invariant regardless of the source. The dates follow the move, direct user assignees and team assignments are cleared (a no-op for a task already inside the bucket, so repositions work the same way). The task takes the given weight in the bucket, which persists ordering like any other group.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group} \
-H "Content-Type: application/json" \
-d '[\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}", 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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}')
req = Net::HTTP::Patch.new(uri)
req['Content-Type'] = "application/json"
req.body = [\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}].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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}", {
method: "PATCH",
body: [\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}],
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.patch('https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}', json=[\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}], 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::PATCH, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}".to_string())
.json(&serde_json::json!([\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}]))
.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 type |
Body
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| end_date | string | - |
| id | integer | - |
| op | string | Valid values: move, remove. |
| source_group_id | integer | null |
| start_date | string | - |
| target_group_id | integer | null |
| weight | integer | - |
Response
200
OK
400
Invalid request
403
Insufficient permissions
500
Internal Server Error