“Preferences” Endpoints - POST update workspace preferences

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/preferences

Update the preferences for 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::POST, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/preferences".to_string()).json(&serde_json::json!(\{"annual-master-campaign-2018":"string","hide_start_end_times":"boolean","inc_tos_accepted_at":"string","inc_tos_accepted_by":"integer","initial_pricing_plan":"integer","january-2018-campaign":"boolean","master_signup":"boolean","report_locked_at":"string","single_sign_on":"boolean","sso_requested_at":"string"\}))  .header(CONTENT_TYPE, "application/json")  .send()  .await?  .json()  .await?;    println!("{:#?}", json);  Ok(())}

Parameters

Path

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

Body

Name Type Description
annual-master-campaign-2018 string Legacy field
hide_start_end_times boolean This workspace works with duration only time entries
inc_tos_accepted_at string Time of acceptance of the terms of service
inc_tos_accepted_by integer User ID who accepted the terms of service
initial_pricing_plan integer Pricing plan ID
january-2018-campaign boolean Legacy field
master_signup boolean Legacy field
report_locked_at string Date on which “Lock Time Entries” feature was enabled
single_sign_on boolean Whether SSO is enabled for this workspace
sso_requested_at string Date on which SSO was requested

Response

200

Name Type Description
logo string -

400

Possible error messages:

  • Workspace not found
  • The field is not writable

402

Workspace needs to have the Locking time entries feature enabled

403

Permission required to update time entries lock setting.

500

Internal Server Error