Skip to main content
GET
/
tenants
/
{tenant_id}
/
users
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 response = await client.tenants.listUsers('tenant_id');

console.log(response.has_more);
import os
from courier import Courier

client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
response = client.tenants.list_users(
tenant_id="tenant_id",
)
print(response.has_more)
package main

import (
"context"
"fmt"

"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)

func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Tenants.ListUsers(
context.TODO(),
"tenant_id",
courier.TenantListUsersParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.HasMore)
}
package com.courier.example;

import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.tenants.TenantListUsersParams;
import com.courier.models.tenants.TenantListUsersResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();

TenantListUsersResponse response = client.tenants().listUsers("tenant_id");
}
}
require "courier"

courier = Courier::Client.new(api_key: "My API Key")

response = courier.tenants.list_users("tenant_id")

puts(response)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Courier\Client;
use Courier\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');

try {
$response = $client->tenants->listUsers(
'tenant_id', cursor: 'cursor', limit: 0
);

var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}
using System;
using TryCourier;
using TryCourier.Models.Tenants;

CourierClient client = new();

TenantListUsersParams parameters = new() { TenantID = "tenant_id" };

var response = await client.Tenants.ListUsers(parameters);

Console.WriteLine(response);
courier tenants list-users \
--api-key 'My API Key' \
--tenant-id tenant_id
curl --request GET \
--url https://api.courier.com/tenants/{tenant_id}/users \
--header 'Authorization: Bearer <token>'
{
  "items": [
    {
      "user_id": "user_123",
      "type": "user",
      "tenant_id": "tenant_abc",
      "profile": {}
    }
  ],
  "has_more": true,
  "url": "https://example.com",
  "next_url": "https://example.com",
  "cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
  "type": "list"
}
{
"message": "Example message text",
"type": "invalid_request_error"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

tenant_id
string
required

Id of the tenant for user membership.

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

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