“Workspace” Endpoints - 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
extern crate tokio;extern crate serde_json;use reqwest::{Client};use reqwest::header::{CONTENT_TYPE};#[tokio::main]async fn main() -> Result<(), reqwest::Error> {  let client = Client::new().basic_auth("<email>", "<password>");  let json = client.request(Method::PUT, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/workspace_users/{workspace_user_id}".to_string()).json(&serde_json::json!(\{"email":"string","groups":[\{\}],"inactive":"boolean","name":"string","organization_admin":"boolean","role_id":"integer","workspaces":[\{"admin":"boolean","cost":"number","default_currency":"string","groups":[\{"group_id":"integer","name":"string"\}],"inactive":"boolean","rate":"number","role":"string","role_id":"integer","view_edit_billable_rates":"boolean","view_edit_labor_costs":"boolean","working_hours":"number","workspace_id":"integer","workspace_name":"string","workspace_user_id":"integer"\}]\}))  .header(CONTENT_TYPE, "application/json")  .send()  .await?  .json()  .await?;    println!("{:#?}", json);  Ok(())}

Parameters

Path

name type required description
workspace_id integer true Numeric ID of the workspace
workspace_user_id integer true Numeric ID of the workspace user

Body

Name Type Description
email string -
groups Array of integer -
inactive boolean -
name string -
organization_admin boolean -
role_id integer -
workspaces Array of object -
workspaces
Name Type Description
admin boolean Deprecated, to be removed. Use RoleID, or IsAdmin method if you must access this field.
cost number -
default_currency string -
groups Array of object -
inactive boolean -
rate number -
role string Deprecated, to be removed
role_id integer -
view_edit_billable_rates boolean -
view_edit_labor_costs boolean -
working_hours number -
workspace_id integer -
workspace_name string -
workspace_user_id integer -
groups
Name Type Description
group_id integer -
name string -

Response

200

Successful operation.

400

Possible error messages:

  • Workspace not found/accessible
  • User not found
  • Workspace user not found/accessible by user
  • Working hours must be positive or null
  • Invalid role_id.
  • Cannot use both admin flags and role_id.
  • User does not exist in the organization.
  • User does not exist in the workspace.

403

User does not have access to this resource.

500

Internal Server Error