Workspaces
POST Create a new workspace.
https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces
Create a workspace within an existing organization.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces \
-H "Content-Type: application/json" \
-d '\{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"integer"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"integer"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces", 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/api/v9/organizations/{organization_id}/workspaces')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"integer"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces", {
method: "POST",
body: \{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"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.post('https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces', json=\{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"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::POST, "https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces".to_string())
.json(&serde_json::json!(\{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"integer"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
organization_id | integer | true | Numeric ID of the organization |
Body
Name | Type | Description |
---|---|---|
admins | Array of integer | List of admins, optional |
default_currency | string | Default currency, premium feature, optional, only for existing WS, will be 'USD' initially |
default_hourly_rate | number | The default hourly rate, premium feature, optional, only for existing WS, will be 0.0 initially |
initial_pricing_plan | integer | The subscription plan for the workspace, deprecated |
name | string | Workspace name |
only_admins_may_create_projects | boolean | Only admins will be able to create projects, optional, only for existing WS, will be false initially |
only_admins_may_create_tags | boolean | Only admins will be able to create tags, optional, only for existing WS, will be false initially |
only_admins_see_billable_rates | boolean | Whether only admins will be able to see billable rates, premium feature, optional, only for existing WS. Will be false initially |
only_admins_see_team_dashboard | boolean | Only admins will be able to see the team dashboard, optional, only for existing WS, will be false initially |
projects_billable_by_default | boolean | Whether projects will be set as billable by default, premium feature, optional, only for existing WS. Will be true initially |
projects_enforce_billable | boolean | Whether tracking time to projects will enforce billable setting to be respected. |
projects_private_by_default | boolean | Whether projects will be set to private by default, optional. Will be true initially. |
rate_change_mode | string | The rate change mode, premium feature, optional, only for existing WS. Can be "start-today", "override-current", "override-all" |
reports_collapse | boolean | Whether reports should be collapsed by default, optional, only for existing WS, will be true initially |
rounding | integer | Default rounding, premium feature, optional, only for existing WS |
rounding_minutes | integer | Default rounding in minutes, premium feature, optional, only for existing WS |
Response
200
Name | Type | Description |
---|---|---|
admin | boolean | Current user is workspace admin Deprecated |
api_token | string | deprecated |
at | string | Timestamp of last workspace change |
business_ws | boolean | Workspace on Premium subscription |
csv_upload | object | CSV upload data |
default_currency | string | Default currency, premium feature, optional, only for existing WS, will be 'USD' initially |
default_hourly_rate | number | The default hourly rate, premium feature, optional, only for existing WS, will be 0.0 initially |
hide_start_end_times | boolean | - |
ical_enabled | boolean | Calendar integration enabled |
ical_url | string | URL of calendar |
id | integer | Identifier of the workspace |
last_modified | string | Last modification of data in the workspace |
logo_url | string | URL of workspace logo |
max_data_retention_days | integer | How far back free workspaces can access data. |
name | string | Name of the workspace |
only_admins_may_create_projects | boolean | Only admins will be able to create projects, optional, only for existing WS, will be false initially |
only_admins_may_create_tags | boolean | Only admins will be able to create tags, optional, only for existing WS, will be false initially |
only_admins_see_billable_rates | boolean | Whether only admins will be able to see billable rates, premium feature, optional, only for existing WS. Will be false initially |
only_admins_see_team_dashboard | boolean | Only admins will be able to see the team dashboard, optional, only for existing WS, will be false initially |
organization_id | integer | Identifier of the organization |
permissions | string | Permissions list |
premium | boolean | Workspace on Starter subscription |
profile | integer | deprecated |
projects_billable_by_default | boolean | New projects billable by default |
projects_enforce_billable | boolean | Whether tracking time to projects will enforce billable setting to be respected. |
projects_private_by_default | boolean | Workspace setting for default project visbility. |
rate_last_updated | string | Timestamp of last workspace rate update |
reports_collapse | boolean | Whether reports should be collapsed by default, optional, only for existing WS, will be true initially |
role | string | Role of the current user in the workspace |
rounding | integer | Default rounding, premium feature, optional, only for existing WS. 0 - nearest, 1 - round up, -1 - round down |
rounding_minutes | integer | Default rounding in minutes, premium feature, optional, only for existing WS |
subscription | object | deprecated |
suspended_at | string | Timestamp of suspension |
te_constraints | object | Time entry constraints setting |
working_hours_in_minutes | integer | Working hours in minutes |
csv_upload
Name | Type | Description |
---|---|---|
at | string | - |
log_id | integer | - |
subscription
Name | Type | Description |
---|---|---|
auto_renew | boolean | - |
card_details | object | - |
company_id | integer | - |
contact_detail | object | - |
created_at | string | - |
currency | string | - |
customer_id | integer | - |
deleted_at | string | - |
last_pricing_plan_id | integer | - |
organization_id | integer | - |
payment_details | object | - |
pricing_plan_id | integer | - |
renewal_at | string | - |
subscription_id | integer | - |
subscription_period | object | - |
workspace_id | integer | - |
card_details
Name | Type | Description |
---|---|---|
added_at | string | - |
card_number | string | - |
card_type | string | - |
creator_id | integer | - |
creator_name | string | - |
expiry_date | string | - |
holder_name | string | - |
contact_detail
Name | Type | Description |
---|---|---|
company_address | string | - |
company_city | string | - |
company_name | string | - |
contact_detail_id | integer | - |
contact_email | string | - |
contact_person | string | - |
country_id | integer | - |
country_subdivision_id | integer | - |
created_at | string | - |
customer_id | integer | - |
is_eu_resident | boolean | - |
updated_at | string | - |
user_id | integer | - |
vat_number | string | - |
vat_number_valid | boolean | DEPRECATED |
vat_number_validated_at | string | DEPRECATED |
zip_code | string | - |
payment_details
Name | Type | Description |
---|---|---|
created_at | string | - |
currency | string | - |
customer_id | integer | - |
payment_type | string | - |
reference | string | - |
user_id | integer | - |
subscription_period
Name | Type | Description |
---|---|---|
created_at | string | - |
finished_on | string | - |
started_on | string | - |
subscription_id | integer | - |
subscription_period_id | integer | - |
trial | boolean | - |
user_count | integer | - |
te_constraints
Name | Type | Description |
---|---|---|
description_present | boolean | - |
project_present | boolean | - |
tag_present | boolean | - |
task_present | boolean | - |
time_entry_constraints_enabled | boolean | - |
400
Possible errors:
- JSON is not valid
- workspace name must contain non-space characters
- workspace name must not be nil
- workspace name must not be longer than 140
- another workspace with same name exists in organization
- user can have a maximum of 100 workspaces
- Multiple workspaces are not enabled in this organization.
- Organization {name} can have a maximum of {amount} workspaces
- User with id {id} does not exist.
- User {userID} not exists in the workspace.
402
Possible errors:
- Must be a premium user to use default_hourly_rate
- restricting tag management to administrators requires a premium subscription
- Must be a premium user to use default_currency
- Must be a premium user to use rounding_minutes
- Must be a premium user to use only_admins_see_billable_rates
- Must be a premium user to use projects_billable_by_default
- Must be a premium user to use rounding
403
Forbidden
404
Possible errors:
- Organization not found/accessible
- Workspace not found/accessible
- organization owner not found
GET List of users who belong to the given workspace.
https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users
Returns any users who belong to the workspace directly or through at least one group.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users")
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/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users')
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://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users", {
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://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users', 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://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
organization_id | integer | true | Numeric ID of the organization |
workspace_id | integer | true | Numeric ID of the workspace within the organization |
Query
name | type | required | description |
---|---|---|---|
name | string | true | Workspace user name to filter by |
Response
200
Name | Type | Description |
---|---|---|
items | Array of object | - |
items
Name | Type | Description |
---|---|---|
active | boolean | Flag indicating if user accepted the invitation |
admin | boolean | Flag indicating if user is admin |
at | string | Timestamp of the last update |
avatar_file_name | string | URL of avatar |
string | Email of the user | |
group_ids | Array of integer | List of groups the user belongs to |
id | integer | Identifier of the user workspace |
inactive | boolean | Flag indicating if user was deactivated by admin of the workspace |
invitation_code | string | internal |
invite_url | string | internal |
is_direct | boolean | Flag indicating if user is a direct member of the workspace (is not assigned to the workspace using the group) |
labor_cost | number | Labor cost assigned to the user |
labor_cost_last_updated | string | Timestamp of the last labor cost update |
name | string | Name of the user |
organization_admin | boolean | Flag indicating if user is admin inside organization |
rate | number | Rate assigned to the user |
rate_last_updated | string | Timestamp of the last rate update |
role | string | Role of the user |
role_id | integer | - |
timezone | string | Timezone of the user |
uid | integer | Global user identifier |
user_id | integer | UserID alternative JSON field, only used by get-organization-workspaces-workspaceusers |
view_edit_billable_rates | boolean | Granular rate permission flags Only takes effect on roles with conditional rate permissions |
view_edit_labor_costs | boolean | - |
wid | integer | Workspace identifier |
working_hours_in_minutes | integer | Working hours value in minutes |
workspace_admin | boolean | Flag indicating if user is admin inside workspace |
workspace_id | integer | UserID alternative JSON field, only used by get-organization-workspaces-workspaceusers |
403
Forbidden
404
Resource can not be found
PATCH Changes the users in a workspace.
https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users
Changes the users in a workspace (currently deletion only).
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users \
-H "Content-Type: application/json" \
-d '\{"delete":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"delete":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users", 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/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Patch.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"delete":[\{\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users", {
method: "PATCH",
body: \{"delete":[\{\}]\},
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://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users', json=\{"delete":[\{\}]\}, 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://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users".to_string())
.json(&serde_json::json!(\{"delete":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
organization_id | integer | true | Numeric ID of the organization |
workspace_id | integer | true | Numeric ID of the workspace |
Body
Name | Type | Description |
---|---|---|
delete | Array of integer | Workspace user IDs to be deleted |
Response
200
Successful operation.
400
Possible error messages:
- JSON is not valid
- At least one workspace user ID must be supplied.
- Workspace user IDs must be unique"
- Wrong workspace user IDs
403
Forbidden
GET Workspaces containing search term
https://api.track.toggl.com/api/v9/workspaces
Returns workspaces data containing the search term
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces")
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/api/v9/workspaces')
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://api.track.toggl.com/api/v9/workspaces", {
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://api.track.toggl.com/api/v9/workspaces', 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://api.track.toggl.com/api/v9/workspaces".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
200
Name | Type | Description |
---|---|---|
admin | boolean | Current user is workspace admin Deprecated |
api_token | string | deprecated |
at | string | Timestamp of last workspace change |
business_ws | boolean | Workspace on Premium subscription |
csv_upload | object | CSV upload data |
default_currency | string | Default currency, premium feature, optional, only for existing WS, will be 'USD' initially |
default_hourly_rate | number | The default hourly rate, premium feature, optional, only for existing WS, will be 0.0 initially |
hide_start_end_times | boolean | - |
ical_enabled | boolean | Calendar integration enabled |
ical_url | string | URL of calendar |
id | integer | Identifier of the workspace |
last_modified | string | Last modification of data in the workspace |
logo_url | string | URL of workspace logo |
max_data_retention_days | integer | How far back free workspaces can access data. |
name | string | Name of the workspace |
only_admins_may_create_projects | boolean | Only admins will be able to create projects, optional, only for existing WS, will be false initially |
only_admins_may_create_tags | boolean | Only admins will be able to create tags, optional, only for existing WS, will be false initially |
only_admins_see_billable_rates | boolean | Whether only admins will be able to see billable rates, premium feature, optional, only for existing WS. Will be false initially |
only_admins_see_team_dashboard | boolean | Only admins will be able to see the team dashboard, optional, only for existing WS, will be false initially |
organization_id | integer | Identifier of the organization |
permissions | string | Permissions list |
premium | boolean | Workspace on Starter subscription |
profile | integer | deprecated |
projects_billable_by_default | boolean | New projects billable by default |
projects_enforce_billable | boolean | Whether tracking time to projects will enforce billable setting to be respected. |
projects_private_by_default | boolean | Workspace setting for default project visbility. |
rate_last_updated | string | Timestamp of last workspace rate update |
reports_collapse | boolean | Whether reports should be collapsed by default, optional, only for existing WS, will be true initially |
role | string | Role of the current user in the workspace |
rounding | integer | Default rounding, premium feature, optional, only for existing WS. 0 - nearest, 1 - round up, -1 - round down |
rounding_minutes | integer | Default rounding in minutes, premium feature, optional, only for existing WS |
subscription | object | deprecated |
suspended_at | string | Timestamp of suspension |
te_constraints | object | Time entry constraints setting |
working_hours_in_minutes | integer | Working hours in minutes |
csv_upload
Name | Type | Description |
---|---|---|
at | string | - |
log_id | integer | - |
subscription
Name | Type | Description |
---|---|---|
auto_renew | boolean | - |
card_details | object | - |
company_id | integer | - |
contact_detail | object | - |
created_at | string | - |
currency | string | - |
customer_id | integer | - |
deleted_at | string | - |
last_pricing_plan_id | integer | - |
organization_id | integer | - |
payment_details | object | - |
pricing_plan_id | integer | - |
renewal_at | string | - |
subscription_id | integer | - |
subscription_period | object | - |
workspace_id | integer | - |
card_details
Name | Type | Description |
---|---|---|
added_at | string | - |
card_number | string | - |
card_type | string | - |
creator_id | integer | - |
creator_name | string | - |
expiry_date | string | - |
holder_name | string | - |
contact_detail
Name | Type | Description |
---|---|---|
company_address | string | - |
company_city | string | - |
company_name | string | - |
contact_detail_id | integer | - |
contact_email | string | - |
contact_person | string | - |
country_id | integer | - |
country_subdivision_id | integer | - |
created_at | string | - |
customer_id | integer | - |
is_eu_resident | boolean | - |
updated_at | string | - |
user_id | integer | - |
vat_number | string | - |
vat_number_valid | boolean | DEPRECATED |
vat_number_validated_at | string | DEPRECATED |
zip_code | string | - |
payment_details
Name | Type | Description |
---|---|---|
created_at | string | - |
currency | string | - |
customer_id | integer | - |
payment_type | string | - |
reference | string | - |
user_id | integer | - |
subscription_period
Name | Type | Description |
---|---|---|
created_at | string | - |
finished_on | string | - |
started_on | string | - |
subscription_id | integer | - |
subscription_period_id | integer | - |
trial | boolean | - |
user_count | integer | - |
te_constraints
Name | Type | Description |
---|---|---|
description_present | boolean | - |
project_present | boolean | - |
tag_present | boolean | - |
task_present | boolean | - |
time_entry_constraints_enabled | boolean | - |
400
No search term
GET Get single workspace
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}
Get information of single workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}")
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/api/v9/workspaces/{workspace_id}')
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}", {
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}', 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://api.track.toggl.com/api/v9/workspaces/{workspace_id}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric Workspace ID |
Response
200
Name | Type | Description |
---|---|---|
admin | boolean | Current user is workspace admin Deprecated |
api_token | string | deprecated |
at | string | Timestamp of last workspace change |
business_ws | boolean | Workspace on Premium subscription |
csv_upload | object | CSV upload data |
default_currency | string | Default currency, premium feature, optional, only for existing WS, will be 'USD' initially |
default_hourly_rate | number | The default hourly rate, premium feature, optional, only for existing WS, will be 0.0 initially |
hide_start_end_times | boolean | - |
ical_enabled | boolean | Calendar integration enabled |
ical_url | string | URL of calendar |
id | integer | Identifier of the workspace |
last_modified | string | Last modification of data in the workspace |
logo_url | string | URL of workspace logo |
max_data_retention_days | integer | How far back free workspaces can access data. |
name | string | Name of the workspace |
only_admins_may_create_projects | boolean | Only admins will be able to create projects, optional, only for existing WS, will be false initially |
only_admins_may_create_tags | boolean | Only admins will be able to create tags, optional, only for existing WS, will be false initially |
only_admins_see_billable_rates | boolean | Whether only admins will be able to see billable rates, premium feature, optional, only for existing WS. Will be false initially |
only_admins_see_team_dashboard | boolean | Only admins will be able to see the team dashboard, optional, only for existing WS, will be false initially |
organization_id | integer | Identifier of the organization |
permissions | string | Permissions list |
premium | boolean | Workspace on Starter subscription |
profile | integer | deprecated |
projects_billable_by_default | boolean | New projects billable by default |
projects_enforce_billable | boolean | Whether tracking time to projects will enforce billable setting to be respected. |
projects_private_by_default | boolean | Workspace setting for default project visbility. |
rate_last_updated | string | Timestamp of last workspace rate update |
reports_collapse | boolean | Whether reports should be collapsed by default, optional, only for existing WS, will be true initially |
role | string | Role of the current user in the workspace |
rounding | integer | Default rounding, premium feature, optional, only for existing WS. 0 - nearest, 1 - round up, -1 - round down |
rounding_minutes | integer | Default rounding in minutes, premium feature, optional, only for existing WS |
subscription | object | deprecated |
suspended_at | string | Timestamp of suspension |
te_constraints | object | Time entry constraints setting |
working_hours_in_minutes | integer | Working hours in minutes |
csv_upload
Name | Type | Description |
---|---|---|
at | string | - |
log_id | integer | - |
subscription
Name | Type | Description |
---|---|---|
auto_renew | boolean | - |
card_details | object | - |
company_id | integer | - |
contact_detail | object | - |
created_at | string | - |
currency | string | - |
customer_id | integer | - |
deleted_at | string | - |
last_pricing_plan_id | integer | - |
organization_id | integer | - |
payment_details | object | - |
pricing_plan_id | integer | - |
renewal_at | string | - |
subscription_id | integer | - |
subscription_period | object | - |
workspace_id | integer | - |
card_details
Name | Type | Description |
---|---|---|
added_at | string | - |
card_number | string | - |
card_type | string | - |
creator_id | integer | - |
creator_name | string | - |
expiry_date | string | - |
holder_name | string | - |
contact_detail
Name | Type | Description |
---|---|---|
company_address | string | - |
company_city | string | - |
company_name | string | - |
contact_detail_id | integer | - |
contact_email | string | - |
contact_person | string | - |
country_id | integer | - |
country_subdivision_id | integer | - |
created_at | string | - |
customer_id | integer | - |
is_eu_resident | boolean | - |
updated_at | string | - |
user_id | integer | - |
vat_number | string | - |
vat_number_valid | boolean | DEPRECATED |
vat_number_validated_at | string | DEPRECATED |
zip_code | string | - |
payment_details
Name | Type | Description |
---|---|---|
created_at | string | - |
currency | string | - |
customer_id | integer | - |
payment_type | string | - |
reference | string | - |
user_id | integer | - |
subscription_period
Name | Type | Description |
---|---|---|
created_at | string | - |
finished_on | string | - |
started_on | string | - |
subscription_id | integer | - |
subscription_period_id | integer | - |
trial | boolean | - |
user_count | integer | - |
te_constraints
Name | Type | Description |
---|---|---|
description_present | boolean | - |
project_present | boolean | - |
tag_present | boolean | - |
task_present | boolean | - |
time_entry_constraints_enabled | boolean | - |
403
User does not have access to this resource.
500
Internal Server Error
PUT Update workspace
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}
Update a specific workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id} \
-H "Content-Type: application/json" \
-d '\{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"integer"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"integer"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}", 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/api/v9/workspaces/{workspace_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"integer"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}", {
method: "PUT",
body: \{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"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.put('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}', json=\{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"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::PUT, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}".to_string())
.json(&serde_json::json!(\{"admins":[\{\}],"default_currency":"string","default_hourly_rate":"number","initial_pricing_plan":"integer","name":"string","only_admins_may_create_projects":"boolean","only_admins_may_create_tags":"boolean","only_admins_see_billable_rates":"boolean","only_admins_see_team_dashboard":"boolean","projects_billable_by_default":"boolean","projects_enforce_billable":"boolean","projects_private_by_default":"boolean","rate_change_mode":"string","reports_collapse":"boolean","rounding":"integer","rounding_minutes":"integer"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric Workspace ID |
Body
Name | Type | Description |
---|---|---|
admins | Array of integer | List of admins, optional |
default_currency | string | Default currency, premium feature, optional, only for existing WS, will be 'USD' initially |
default_hourly_rate | number | The default hourly rate, premium feature, optional, only for existing WS, will be 0.0 initially |
initial_pricing_plan | integer | The subscription plan for the workspace, deprecated |
name | string | Workspace name |
only_admins_may_create_projects | boolean | Only admins will be able to create projects, optional, only for existing WS, will be false initially |
only_admins_may_create_tags | boolean | Only admins will be able to create tags, optional, only for existing WS, will be false initially |
only_admins_see_billable_rates | boolean | Whether only admins will be able to see billable rates, premium feature, optional, only for existing WS. Will be false initially |
only_admins_see_team_dashboard | boolean | Only admins will be able to see the team dashboard, optional, only for existing WS, will be false initially |
projects_billable_by_default | boolean | Whether projects will be set as billable by default, premium feature, optional, only for existing WS. Will be true initially |
projects_enforce_billable | boolean | Whether tracking time to projects will enforce billable setting to be respected. |
projects_private_by_default | boolean | Whether projects will be set to private by default, optional. Will be true initially. |
rate_change_mode | string | The rate change mode, premium feature, optional, only for existing WS. Can be "start-today", "override-current", "override-all" |
reports_collapse | boolean | Whether reports should be collapsed by default, optional, only for existing WS, will be true initially |
rounding | integer | Default rounding, premium feature, optional, only for existing WS |
rounding_minutes | integer | Default rounding in minutes, premium feature, optional, only for existing WS |
Response
200
Name | Type | Description |
---|---|---|
admin | boolean | Current user is workspace admin Deprecated |
api_token | string | deprecated |
at | string | Timestamp of last workspace change |
business_ws | boolean | Workspace on Premium subscription |
csv_upload | object | CSV upload data |
default_currency | string | Default currency, premium feature, optional, only for existing WS, will be 'USD' initially |
default_hourly_rate | number | The default hourly rate, premium feature, optional, only for existing WS, will be 0.0 initially |
hide_start_end_times | boolean | - |
ical_enabled | boolean | Calendar integration enabled |
ical_url | string | URL of calendar |
id | integer | Identifier of the workspace |
last_modified | string | Last modification of data in the workspace |
logo_url | string | URL of workspace logo |
max_data_retention_days | integer | How far back free workspaces can access data. |
name | string | Name of the workspace |
only_admins_may_create_projects | boolean | Only admins will be able to create projects, optional, only for existing WS, will be false initially |
only_admins_may_create_tags | boolean | Only admins will be able to create tags, optional, only for existing WS, will be false initially |
only_admins_see_billable_rates | boolean | Whether only admins will be able to see billable rates, premium feature, optional, only for existing WS. Will be false initially |
only_admins_see_team_dashboard | boolean | Only admins will be able to see the team dashboard, optional, only for existing WS, will be false initially |
organization_id | integer | Identifier of the organization |
permissions | string | Permissions list |
premium | boolean | Workspace on Starter subscription |
profile | integer | deprecated |
projects_billable_by_default | boolean | New projects billable by default |
projects_enforce_billable | boolean | Whether tracking time to projects will enforce billable setting to be respected. |
projects_private_by_default | boolean | Workspace setting for default project visbility. |
rate_last_updated | string | Timestamp of last workspace rate update |
reports_collapse | boolean | Whether reports should be collapsed by default, optional, only for existing WS, will be true initially |
role | string | Role of the current user in the workspace |
rounding | integer | Default rounding, premium feature, optional, only for existing WS. 0 - nearest, 1 - round up, -1 - round down |
rounding_minutes | integer | Default rounding in minutes, premium feature, optional, only for existing WS |
subscription | object | deprecated |
suspended_at | string | Timestamp of suspension |
te_constraints | object | Time entry constraints setting |
working_hours_in_minutes | integer | Working hours in minutes |
csv_upload
Name | Type | Description |
---|---|---|
at | string | - |
log_id | integer | - |
subscription
Name | Type | Description |
---|---|---|
auto_renew | boolean | - |
card_details | object | - |
company_id | integer | - |
contact_detail | object | - |
created_at | string | - |
currency | string | - |
customer_id | integer | - |
deleted_at | string | - |
last_pricing_plan_id | integer | - |
organization_id | integer | - |
payment_details | object | - |
pricing_plan_id | integer | - |
renewal_at | string | - |
subscription_id | integer | - |
subscription_period | object | - |
workspace_id | integer | - |
card_details
Name | Type | Description |
---|---|---|
added_at | string | - |
card_number | string | - |
card_type | string | - |
creator_id | integer | - |
creator_name | string | - |
expiry_date | string | - |
holder_name | string | - |
contact_detail
Name | Type | Description |
---|---|---|
company_address | string | - |
company_city | string | - |
company_name | string | - |
contact_detail_id | integer | - |
contact_email | string | - |
contact_person | string | - |
country_id | integer | - |
country_subdivision_id | integer | - |
created_at | string | - |
customer_id | integer | - |
is_eu_resident | boolean | - |
updated_at | string | - |
user_id | integer | - |
vat_number | string | - |
vat_number_valid | boolean | DEPRECATED |
vat_number_validated_at | string | DEPRECATED |
zip_code | string | - |
payment_details
Name | Type | Description |
---|---|---|
created_at | string | - |
currency | string | - |
customer_id | integer | - |
payment_type | string | - |
reference | string | - |
user_id | integer | - |
subscription_period
Name | Type | Description |
---|---|---|
created_at | string | - |
finished_on | string | - |
started_on | string | - |
subscription_id | integer | - |
subscription_period_id | integer | - |
trial | boolean | - |
user_count | integer | - |
te_constraints
Name | Type | Description |
---|---|---|
description_present | boolean | - |
project_present | boolean | - |
tag_present | boolean | - |
task_present | boolean | - |
time_entry_constraints_enabled | boolean | - |
403
User does not have access to this resource.
500
Internal Server Error
POST Alerts
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts
Handles POST alert requests.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts \
-H "Content-Type: application/json" \
-d '\{\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts", 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/api/v9/workspaces/{workspace_id}/alerts')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts", {
method: "POST",
body: \{\},
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/api/v9/workspaces/{workspace_id}/alerts', json=\{\}, 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/api/v9/workspaces/{workspace_id}/alerts".to_string())
.json(&serde_json::json!(\{\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Body
Name | Type | Description |
---|---|---|
request | Object | Alert data |
Response
200
Name | Type | Description |
---|---|---|
client_id | integer | - |
client_name | string | - |
errors | Array of object | - |
id | integer | - |
object_type | integer | - |
project_color | string | - |
project_id | integer | - |
project_name | string | - |
receiver_groups | string | - |
receiver_roles | string | - |
receiver_users | string | - |
receivers | integer | - |
source_kind | string | - |
threshold | integer | - |
threshold_type | string | - |
thresholds | string | using pq types is a workaround to enable reading postgres arrays into go types we should wrap these pq types to avoid polluting our domain |
wid | integer | - |
errors
Name | Type | Description |
---|---|---|
code | string | - |
message | string | - |
400
Possible errors:
- invalid workspace ID
- source kind can't be blank
- project can't be blank
- project not supported for this source kind
- threshold type can't be blank
- thresholds can't be blank
- receivers can't be blank
- alert type out of range
- receiver type out of range
- threshold out of range
- source kind out of range
- threshold type out of range
- receiver role out of range
500
Internal Server Error
DELETE Alerts
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts/{alert_id}
Handles DELETE alert requests.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts/{alert_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts/{alert_id}")
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/api/v9/workspaces/{workspace_id}/alerts/{alert_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts/{alert_id}", {
method: "DELETE",
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.delete('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts/{alert_id}', 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::DELETE, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts/{alert_id}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
200
Successful operation.
400
Possible errors:
- invalid 'alert_id' passed in URL
403
Alert not found or not accessible
500
Internal Server Error
POST Rates creation
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates
Creates a new rate.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates \
-H "Content-Type: application/json" \
-d '\{"amount":"number","level":"string","level_id":"integer","mode":"string","start":"string","type":"string"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"amount":"number","level":"string","level_id":"integer","mode":"string","start":"string","type":"string"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates", 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/api/v9/workspaces/{workspace_id}/rates')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"amount":"number","level":"string","level_id":"integer","mode":"string","start":"string","type":"string"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates", {
method: "POST",
body: \{"amount":"number","level":"string","level_id":"integer","mode":"string","start":"string","type":"string"\},
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/api/v9/workspaces/{workspace_id}/rates', json=\{"amount":"number","level":"string","level_id":"integer","mode":"string","start":"string","type":"string"\}, 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/api/v9/workspaces/{workspace_id}/rates".to_string())
.json(&serde_json::json!(\{"amount":"number","level":"string","level_id":"integer","mode":"string","start":"string","type":"string"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
Body
Name | Type | Description |
---|---|---|
amount | number | Amount of the rate, required, must be greater than 0 |
level | string | Level of the rate, required, must be one of: 'workspace', 'workspace_user', 'project', 'project_user', 'task' |
level_id | integer | Identifier of the level, required |
mode | string | Mode of the rate, required if Start is not informed, must be one of: 'override-all', 'override-current', 'start-today' |
start | string | Start date time of the rate, required if Mode is not informed, must be a valid date time |
type | string | Type of the rate, required, must be one of 'billable_rates', 'labor_rates' |
Response
201
Successfully created.
400
Possible error messages:
- Request payload must be informed
- Invalid workspace ID
402
Billable rates are available for Starter and higher plans.
403
User cannot access billable rate(s).
500
Internal Server Error
GET Rates list
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id}
Get rates by level(workspace|project|task|user).
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id}")
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/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id}')
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id}", {
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id}', 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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
level | string | true | Rates level: workspace, project, task or user |
level_id | integer | true | Numeric ID of the entity level |
Query
name | type | required | description |
---|---|---|---|
type | string | false | Type of rate values to be returned: billable_rates or labor_costs . Default is billable_rates . |
Response
200
Name | Type | Description |
---|---|---|
items | Array of object | - |
items
Name | Type | Description |
---|---|---|
amount | number | Amount of the rate |
created_at | string | Creation date of the rate |
creatorID | integer | - |
deleted_at | string | Deletion date of the rate, in case that is null it means the rates is active |
end | string | End date time of the rate |
id | integer | Identifier of the rate |
planned_task_id | integer | Planned task ID which the rate is applied |
project_id | integer | Project ID which the rate is applied |
project_user_id | integer | Project user ID which the rate is applied |
start | string | Start date time of the rate |
type | string | - |
updated_at | string | Last update date of the rate |
workspace_id | integer | Workspace ID which the rate is applied |
workspace_user_id | integer | Workspace user ID which the rate is applied |
400
Possible error messages:
- Invalid workspace ID
- Invalid entity ID
- Invalid level: it should be workspace, workspace_user, project or project_user
- User not found in workspace
- Task not found in workspace
402
Billable rates are available for Starter and higher plans.
403
User cannot access billable rate(s).
500
Internal Server Error
GET Workspace statistics
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/statistics
Returns workspace admins list, members count and groups count
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/statistics \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/statistics")
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/api/v9/workspaces/{workspace_id}/statistics')
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/statistics", {
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/statistics', 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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/statistics".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
200
Name | Type | Description |
---|---|---|
admins | Array of object | - |
groups_count | integer | - |
members_count | integer | - |
admins
Name | Type | Description |
---|---|---|
name | string | - |
user_id | integer | - |
403
User does not have access to this resource.
500
Internal Server Error
GET Get workspace time entry constraints
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entry_constraints
Get the time entry constraints for a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entry_constraints \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entry_constraints")
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/api/v9/workspaces/{workspace_id}/time_entry_constraints')
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entry_constraints", {
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entry_constraints', 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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/time_entry_constraints".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
Response
200
Name | Type | Description |
---|---|---|
description_present | boolean | - |
project_present | boolean | - |
tag_present | boolean | - |
task_present | boolean | - |
time_entry_constraints_enabled | boolean | - |
400
Workspace not found
403
User does not have access to this resource.
500
Internal Server Error
GET TrackReminders
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders
Returns a list of track reminders.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders")
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/api/v9/workspaces/{workspace_id}/track_reminders')
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders", {
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders', 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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
Response
200
Returns a list of track reminders.
Name | Type | Description |
---|---|---|
items | Array of object | - |
items
Name | Type | Description |
---|---|---|
created_at | string | Reminder creation time |
frequency | integer | Frequency of the reminder in days, should be either 1 or 7 |
group_ids | Array of integer | Groups IDs to send the reminder to |
reminder_id | integer | Reminder ID |
threshold | integer | Threshold is the number of hours after which the reminder will be sent |
user_ids | Array of integer | User IDs to send the reminder to |
workspace_id | integer | Workspace ID |
403
User does not have access to this resource.
500
Internal Server Error
POST TrackReminders
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders
Creates a workspace tracking reminder.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders \
-H "Content-Type: application/json" \
-d '\{"frequency":"integer","group_ids":[\{\}],"threshold":"number","user_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"frequency":"integer","group_ids":[\{\}],"threshold":"number","user_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders", 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/api/v9/workspaces/{workspace_id}/track_reminders')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"frequency":"integer","group_ids":[\{\}],"threshold":"number","user_ids":[\{\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders", {
method: "POST",
body: \{"frequency":"integer","group_ids":[\{\}],"threshold":"number","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/api/v9/workspaces/{workspace_id}/track_reminders', json=\{"frequency":"integer","group_ids":[\{\}],"threshold":"number","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/api/v9/workspaces/{workspace_id}/track_reminders".to_string())
.json(&serde_json::json!(\{"frequency":"integer","group_ids":[\{\}],"threshold":"number","user_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
Body
Name | Type | Description |
---|---|---|
frequency | integer | Frequency of the reminder in days, should be either 1 or 7 |
group_ids | Array of integer | Group IDs to send the reminder to, can be omitted if user_ids is provided |
threshold | number | Threshold is the number of hours after which the reminder will be sent |
user_ids | Array of integer | User IDs to send the reminder to, can be omitted if group_ids is provided |
Response
200
Creates a workspace tracking reminder.
Name | Type | Description |
---|---|---|
created_at | string | Reminder creation time |
frequency | integer | Frequency of the reminder in days, should be either 1 or 7 |
group_ids | Array of integer | Groups IDs to send the reminder to |
reminder_id | integer | Reminder ID |
threshold | integer | Threshold is the number of hours after which the reminder will be sent |
user_ids | Array of integer | User IDs to send the reminder to |
workspace_id | integer | Workspace ID |
403
User does not have access to this resource.
500
Internal Server Error
PUT TrackReminder
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}
Updates a workspace tracking reminder.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id} \
-H "Content-Type: application/json" \
-d '\{"frequency":"integer","group_ids":[\{\}],"threshold":"number","user_ids":[\{\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"frequency":"integer","group_ids":[\{\}],"threshold":"number","user_ids":[\{\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}", 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/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"frequency":"integer","group_ids":[\{\}],"threshold":"number","user_ids":[\{\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}", {
method: "PUT",
body: \{"frequency":"integer","group_ids":[\{\}],"threshold":"number","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.put('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}', json=\{"frequency":"integer","group_ids":[\{\}],"threshold":"number","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::PUT, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}".to_string())
.json(&serde_json::json!(\{"frequency":"integer","group_ids":[\{\}],"threshold":"number","user_ids":[\{\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
reminder_id | integer | true | Reminder ID. |
Body
Name | Type | Description |
---|---|---|
frequency | integer | Frequency of the reminder in days, should be either 1 or 7 |
group_ids | Array of integer | Group IDs to send the reminder to, can be omitted if user_ids is provided |
threshold | number | Threshold is the number of hours after which the reminder will be sent |
user_ids | Array of integer | User IDs to send the reminder to, can be omitted if group_ids is provided |
Response
200
Updates a workspace tracking reminder.
Name | Type | Description |
---|---|---|
created_at | string | Reminder creation time |
frequency | integer | Frequency of the reminder in days, should be either 1 or 7 |
group_ids | Array of integer | Groups IDs to send the reminder to |
reminder_id | integer | Reminder ID |
threshold | integer | Threshold is the number of hours after which the reminder will be sent |
user_ids | Array of integer | User IDs to send the reminder to |
workspace_id | integer | Workspace ID |
403
User does not have access to this resource.
500
Internal Server Error
DELETE TrackReminder
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}
Deletes a workspace tracking reminder.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}")
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/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}", {
method: "DELETE",
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.delete('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}', 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::DELETE, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/track_reminders/{reminder_id}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
reminder_id | integer | true | Reminder ID. |
Response
200
Returns only status code.
403
User does not have access to this resource.
500
Internal Server Error
GET Get workspace users
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users
List all users for a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users")
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/api/v9/workspaces/{workspace_id}/users')
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users", {
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users', 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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
Query
name | type | required | description |
---|---|---|---|
exclude_deleted | boolean | false | Exclude deleted records in the response |
Response
200
Name | Type | Description |
---|---|---|
items | Array of object | - |
items
Name | Type | Description |
---|---|---|
string | Email of the user | |
fullname | string | Name of the user |
id | integer | Global user identifier |
inactive | boolean | internal |
is_active | boolean | internal |
is_admin | boolean | Flag indicating if user is admin Deprecated |
role | string | Role of the user |
403
User does not have access to this resource.
500
Internal Server Error
PUT Update workspace user
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id}
Update the data for a user in a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id}")
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/api/v9/workspaces/{workspace_id}/users/{user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id}", {
method: "PUT",
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.put('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id}', 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::PUT, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
user_id | integer | true | Numeric ID of the user |
Response
200
Successful operation.
400
Bad Request
403
User does not have access to this resource.
404
Not Found
500
Internal Server Error
PUT Update workspace-user
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}
Update the data for a workspace_user in a given workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id} \
-H "Content-Type: application/json" \
-d '\{"admin":"boolean","inactive":"boolean","labor_cost":"number","labor_cost_change_mode":"string","postedFields":[\{\}],"rate":"number","rate_change_mode":"string","role":"string","role_id":"integer","view_edit_billable_rates":"boolean","view_edit_labor_costs":"boolean","working_hours_in_minutes":"integer"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"admin":"boolean","inactive":"boolean","labor_cost":"number","labor_cost_change_mode":"string","postedFields":[\{\}],"rate":"number","rate_change_mode":"string","role":"string","role_id":"integer","view_edit_billable_rates":"boolean","view_edit_labor_costs":"boolean","working_hours_in_minutes":"integer"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}", 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/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"admin":"boolean","inactive":"boolean","labor_cost":"number","labor_cost_change_mode":"string","postedFields":[\{\}],"rate":"number","rate_change_mode":"string","role":"string","role_id":"integer","view_edit_billable_rates":"boolean","view_edit_labor_costs":"boolean","working_hours_in_minutes":"integer"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}", {
method: "PUT",
body: \{"admin":"boolean","inactive":"boolean","labor_cost":"number","labor_cost_change_mode":"string","postedFields":[\{\}],"rate":"number","rate_change_mode":"string","role":"string","role_id":"integer","view_edit_billable_rates":"boolean","view_edit_labor_costs":"boolean","working_hours_in_minutes":"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.put('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}', json=\{"admin":"boolean","inactive":"boolean","labor_cost":"number","labor_cost_change_mode":"string","postedFields":[\{\}],"rate":"number","rate_change_mode":"string","role":"string","role_id":"integer","view_edit_billable_rates":"boolean","view_edit_labor_costs":"boolean","working_hours_in_minutes":"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::PUT, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}".to_string())
.json(&serde_json::json!(\{"admin":"boolean","inactive":"boolean","labor_cost":"number","labor_cost_change_mode":"string","postedFields":[\{\}],"rate":"number","rate_change_mode":"string","role":"string","role_id":"integer","view_edit_billable_rates":"boolean","view_edit_labor_costs":"boolean","working_hours_in_minutes":"integer"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
workspace_user_id | integer | true | Numeric ID of the workspace user |
Body
Name | Type | Description |
---|---|---|
admin | boolean | deprecated |
inactive | boolean | - |
labor_cost | number | Custom labor cost for project user |
labor_cost_change_mode | string | - |
postedFields | Array of string | for explicit NULL-s, add field name here |
rate | number | Paid feature |
rate_change_mode | string | Paid feature |
role | string | Allowed inputs: "admin", "user", "projectlead" and "teamlead" |
role_id | integer | - |
view_edit_billable_rates | boolean | - |
view_edit_labor_costs | boolean | - |
working_hours_in_minutes | integer | Paid feature |
Response
200
Successful operation.
400
Possible error messages:
- Workspace not found/accessible
- User not found
- Workspace user not found/accessible by user
- Working hours must be positive or null
- Invalid role_id.
- Cannot use both admin flags and role_id.
- User does not exist in the organization.
- User does not exist in the workspace.
403
User does not have access to this resource.
500
Internal Server Error
DELETE Delete workspace user
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}
Removes user from workspace
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id} \
-H "Content-Type: application/json"
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
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/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}", {
method: "DELETE",
headers: {
"Content-Type": "application/json"
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.delete('https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}', headers={'content-type': 'application/json'})
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();
let json = client.request(Method::DELETE, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace. |
workspace_user_id | integer | true | Numeric ID of the workspace user. |
Response
200
OK
400
Bad Request
403
Workspace user is not found or accessible
500
Internal Server Error