“Invitations” Endpoints - POST Creates a new invitation for the user

https://api.track.toggl.com/api/v9/organizations/{organization_id}/invitations

Creates a new invitation for the user.

  • 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/{organization_id}/invitations".to_string()).json(&serde_json::json!(\{"emails":[\{\}],"groups":[\{\}],"project_invite":\{"manager":"boolean","project_id":"integer","workspace_id":"integer"\},"skip_email":"boolean","workspaces":[\{"admin":"boolean","integration_data":\{"external_id":"string","external_type":"string","provider":"string"\},"role":"string","role_id":"integer","workspace_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.

Body

Name Type Description
emails Array of string -
groups Array of integer -
project_invite object -
skip_email boolean -
workspaces Array of object -
project_invite
Name Type Description
manager boolean -
project_id integer -
workspace_id integer -
workspaces
Name Type Description
admin boolean -
integration_data object -
role string -
role_id integer -
workspace_id integer -
integration_data
Name Type Description
external_id string -
external_type string -
provider string -

Response

200

Created user invitations

Name Type Description
data Array of object -
messages Array of string -
data
Name Type Description
email string -
invitation_id integer -
invite_url string -
organization_id integer -
recipient_id integer -
sender_id integer -
workspaces Array of object -
workspaces
Name Type Description
user_id integer -
workspace_id integer -
workspace_user_id integer -

400

Possible error messages:

  • Invalid JSON input
  • Invalid organization id
  • at least one email is required
  • at least one workspace is required
  • Missing e-mail
  • Invalid e-mail: ‘…’
  • invalid workspace ID
  • Active user limit is 5. Upgrade to add more active users
  • Invitation limit reached (please try again later; or upgrade)
  • User with e-mail ‘…’ is already an inactive member of the organization

403

Forbidden