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.tenants.preferences.items.delete('topic_id', { tenant_id: 'tenant_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.tenants.preferences.items.delete(
topic_id="topic_id",
tenant_id="tenant_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.Tenants.Preferences.Items.Delete(
context.TODO(),
"topic_id",
courier.TenantPreferenceItemDeleteParams{
TenantID: "tenant_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.tenants.preferences.items.ItemDeleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
ItemDeleteParams params = ItemDeleteParams.builder()
.tenantId("tenant_id")
.topicId("topic_id")
.build();
client.tenants().preferences().items().delete(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.tenants.preferences.items.delete("topic_id", tenant_id: "tenant_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->tenants->preferences->items->delete(
'topic_id', tenantID: 'tenant_id'
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Tenants.Preferences.Items;
CourierClient client = new();
ItemDeleteParams parameters = new()
{
TenantID = "tenant_id",
TopicID = "topic_id",
};
await client.Tenants.Preferences.Items.Delete(parameters);courier tenants:preferences:items delete \
--api-key 'My API Key' \
--tenant-id tenant_id \
--topic-id topic_idcurl --request DELETE \
--url https://api.courier.com/tenants/{tenant_id}/default_preferences/items/{topic_id} \
--header 'Authorization: Bearer <token>'Tenants
Remove Default Preferences For Topic
DELETE
/
tenants
/
{tenant_id}
/
default_preferences
/
items
/
{topic_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.tenants.preferences.items.delete('topic_id', { tenant_id: 'tenant_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.tenants.preferences.items.delete(
topic_id="topic_id",
tenant_id="tenant_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.Tenants.Preferences.Items.Delete(
context.TODO(),
"topic_id",
courier.TenantPreferenceItemDeleteParams{
TenantID: "tenant_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.tenants.preferences.items.ItemDeleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
ItemDeleteParams params = ItemDeleteParams.builder()
.tenantId("tenant_id")
.topicId("topic_id")
.build();
client.tenants().preferences().items().delete(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.tenants.preferences.items.delete("topic_id", tenant_id: "tenant_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->tenants->preferences->items->delete(
'topic_id', tenantID: 'tenant_id'
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Tenants.Preferences.Items;
CourierClient client = new();
ItemDeleteParams parameters = new()
{
TenantID = "tenant_id",
TopicID = "topic_id",
};
await client.Tenants.Preferences.Items.Delete(parameters);courier tenants:preferences:items delete \
--api-key 'My API Key' \
--tenant-id tenant_id \
--topic-id topic_idcurl --request DELETE \
--url https://api.courier.com/tenants/{tenant_id}/default_preferences/items/{topic_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 tenant to update the default preferences for.
Id of the subscription topic you want to have a default preference for.
Response
204 - undefined
⌘I