List a user's organizations
const url = 'https://api.toriiauth.eu/api/server/v1/users/01931a73-8b00-7000-8000-000000000000/organizations?limit=50&cursor=01931a73-8b00-7000-8000-000000000000';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.toriiauth.eu/api/server/v1/users/01931a73-8b00-7000-8000-000000000000/organizations?limit=50&cursor=01931a73-8b00-7000-8000-000000000000' \ --header 'Authorization: Bearer <token>'Returns a cursor-paginated page of the organizations this user is a member of, with the user’s role in each and that membership’s metadata bags. The mirror image of listing an organization’s members. Note the bags are the MEMBERSHIP’s, not the organization’s: read the organization itself for those.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Identifier of the user whose organizations to list.
Example
01931a73-8b00-7000-8000-000000000000Query Parameters
Section titled “Query Parameters”Maximum number of items in the returned page (default 20).
Example
50Opaque cursor returned by the previous page’s nextCursor. Omit to fetch the first page.
Example
01931a73-8b00-7000-8000-000000000000Responses
Section titled “Responses”Page of memberships (empty when the user belongs to no organization).
A single page of results in a cursor-paginated list. Pass nextCursor as the cursor query parameter to fetch the following page.
object
Items in this page, in stable order.
object
The organization’s display name.
The organization’s slug, when it has one.
This user’s role key in the organization (e.g. org:administrator).
Display name of that role, from the organization’s bound role set. Null when the organization has no bound set or the key is not in it.
The MEMBERSHIP’s public metadata bag, not the organization’s.
object
The MEMBERSHIP’s private metadata bag, not the organization’s. Server-only, never exposed to the SDK.
object
Cursor to pass to fetch the next page. Null when this is the last page.
True if more pages are available (equivalent to nextCursor != null).
Example
{ "items": [ { "publicMetadata": { "seat": "billable" }, "privateMetadata": { "crmContactId": "con_123" } } ], "nextCursor": "01931a73-8b00-7000-8000-000000000000", "hasMore": true}Missing or invalid secret key.
object
object
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }}The user belongs to a different environment, or no user has this id: the two are deliberately indistinguishable so a key cannot probe for foreign user ids.
object
object
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }}