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","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","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","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","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","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","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 |
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
api_token | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
business_ws | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
csv_upload |
| - | |||||||||||||||||||||||||||||||||||||||||||||||||||
default_currency | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
default_hourly_rate | number | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
ical_enabled | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
ical_url | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
id | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
logo_url | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
organization_id | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
premium | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
profile | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
projects_billable_by_default | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rate_last_updated | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
reports_collapse | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rounding | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rounding_minutes | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
server_deleted_at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
subscription |
| - | |||||||||||||||||||||||||||||||||||||||||||||||||||
suspended_at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
te_constraints |
| - |
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 |
Response​
200​
Array of:
name | type | description |
---|---|---|
active | boolean | - |
admin | boolean | - |
at | string | - |
avatar_file_name | string | - |
string | - | |
group_ids | - | |
id | integer | - |
inactive | boolean | - |
invitation_code | string | - |
invite_url | string | - |
is_direct | boolean | - |
labour_cost | integer | - |
name | string | - |
organization_admin | boolean | - |
rate | number | - |
rate_last_updated | string | - |
timezone | string | - |
user_id | integer | - |
workspace_admin | boolean | - |
workspace_id | integer | - |
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
POST Workspaces​
https://api.track.toggl.com/api/v9/workspaces
Change a workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/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","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","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/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/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","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", {
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","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/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","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/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","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​
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 |
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
api_token | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
business_ws | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
csv_upload |
| - | |||||||||||||||||||||||||||||||||||||||||||||||||||
default_currency | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
default_hourly_rate | number | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
ical_enabled | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
ical_url | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
id | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
logo_url | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
organization_id | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
premium | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
profile | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
projects_billable_by_default | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rate_last_updated | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
reports_collapse | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rounding | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rounding_minutes | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
server_deleted_at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
subscription |
| - | |||||||||||||||||||||||||||||||||||||||||||||||||||
suspended_at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
te_constraints |
| - |
403​
User does not have access to this resource.
500​
Internal Server Error
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
api_token | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
business_ws | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
csv_upload |
| - | |||||||||||||||||||||||||||||||||||||||||||||||||||
default_currency | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
default_hourly_rate | number | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
ical_enabled | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
ical_url | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
id | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
logo_url | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
organization_id | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
premium | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
profile | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
projects_billable_by_default | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rate_last_updated | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
reports_collapse | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rounding | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rounding_minutes | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
server_deleted_at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
subscription |
| - | |||||||||||||||||||||||||||||||||||||||||||||||||||
suspended_at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
te_constraints |
| - |
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","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","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","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","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","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","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 |
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
api_token | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
business_ws | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
csv_upload |
| - | |||||||||||||||||||||||||||||||||||||||||||||||||||
default_currency | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
default_hourly_rate | number | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
ical_enabled | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
ical_url | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
id | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
logo_url | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
organization_id | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
premium | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
profile | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
projects_billable_by_default | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rate_last_updated | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
reports_collapse | boolean | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rounding | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
rounding_minutes | integer | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
server_deleted_at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
subscription |
| - | |||||||||||||||||||||||||||||||||||||||||||||||||||
suspended_at | string | - | |||||||||||||||||||||||||||||||||||||||||||||||||||
te_constraints |
| - |
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 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
errors | Array of
| - | |||||||||
id | integer | - | |||||||||
object_type | integer | - | |||||||||
project_id | integer | - | |||||||||
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.
403​
Alert not found or not accessible
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 |
Response​
200​
Array of:
name | type | description |
---|---|---|
active | boolean | - |
admin | boolean | - |
at | string | - |
avatar_file_name | string | - |
string | - | |
group_ids | - | |
id | integer | - |
inactive | boolean | - |
invitation_code | string | - |
invite_url | string | - |
labour_cost | integer | - |
name | string | - |
rate | number | - |
rate_last_updated | string | - |
timezone | string | - |
uid | integer | - |
wid | integer | - |
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
POST Change a lost password​
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id}/lost_password
Request a change password action
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id}/lost_password \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/users/{user_id}/lost_password")
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}/lost_password')
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}/users/{user_id}/lost_password", {
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}/users/{user_id}/lost_password', 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}/users/{user_id}/lost_password".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​
The reset password URL
name | type | description |
---|---|---|
url | string | - |
400​
Possible error messages:
* Workspace not found
* User not found
* Workspace needs to have the Edit team members profile feature enabled
403​
User does not have access to this resource.
404​
Possible error messages:
* Workspace not found
* User 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" \
-u <email>:<password>
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")
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"
request.