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.templates.delete('template_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.templates.delete(
template_id="template_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.Templates.Delete(
context.TODO(),
"template_id",
courier.TenantTemplateDeleteParams{
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.templates.TemplateDeleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
TemplateDeleteParams params = TemplateDeleteParams.builder()
.tenantId("tenant_id")
.templateId("template_id")
.build();
client.tenants().templates().delete(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.tenants.templates.delete("template_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->templates->delete(
'template_id', tenantID: 'tenant_id'
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Tenants.Templates;
CourierClient client = new();
TemplateDeleteParams parameters = new()
{
TenantID = "tenant_id",
TemplateID = "template_id",
};
await client.Tenants.Templates.Delete(parameters);courier tenants:templates delete \
--api-key 'My API Key' \
--tenant-id tenant_id \
--template-id template_idcurl --request DELETE \
--url https://api.courier.com/tenants/{tenant_id}/templates/{template_id} \
--header 'Authorization: Bearer <token>'{
"message": "Example message text",
"type": "invalid_request_error"
}Tenant Templates
Delete a Tenant Template
Deletes a tenant’s notification template by id. Sends for that tenant then use the workspace template registered under the same id.
DELETE
/
tenants
/
{tenant_id}
/
templates
/
{template_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.templates.delete('template_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.templates.delete(
template_id="template_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.Templates.Delete(
context.TODO(),
"template_id",
courier.TenantTemplateDeleteParams{
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.templates.TemplateDeleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
TemplateDeleteParams params = TemplateDeleteParams.builder()
.tenantId("tenant_id")
.templateId("template_id")
.build();
client.tenants().templates().delete(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.tenants.templates.delete("template_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->templates->delete(
'template_id', tenantID: 'tenant_id'
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Tenants.Templates;
CourierClient client = new();
TemplateDeleteParams parameters = new()
{
TenantID = "tenant_id",
TemplateID = "template_id",
};
await client.Tenants.Templates.Delete(parameters);courier tenants:templates delete \
--api-key 'My API Key' \
--tenant-id tenant_id \
--template-id template_idcurl --request DELETE \
--url https://api.courier.com/tenants/{tenant_id}/templates/{template_id} \
--header 'Authorization: Bearer <token>'{
"message": "Example message text",
"type": "invalid_request_error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Id of the tenant that owns the template.
Id of the template to remove from the tenant.
Response
Template deleted successfully
⌘I