Organizations
POST Creates a new organization
https://api.track.toggl.com/api/v9/organizations
Creates a new organization with a single workspace and assigns current user as the organization owner
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/api/v9/organizations \
-H "Content-Type: application/json" \
-d '{"name":"string","workspace_name":"string"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"name":"string","workspace_name":"string"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/api/v9/organizations", 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')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"name":"string","workspace_name":"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/organizations", {
method: "POST",
body: {"name":"string","workspace_name":"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/organizations', json='{"name":"string","workspace_name":"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/organizations".to_string())
.json(&serde_json::json!({"name":"string","workspace_name":"string"}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Body
name | type | required | description |
---|---|---|---|
name | string | false | - |
workspace_name | string | false | - |
Response
- 200
- 400
- 403
{"id":{"type":"integer"},"name":{"type":"string"},"workspace_id":{"type":"integer"},"workspace_name":{"type":"string"}}
workspace name must not be longer than 140
GET Organization data
https://api.track.toggl.com/api/v9/organizations/{organization_id}
Returns organization name and current pricing plan
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/organizations/{organization_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/organizations/{organization_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/organizations/{organization_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/organizations/{organization_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/organizations/{organization_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/organizations/{organization_id}".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 |
Response
- 200
- 403
- 404
{"admin":{"type":"boolean"},"at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"id":{"type":"integer"},"is_chargify":{"type":"boolean"},"is_multi_workspace_enabled":{"description":"IsMultiWorkspaceEnabled returns true if organization option is_multi_workspace_enabled is set","type":"boolean"},"max_workspaces":{"type":"integer"},"name":{"type":"string"},"owner":{"type":"boolean"},"pricing_plan_id":{"type":"integer"},"server_deleted_at":{"type":"string","format":"date-time"},"suspended_at":{"type":"string"},"trial_info":{"last_pricing_plan_id":{"type":"integer"},"next_payment_date":{"type":"string"},"trial":{"type":"boolean"},"trial_available":{"type":"boolean"},"trial_end_date":{"type":"string"}},"user_count":{"type":"integer"}}
Invalid organization_id.
PUT Updates an existing organization
https://api.track.toggl.com/api/v9/organizations/{organization_id}
Updates an existing organization
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/organizations/{organization_id} \
-H "Content-Type: application/json" \
-d '{"name":"string"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"name":"string"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/organizations/{organization_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/organizations/{organization_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"name":"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/organizations/{organization_id}", {
method: "PUT",
body: {"name":"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.put('https://api.track.toggl.com/api/v9/organizations/{organization_id}', json='{"name":"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::PUT, "https://api.track.toggl.com/api/v9/organizations/{organization_id}".to_string())
.json(&serde_json::json!({"name":"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. |
Body
name | type | required | description |
---|---|---|---|
name | string | false | - |
Response
- 200
- 400
- 403
OK
organization name too long, maximum length is 140
GET List of users in organization
https://api.track.toggl.com/api/v9/organizations/{organization_id}/users
Returns list of users in organization based on set of url parameters: Result is paginated. Pagination params are returned in headers
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/organizations/{organization_id}/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}/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}/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}/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}/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}/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 |
Query
name | type | required | description |
---|---|---|---|
filter | string | false | Returns records where name or email contains this string |
active_status | string | false | List of active inactive invited comma separated(if not present, all statuses) |
only_admins | string | false | If true returns admins only |
groups | string | false | Comma-separated list of groups ids, returns users belonging to these groups only |
workspaces | string | false | Comma-separated list of workspaces ids, returns users belonging to this workspaces only |
page | integer | false | Page number, default 1 |
per_page | integer | false | Number of items per page, default 50 |
sort_dir | string | false | Values 'asc' or 'desc', result is sorted on 'names' column, default 'asc' |
Response
- 200
- 400
- 403
Successful operation
invalid value sent for 'workspaces'
PATCH Apply changes in bulk to users in an organization
https://api.track.toggl.com/api/v9/organizations/{organization_id}/users
Apply changes in bulk to users in an organization (currently deletion only).
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://api.track.toggl.com/api/v9/organizations/{organization_id}/users \
-H "Content-Type: application/json" \
-d '{}' \
-u <email>:<password>
bytes, err := json.Marshal('{}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodGet,
"https://api.track.toggl.com/api/v9/organizations/{organization_id}/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}/users')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Patch.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/api/v9/organizations/{organization_id}/users", {
method: "PATCH",
body: {},
headers: {
Content-Type: "application/json",
Authorization: `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.patch('https://api.track.toggl.com/api/v9/organizations/{organization_id}/users', json='{}', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
extern crate tokio;
extern crate serde_json;
use reqwest::{Client};
use reqwest::header::{CONTENT_TYPE};
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new().basic_auth("<email>", "<password>");
let json = client.request(Method::PATCH, "https://api.track.toggl.com/api/v9/organizations/{organization_id}/users".to_string())
.json(&serde_json::json!({}))
.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 | required | description |
---|---|---|---|
delete | undefined | false | - |
Response
- 200
- 400
- 403
OK
cannot remove the organization owner user with organization user ID='...'.
PUT Changes a single organization-user
https://api.track.toggl.com/api/v9/organizations/{organization_id}/users/{organization_user_id}
Changes a single organization-user. Can affect the following values:
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/organizations/{organization_id}/users/{organization_user_id} \
-H "Content-Type: application/json" \
-d '{"admin":"boolean","inactive":"boolean","labour_cost":"integer","rate_change_mode":"string"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"admin":"boolean","inactive":"boolean","labour_cost":"integer","rate_change_mode":"string"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/organizations/{organization_id}/users/{organization_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/organizations/{organization_id}/users/{organization_user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"admin":"boolean","inactive":"boolean","labour_cost":"integer","rate_change_mode":"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/organizations/{organization_id}/users/{organization_user_id}", {
method: "PUT",
body: {"admin":"boolean","inactive":"boolean","labour_cost":"integer","rate_change_mode":"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.put('https://api.track.toggl.com/api/v9/organizations/{organization_id}/users/{organization_user_id}', json='{"admin":"boolean","inactive":"boolean","labour_cost":"integer","rate_change_mode":"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::PUT, "https://api.track.toggl.com/api/v9/organizations/{organization_id}/users/{organization_user_id}".to_string())
.json(&serde_json::json!({"admin":"boolean","inactive":"boolean","labour_cost":"integer","rate_change_mode":"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 |
Body
name | type | required | description |
---|---|---|---|
admin | boolean | false | - |
inactive | boolean | false | - |
labour_cost | integer | false | - |
postedFields | undefined | false | - |
rate_change_mode | string | false | - |
Response
- 200
- 400
- 403
- 404
OK
User has multiple organizations
Failed to load user data.
GET Statistics for all workspaces in the organization
https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/statistics
Returns map indexed by workspace ID where each map element contains workspace admins list, members count and groups count.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/statistics \
-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/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/organizations/{organization_id}/workspaces/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/organizations/{organization_id}/workspaces/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/organizations/{organization_id}/workspaces/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/organizations/{organization_id}/workspaces/statistics".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response
- 200
- 403
Successful operation.
Forbidden
PUT Change assignments of users within a workspace.
https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/assignments
Assign or remove users to/from a workspace or to/from groups belonging to said workspace.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/assignments \
-H "Content-Type: application/json" \
-d '{"group_id":"integer","joined":"boolean","operation":"string","user_id":"integer"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"group_id":"integer","joined":"boolean","operation":"string","user_id":"integer"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://api.track.toggl.com/api/v9/organizations/{organization_id}/workspaces/{workspace_id}/assignments", 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}/assignments')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"group_id":"integer","joined":"boolean","operation":"string","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/organizations/{organization_id}/workspaces/{workspace_id}/assignments", {
method: "PUT",
body: {"group_id":"integer","joined":"boolean","operation":"string","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/organizations/{organization_id}/workspaces/{workspace_id}/assignments', json='{"group_id":"integer","joined":"boolean","operation":"string","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/organizations/{organization_id}/workspaces/{workspace_id}/assignments".to_string())
.json(&serde_json::json!({"group_id":"integer","joined":"boolean","operation":"string","user_id":"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 within the organization |
Body
name | type | required | description |
---|---|---|---|
group_id | integer | false | - |
joined | boolean | false | - |
operation | string | false | - |
user_id | integer | false | - |
Response
- 200
- 400
- 403
- 404
OK
Invalid group_id.
Forbidden
Invalid workspace ID.