“Organizations” Endpoint - GET List of users in organization

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

Returns list of users in organization based on set of url parameters: Result is paginated. Pagination params are returned in headers

  • 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::GET, "https://api.track.toggl.com/api/v9/organizations/{organization_id}/users".to_string())  .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

Query

name type required description
filter string false Returns records where name or email contains this string
active_status string false List of active inactive invited comma separated(if not present, all statuses)
only_admins string false If true returns admins only
groups string false Comma-separated list of groups ids, returns users belonging to these groups only
workspaces string false Comma-separated list of workspaces ids, returns users belonging to this workspaces only
page integer false Page number, default 1
per_page integer false Number of items per page, default 50
sort_dir string false Values ‘asc’ or ‘desc’, result is sorted on ‘names’ column, default ‘asc’

Response

200

Name Type Description
items Array of object -
items
Name Type Description
admin boolean Deprecated, to be removed. Use RoleID, or IsAdmin method if you must access this field.
avatar_url string -
can_edit_email boolean -
created_at string -
email string -
groups Array of object -
id integer -
inactive boolean -
invitation_id integer -
joined boolean -
name string -
organization_id integer -
owner boolean Deprecated, to be removed. Use RoleID, or IsOwner method if you must access this field.
role_id integer -
updated_at string -
user_id integer -
workspace_count integer -
workspaces Array of object -
groups
Name Type Description
group_id integer -
name string -
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 -

400

Possible error messages:

  • Missing or invalid organization_id.
  • active_status parameter can contain only ‘active’, ‘inactive’ or ‘invited’.
  • only_admins parameter can contain only ‘true’ or ‘false’.
  • Invalid value sent for ‘page’.
  • page parameter must contain values > 0.
  • Invalid value sent for ‘per_page’.
  • per_page parameter must contain values > 0.
  • sort_dir parameter can contain only ‘asc’ or ‘desc’.
  • Invalid value sent for ‘groups’.
  • Invalid value sent for ‘workspaces’.

403

User is not authorized to list the organization users