Tasks
GET List tasks
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks
Returns a list of tasks based on the workspace ID.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks \
-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")
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')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks", {
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', 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".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 |
Query
| name | type | required | description |
|---|---|---|---|
| page | integer | false | page number |
| per_page | integer | false | results per page |
| with_entries | boolean | false | include time entries |
| pinned | boolean | false | filter by pinned state |
| order_by | []string | false | order by |
| status_id | []integer | false | filter in tasks by status' IDs |
| toggl_user_id | integer | false | filter in tasks by user |
| name | string | false | filter tasks by their names |
| has_time_entries | boolean | false | filter tasks if it has time entries |
| has_time_blocks | boolean | false | filter tasks if it has time blocks |
| has_dates | boolean | false | filter tasks by date presence: true returns tasks with start_date or end_date, false returns tasks with both dates NULL |
| private | boolean | false | filter tasks by private state |
| archived | boolean | false | filter in/out archived tasks |
| project_id | []integer | false | filter by project ids. ?project_id= will include tasks with no project. |
| parent_task_id | []integer | false | filter by parent task ids. ?parent_task_id= will include tasks with no parent. |
| 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 |
| dates_overlap_start | string | false | [LEGACY] use start_date instead |
| dates_overlap_end | string | false | [LEGACY] use end_date instead |
| estimated_mins_min | integer | false | filter by estimated mins min |
| estimated_mins_max | integer | false | filter by estimated mins max |
| source | string | false | filter by source |
| priority | string | false | filter by priority |
| is_priority | boolean | false | filter by whether task is a user priority |
| state | []string | false | filter by state |
| timeblock_start_from | string | false | filter by a task's timeblock start date (from) |
| timeblock_start_until | string | false | filter by a task's timeblock start date (until) |
| time_block_id | []integer | false | filter in tasks by timeblock' IDs |
| time_block_completed | boolean | false | filter in tasks by completed timeblocks |
| team_id | []integer | false | filter tasks by team IDs |
| assignee_user_id | []integer | false | filter in tasks by assignee's user IDs |
| tag_id | []integer | false | filter in tasks by tag IDs |
| recurring | boolean | false | filter by recurring tasks |
| recurring_task_ids | []integer | false | filter by recurring task ids |
| client_id | []integer | false | filter by client ids. ?client_id= will include tasks with no client. |
| include_rates | boolean | false | includes the parent projects' rate data |
| include_ghost_assignees | boolean | false | includes the ghost assignees |
| assignee_ghost_id | []integer | false | filter in tasks by assignee's ghost IDs |
| disable_aggregations | boolean | false | when true, skips computing aggregations and parent task hydration for faster response |
Response
200
| Name | Type | Description |
|---|---|---|
| data | Array of object | - |
| page | integer | - |
| per_page | integer | - |
| total | integer | - |
data
| Name | Type | Description |
|---|---|---|
| archived_at | string | - |
| assignee_user_ids | Array of integer | - |
| auto_log_time | boolean | - |
| billable | boolean | - |
| client | object | - |
| color | string | - |
| created_at | string | - |
| deleted_at | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| ghost_assignee_ids | Array of integer | - |
| id | integer | - |
| metadata | object | - |
| name | string | - |
| notes | string | - |
| parent | object | - |
| parent_task_id | integer | - |
| parent_task_name | string | - |
| pinned | boolean | - |
| position | integer | - |
| priority | string | - |
| priority_at | string | - |
| private | boolean | - |
| project | object | - |
| project_id | integer | - |
| recurring_task_id | integer | - |
| reucrrence_date | object | - |
| rrule | string | - |
| source | string | - |
| start_date | string | - |
| status | object | - |
| status_id | integer | - |
| status_updated_at | string | - |
| sub_task_done_count | integer | - |
| sub_task_total_count | integer | - |
| tag_ids | Array of integer | - |
| tags | Array of object | - |
| time_block_completed_count | integer | - |
| time_block_scheduled_completed_count | integer | - |
| time_block_scheduled_total_count | integer | - |
| time_block_total_count | integer | TODO: Set as required after FE adjusts things on their end |
| time_entry_total_count | integer | - |
| toggl_user_id | integer | - |
| total_blocked_time | integer | - |
| total_scheduled_blocked_time | integer | - |
| total_tracked_time | integer | - |
| updated_at | string | - |
| workspace_id | integer | - |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
metadata
| Name | Type | Description |
|---|---|---|
| all_day | boolean | - |
| calendar_event_id | integer | - |
| calendar_id | integer | - |
| external_id | string | - |
| ical_uid | string | - |
| meeting_link | string | - |
| updated_at | string | - |
parent
| Name | Type | Description |
|---|---|---|
| archived_at | string | - |
| assignee_user_ids | Array of integer | - |
| auto_log_time | boolean | - |
| billable | boolean | - |
| client | object | - |
| color | string | - |
| created_at | string | - |
| deleted_at | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| ghost_assignee_ids | Array of integer | - |
| id | integer | - |
| metadata | object | - |
| name | string | - |
| notes | string | - |
| parent_task_id | integer | - |
| parent_task_name | string | - |
| pinned | boolean | - |
| position | integer | - |
| priority | string | - |
| priority_at | string | - |
| private | boolean | - |
| project | object | - |
| project_id | integer | - |
| recurring_task_id | integer | - |
| reucrrence_date | object | - |
| rrule | string | - |
| source | string | - |
| start_date | string | - |
| status | object | - |
| status_id | integer | - |
| status_updated_at | string | - |
| tag_ids | Array of integer | - |
| tags | Array of object | - |
| toggl_user_id | integer | - |
| updated_at | string | - |
| workspace_id | integer | - |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
metadata
| Name | Type | Description |
|---|---|---|
| all_day | boolean | - |
| calendar_event_id | integer | - |
| calendar_id | integer | - |
| external_id | string | - |
| ical_uid | string | - |
| meeting_link | string | - |
| updated_at | string | - |
project
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
| permissions | Array of string | - |
| private | boolean | - |
| rate | 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 | - |
reucrrence_date
status
| Name | Type | Description |
|---|---|---|
| emoji | string | - |
| id | integer | - |
| name | string | - |
| type | string | - |
tags
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
project
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
| permissions | Array of string | - |
| private | boolean | - |
| rate | 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 | - |
reucrrence_date
status
| Name | Type | Description |
|---|---|---|
| emoji | string | - |
| id | integer | - |
| name | string | - |
| type | string | - |
tags
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
400
Invalid request
500
Internal Server Error
POST Create a new task
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks
Creates a new task with the provided details.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks \
-H "Content-Type: application/json" \
-d '\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks", 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')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_ids":[\{\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks", {
method: "POST",
body: \{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks', json=\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks".to_string())
.json(&serde_json::json!(\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_ids":[\{\}]\}))
.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 |
Body
| Name | Type | Description |
|---|---|---|
| assignee_user_ids | Array of integer | - |
| auto_log_time | boolean | - |
| billable | boolean | - |
| color | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| ghost_assignee_ids | Array of integer | - |
| integration_ext_id | integer | - |
| integration_source | string | - |
| name | string | - |
| notes | string | - |
| parent_task_id | integer | - |
| pinned | boolean | - |
| position | integer | null |
| priority | string | - |
| priority_at | string | - |
| private | boolean | - |
| project_id | integer | - |
| rrule | string | null |
| start_date | string | - |
| status_id | integer | - |
| tag_ids | Array of integer | - |
Response
201
Task created successfully
400
Invalid request
500
Internal Server Error
POST Creates tasks in bulk
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/bulk
Creates tasks in bulk with the provided details.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/bulk \
-H "Content-Type: application/json" \
-d '\{"tasks":[\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_ids":[\{\}]\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"tasks":[\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_ids":[\{\}]\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/bulk", 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/bulk')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"tasks":[\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_ids":[\{\}]\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/bulk", {
method: "POST",
body: \{"tasks":[\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/bulk', json=\{"tasks":[\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_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://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/bulk".to_string())
.json(&serde_json::json!(\{"tasks":[\{"assignee_user_ids":[\{\}],"auto_log_time":"boolean","billable":"boolean","color":"string","description":"string","end_date":"string","estimated_mins":"integer","ghost_assignee_ids":[\{\}],"integration_ext_id":"integer","integration_source":"string","name":"string","notes":"string","parent_task_id":"integer","pinned":"boolean","position":"integer","priority":"string","priority_at":"string","private":"boolean","project_id":"integer","rrule":"string","start_date":"string","status_id":"integer","tag_ids":[\{\}]\}]\}))
.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 |
Body
| Name | Type | Description |
|---|---|---|
| tasks | Array of object | - |
tasks
| Name | Type | Description |
|---|---|---|
| assignee_user_ids | Array of integer | - |
| auto_log_time | boolean | - |
| billable | boolean | - |
| color | string | - |
| description | string | - |
| end_date | string | - |
| estimated_mins | integer | - |
| ghost_assignee_ids | Array of integer | - |
| integration_ext_id | integer | - |
| integration_source | string | - |
| name | string | - |
| notes | string | - |
| parent_task_id | integer | - |
| pinned | boolean | - |
| position | integer | null |
| priority | string | - |
| priority_at | string | - |
| private | boolean | - |
| project_id | integer | - |
| rrule | string | null |
| start_date | string | - |
| status_id | integer | - |
| tag_ids | Array of integer | - |