Skip to main content
GET
/
users
/
{user_id}
/
tenants
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: 'My API Key',
});

const tenants = await client.users.tenants.list('user_id');

console.log(tenants.has_more);
{
  "items": [
    {
      "user_id": "<string>",
      "type": "user",
      "tenant_id": "<string>",
      "profile": {}
    }
  ],
  "has_more": true,
  "url": "<string>",
  "next_url": "<string>",
  "cursor": "<string>",
  "type": "list"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

user_id
string
required

Id of the user to retrieve all associated tenants for.

Query Parameters

limit
integer | null

The number of accounts to return (defaults to 20, maximum value of 100)

cursor
string | null

Continue the pagination with the next cursor

Response

200 - application/json
has_more
boolean
required

Set to true when there are more pages that can be retrieved.

url
string
required

A url that may be used to generate these results.

type
enum<string>
required

Always set to list. Represents the type of this object.

Available options:
list
items
UserTenantAssociation · object[] | null
next_url
string | null

A url that may be used to generate fetch the next set of results. Defined only when has_more is set to true

cursor
string | null

A pointer to the next page of results. Defined only when has_more is set to true