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":["integer"],"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":["integer"],"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":["integer"],"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":["integer"],"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":["integer"],"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":["integer"],"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 | |||||||||||||||||||||||||||||||||||||||||||||||||||
api_token | string | deprecated | |||||||||||||||||||||||||||||||||||||||||||||||||||
at | string | Timestamp of last workspace change | |||||||||||||||||||||||||||||||||||||||||||||||||||
business_ws | boolean | Workspace on Premium subscription | |||||||||||||||||||||||||||||||||||||||||||||||||||
csv_upload |
| 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 |
| deprecated | |||||||||||||||||||||||||||||||||||||||||||||||||||
suspended_at | string | Timestamp of suspension | |||||||||||||||||||||||||||||||||||||||||||||||||||
te_constraints |
| Time entry constraints setting | |||||||||||||||||||||||||||||||||||||||||||||||||||
working_hours_in_minutes | integer | Working hours in minutes |
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
Array of:
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 | 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 | Labour cost assigned to the user |
labor_cost_last_updated | string | Timestamp of the last labour cost update |
labour_cost | integer | Labour cost assigned to the user |
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 |
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":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"delete":["integer"]}')
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":["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/{workspace_id}/workspace_users", {
method: "PATCH",
body: {"delete":["integer"]},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.patch('https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users', json={"delete":["integer"]}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new().basic_auth("<email>", "<password>");
let json = client.request(Method::PATCH, "https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users".to_string())
.json(&serde_json::json!({"delete":["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 |
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 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 | |||||||||||||||||||||||||||||||||||||||||||||||||||
api_token | string | deprecated | |||||||||||||||||||||||||||||||||||||||||||||||||||
at | string | Timestamp of last workspace change | |||||||||||||||||||||||||||||||||||||||||||||||||||
business_ws | boolean | Workspace on Premium subscription | |||||||||||||||||||||||||||||||||||||||||||||||||||
csv_upload |
| 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 |
| deprecated | |||||||||||||||||||||||||||||||||||||||||||||||||||
suspended_at | string | Timestamp of suspension | |||||||||||||||||||||||||||||||||||||||||||||||||||
te_constraints |
| Time entry constraints setting | |||||||||||||||||||||||||||||||||||||||||||||||||||
working_hours_in_minutes | integer | Working hours in minutes |
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":["integer"],"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":["integer"],"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":["integer"],"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":["integer"],"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":["integer"],"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":["integer"],"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 | |||||||||||||||||||||||||||||||||||||||||||||||||||
api_token | string | deprecated | |||||||||||||||||||||||||||||||||||||||||||||||||||
at | string | Timestamp of last workspace change | |||||||||||||||||||||||||||||||||||||||||||||||||||
business_ws | boolean | Workspace on Premium subscription | |||||||||||||||||||||||||||||||||||||||||||||||||||
csv_upload |
| 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 |
| deprecated | |||||||||||||||||||||||||||||||||||||||||||||||||||
suspended_at | string | Timestamp of suspension | |||||||||||||||||||||||||||||||||||||||||||||||||||
te_constraints |
| Time entry constraints setting | |||||||||||||||||||||||||||||||||||||||||||||||||||
working_hours_in_minutes | integer | Working hours in minutes |
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" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts")
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"
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",
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', 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())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
200
name | type | description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
client_id | integer | - | |||||||||
client_name | string | - | |||||||||
errors | Array of
| - | |||||||||
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 | - |
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 |
Response
200
Array of:
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
| - | |||||||||
groups_count | integer | - | |||||||||
members_count | 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.
Array of:
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":["integer"],"threshold":"number","user_ids":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"frequency":"integer","group_ids":["integer"],"threshold":"number","user_ids":["integer"]}')
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":["integer"],"threshold":"number","user_ids":["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}/track_reminders", {
method: "POST",
body: {"frequency":"integer","group_ids":["integer"],"threshold":"number","user_ids":["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/workspaces/{workspace_id}/track_reminders', json={"frequency":"integer","group_ids":["integer"],"threshold":"number","user_ids":["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/workspaces/{workspace_id}/track_reminders".to_string())
.json(&serde_json::json!({"frequency":"integer","group_ids":["integer"],"threshold":"number","user_ids":["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 |
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":["integer"],"threshold":"number","user_ids":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"frequency":"integer","group_ids":["integer"],"threshold":"number","user_ids":["integer"]}')
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":["integer"],"threshold":"number","user_ids":["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}/track_reminders/{reminder_id}", {
method: "PUT",
body: {"frequency":"integer","group_ids":["integer"],"threshold":"number","user_ids":["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}/track_reminders/{reminder_id}', json={"frequency":"integer","group_ids":["integer"],"threshold":"number","user_ids":["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}/track_reminders/{reminder_id}".to_string())
.json(&serde_json::json!({"frequency":"integer","group_ids":["integer"],"threshold":"number","user_ids":["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 |
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
Array of:
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 |
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 '{"email":"string","groups":["integer"],"inactive":"boolean","name":"string","organization_admin":"boolean","role_id":"integer","workspaces":[{"admin":"boolean","cost":"number","default_currency":"string","groups":[{"group_id":"integer","name":"string"}],"inactive":"boolean","rate":"number","role":"string","role_id":"integer","working_hours":"number","workspace_id":"integer","workspace_name":"string","workspace_user_id":"integer"}]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"email":"string","groups":["integer"],"inactive":"boolean","name":"string","organization_admin":"boolean","role_id":"integer","workspaces":[{"admin":"boolean","cost":"number","default_currency":"string","groups":[{"group_id":"integer","name":"string"}],"inactive":"boolean","rate":"number","role":"string","role_id":"integer","working_hours":"number","workspace_id":"integer","workspace_name":"string","workspace_user_id":"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 = {"email":"string","groups":["integer"],"inactive":"boolean","name":"string","organization_admin":"boolean","role_id":"integer","workspaces":[{"admin":"boolean","cost":"number","default_currency":"string","groups":[{"group_id":"integer","name":"string"}],"inactive":"boolean","rate":"number","role":"string","role_id":"integer","working_hours":"number","workspace_id":"integer","workspace_name":"string","workspace_user_id":"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: {"email":"string","groups":["integer"],"inactive":"boolean","name":"string","organization_admin":"boolean","role_id":"integer","workspaces":[{"admin":"boolean","cost":"number","default_currency":"string","groups":[{"group_id":"integer","name":"string"}],"inactive":"boolean","rate":"number","role":"string","role_id":"integer","working_hours":"number","workspace_id":"integer","workspace_name":"string","workspace_user_id":"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={"email":"string","groups":["integer"],"inactive":"boolean","name":"string","organization_admin":"boolean","role_id":"integer","workspaces":[{"admin":"boolean","cost":"number","default_currency":"string","groups":[{"group_id":"integer","name":"string"}],"inactive":"boolean","rate":"number","role":"string","role_id":"integer","working_hours":"number","workspace_id":"integer","workspace_name":"string","workspace_user_id":"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!({"email":"string","groups":["integer"],"inactive":"boolean","name":"string","organization_admin":"boolean","role_id":"integer","workspaces":[{"admin":"boolean","cost":"number","default_currency":"string","groups":[{"group_id":"integer","name":"string"}],"inactive":"boolean","rate":"number","role":"string","role_id":"integer","working_hours":"number","workspace_id":"integer","workspace_name":"string","workspace_user_id":"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 | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
string | - | |||||||||||||||||||||||||||||||||||||||||||||||||
groups | Array of integer | - | ||||||||||||||||||||||||||||||||||||||||||||||||
inactive | boolean | - | ||||||||||||||||||||||||||||||||||||||||||||||||
name | string | - | ||||||||||||||||||||||||||||||||||||||||||||||||
organization_admin | boolean | - | ||||||||||||||||||||||||||||||||||||||||||||||||
role_id | integer | - | ||||||||||||||||||||||||||||||||||||||||||||||||
workspaces | Array of
| - |
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