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. tag_ids and assignees order by the canonicalized (sorted) array, so tasks with the same set of tags or assignees cluster together regardless of storage order. Also accepts pcf_<id> / -pcf_<id> to sort tasks by the named custom field on the task's parent project. Multi_select and users CF types use the same canonicalized-array semantics. |
| status_id | []integer | false | filter in tasks by status' IDs |
| toggl_user_id | integer | false | filter in tasks by user |
| creator_id | integer | false | filter tasks by creator user ID; unlike toggl_user_id this does not match assignees |
| name | string | false | filter tasks by task name, project name, or client name |
| 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 |
| include_project_completed | boolean | false | include tasks whose parent project is completed (default false hides them; tasks without a project are always returned) |
| 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 | - |
| is_template | boolean | - |
| 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 | - |
| recurrence_date | string | - |
| recurring_task_id | integer | - |
| rrule | string | - |
| source | string | - |
| source_template_task_id | integer | - |
| 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 | - |
| project_assignment | object | - |
| updated_at | string | - |
project_assignment
| Name | Type | Description |
|---|---|---|
| accuracy | number | - |
| confirmed_at | string | - |
| match_tier | string | - |
| matched_name | string | - |
| normalized_name | string | - |
| origin | string | - |
| suggested_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 | - |
| is_template | boolean | - |
| 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 | - |
| recurrence_date | string | - |
| recurring_task_id | integer | - |
| rrule | string | - |
| source | string | - |
| source_template_task_id | integer | - |
| 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 | - |
| project_assignment | object | - |
| updated_at | string | - |
project_assignment
| Name | Type | Description |
|---|---|---|
| accuracy | number | - |
| confirmed_at | string | - |
| match_tier | string | - |
| matched_name | string | - |
| normalized_name | string | - |
| origin | string | - |
| suggested_at | string | - |
project
| Name | Type | Description |
|---|---|---|
| archived_at | string | - |
| 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. |
| id | integer | - |
| is_template | boolean | - |
| name | string | - |
| permissions | Array of string | - |
| private | boolean | - |
| rate | object | - |
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 | - |
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 |
|---|---|---|
| archived_at | string | - |
| 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. |
| id | integer | - |
| is_template | boolean | - |
| name | string | - |
| permissions | Array of string | - |
| private | boolean | - |
| rate | object | - |
custom_field_values
| Name | Type | Description |
|---|---|---|
| custom_field_id | integer | - |
| custom_field_name | string | - |
| field_type | string | - |
| selected_options | Array of object | - |
| value | object | - |
selected_options
| Name | Type | Description |
|---|---|---|
| is_deleted | boolean | - |
| option_id | integer | - |
| option_name | string | - |
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 | - |
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 | - |