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

const client = new Courier({
  apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});

const tenants = await client.tenants.list();

console.log(tenants.has_more);
{
  "cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
  "has_more": true,
  "items": [
    {
      "id": "tenant_abc",
      "name": "Example Name",
      "parent_tenant_id": "tenant_abc",
      "default_preferences": {
        "items": [
          {
            "status": "OPTED_OUT",
            "has_custom_routing": true,
            "custom_routing": [
              "direct_message"
            ],
            "id": "PT91W47CKEMP6PW0RYVN3F08F2YE"
          }
        ]
      },
      "properties": {},
      "user_profile": {},
      "brand_id": "VWNG5GW9DE80VKKVQNFN1ENXEYG3"
    }
  ],
  "next_url": "https://example.com",
  "url": "https://example.com",
  "type": "list"
}

Authorizations

Authorization
string
header
required

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

Query Parameters

parent_tenant_id
string | null

Filter the list of tenants by parent_id

limit
integer | null

The number of tenants 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.

items
Tenant · object[]
required

An array of Tenants

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
cursor
string | null

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

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