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
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","labor_cost":"number","labor_cost_change_mode":"string","postedFields":[\{\}],"rate":"number","rate_change_mode":"string","role":"string","role_id":"integer","view_edit_billable_rates":"boolean","view_edit_labor_costs":"boolean","working_hours_in_minutes":"integer"\})) .header(CONTENT_TYPE, "application/json") .send() .await? .json() .await?; println!("{:#?}", json); Ok(())}
Parameters
Path
name | type | required | description |
---|---|---|---|
organization_id | integer | true | Numeric ID of the organization |
Body
Name | Type | Description |
---|---|---|
admin | boolean | deprecated |
inactive | boolean | - |
labor_cost | number | Custom labor cost for project user |
labor_cost_change_mode | string | - |
postedFields | Array of string | for explicit NULL-s, add field name here |
rate | number | Paid feature |
rate_change_mode | string | Paid feature |
role | string | Allowed inputs: “admin”, “user”, “projectlead” and “teamlead” |
role_id | integer | - |
view_edit_billable_rates | boolean | - |
view_edit_labor_costs | boolean | - |
working_hours_in_minutes | integer | Paid feature |
Response
200
OK
400
Possible error messages:
- Missing or invalid organization_id.
- Invalid role_id.
- Cannot use both admin flags and role_id.
- User does not exist in the organization.
- At least one field is required.
- Field ‘name’ cannot be empty.
- Missing e-mail.
- Invalid e-mail: ‘…’
- Email already exists.
- Group ‘…’ is not in Organization ‘…’.
- Workspace ‘…’ is not in Organization ‘…’.
- Cannot remove admin privileges from owner.
- Cannot deactivate owner.
- Cannot remove admin privileges from paying user.
- Cannot deactivate paying user.
- User has multiple organizations.
- Invalid organization role.
- Invalid role ID: 1234.
- Invalid workspace role with ID: 1234.
403
User is not authorized to update the organization user
404
Possible error messages:
- Invalid organization user ID.
- Failed to load user data.