JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
await client.users.tenants.removeSingle('tenant_id', { user_id: 'user_id' });import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
client.users.tenants.remove_single(
tenant_id="tenant_id",
user_id="user_id",
)package main
import (
"context"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Users.Tenants.RemoveSingle(
context.TODO(),
"tenant_id",
courier.UserTenantRemoveSingleParams{
UserID: "user_id",
},
)
if err != nil {
panic(err.Error())
}
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.users.tenants.TenantRemoveSingleParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
TenantRemoveSingleParams params = TenantRemoveSingleParams.builder()
.userId("user_id")
.tenantId("tenant_id")
.build();
client.users().tenants().removeSingle(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.users.tenants.remove_single("tenant_id", user_id: "user_id")
puts(result)<?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 {
$result = $client->users->tenants->removeSingle(
'tenant_id', userID: 'user_id'
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Users.Tenants;
CourierClient client = new();
TenantRemoveSingleParams parameters = new()
{
UserID = "user_id",
TenantID = "tenant_id",
};
await client.Users.Tenants.RemoveSingle(parameters);courier users:tenants remove-single \
--api-key 'My API Key' \
--user-id user_id \
--tenant-id tenant_idcurl --request DELETE \
--url https://api.courier.com/users/{user_id}/tenants/{tenant_id} \
--header 'Authorization: Bearer <token>'User Tenants
Remove User from a Tenant
Removes a user from the supplied tenant.
DELETE
/
users
/
{user_id}
/
tenants
/
{tenant_id}
JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
await client.users.tenants.removeSingle('tenant_id', { user_id: 'user_id' });import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
client.users.tenants.remove_single(
tenant_id="tenant_id",
user_id="user_id",
)package main
import (
"context"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Users.Tenants.RemoveSingle(
context.TODO(),
"tenant_id",
courier.UserTenantRemoveSingleParams{
UserID: "user_id",
},
)
if err != nil {
panic(err.Error())
}
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.users.tenants.TenantRemoveSingleParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
TenantRemoveSingleParams params = TenantRemoveSingleParams.builder()
.userId("user_id")
.tenantId("tenant_id")
.build();
client.users().tenants().removeSingle(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.users.tenants.remove_single("tenant_id", user_id: "user_id")
puts(result)<?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 {
$result = $client->users->tenants->removeSingle(
'tenant_id', userID: 'user_id'
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Users.Tenants;
CourierClient client = new();
TenantRemoveSingleParams parameters = new()
{
UserID = "user_id",
TenantID = "tenant_id",
};
await client.Users.Tenants.RemoveSingle(parameters);courier users:tenants remove-single \
--api-key 'My API Key' \
--user-id user_id \
--tenant-id tenant_idcurl --request DELETE \
--url https://api.courier.com/users/{user_id}/tenants/{tenant_id} \
--header 'Authorization: Bearer <token>'Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Id of the user to be removed from the supplied tenant.
Id of the tenant the user should be removed from.
Response
204 - undefined
⌘I