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
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 | Description |
---|---|---|
name | string | Name of the organization |
workspace_name | string | Name of the workspace |
Response
200
Organization and workspace IDs
Name | Type | Description |
---|---|---|
id | integer | - |
name | string | - |
permissions | string | - |
workspace_id | integer | - |
workspace_name | string | - |
400
Possible error messages:
- Invalid JSON input
- Field ‘name’ cannot be empty.
- organization name too long, maximum length is 140
- workspace name must contain non-space characters
- workspace name must be provided
- workspace name must not be longer than 140
403
User is not authorized to create an organization