Skip to content

List a user's organizations

GET
/api/server/v1/users/{userId}/organizations
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.

userId
required
string format: uuid

Identifier of the user whose organizations to list.

Example
01931a73-8b00-7000-8000-000000000000
limit
integer format: int32
default: 20

Maximum number of items in the returned page (default 20).

Example
50
cursor
string format: uuid

Opaque cursor returned by the previous page’s nextCursor. Omit to fetch the first page.

Example
01931a73-8b00-7000-8000-000000000000

Page of memberships (empty when the user belongs to no organization).

Media typeapplication/json

A single page of results in a cursor-paginated list. Pass nextCursor as the cursor query parameter to fetch the following page.

object
items
required

Items in this page, in stable order.

Array<object>
object
organizationId
required
string format: uuid
name
required

The organization’s display name.

string
slug

The organization’s slug, when it has one.

string | null
role
required

This user’s role key in the organization (e.g. org:administrator).

string
roleName

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.

string | null
publicMetadata
required

The MEMBERSHIP’s public metadata bag, not the organization’s.

object
key
additional properties
any
privateMetadata
required

The MEMBERSHIP’s private metadata bag, not the organization’s. Server-only, never exposed to the SDK.

object
key
additional properties
any
joinedAt
required
string format: date-time
nextCursor

Cursor to pass to fetch the next page. Null when this is the last page.

string | null format: uuid
hasMore
required

True if more pages are available (equivalent to nextCursor != null).

boolean
Example
{
"items": [
{
"publicMetadata": {
"seat": "billable"
},
"privateMetadata": {
"crmContactId": "con_123"
}
}
],
"nextCursor": "01931a73-8b00-7000-8000-000000000000",
"hasMore": true
}

Missing or invalid secret key.

Media typeapplication/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
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.

Media typeapplication/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"properties": {
"additionalProperty": "example"
}
}