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.journeys.templates.archive('x', { templateId: 'x' });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.journeys.templates.archive(
notification_id="x",
template_id="x",
)package main
import (
"context"
"github.com/trycourier/courier-go/v4"
"github.com/trycourier/courier-go/v4/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Journeys.Templates.Archive(
context.TODO(),
"x",
courier.JourneyTemplateArchiveParams{
TemplateID: "x",
},
)
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.journeys.templates.TemplateArchiveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
TemplateArchiveParams params = TemplateArchiveParams.builder()
.templateId("x")
.notificationId("x")
.build();
client.journeys().templates().archive(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.journeys.templates.archive("x", template_id: "x")
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->journeys->templates->archive('x', templateID: 'x');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Journeys.Templates;
CourierClient client = new();
TemplateArchiveParams parameters = new()
{
TemplateID = "x",
NotificationID = "x",
};
await client.Journeys.Templates.Archive(parameters);courier journeys:templates archive \
--api-key 'My API Key' \
--template-id x \
--notification-id xcurl --request DELETE \
--url https://api.courier.com/journeys/{templateId}/templates/{notificationId} \
--header 'Authorization: Bearer <token>'{
"message": "Example message text",
"type": "invalid_request_error"
}{
"message": "Example message text",
"type": "invalid_request_error"
}Journeys
Archive a journey-scoped notification template
Archives one journey’s notification template, preventing further sends. Detach any send node referencing it beforehand.
DELETE
/
journeys
/
{templateId}
/
templates
/
{notificationId}
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.journeys.templates.archive('x', { templateId: 'x' });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.journeys.templates.archive(
notification_id="x",
template_id="x",
)package main
import (
"context"
"github.com/trycourier/courier-go/v4"
"github.com/trycourier/courier-go/v4/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Journeys.Templates.Archive(
context.TODO(),
"x",
courier.JourneyTemplateArchiveParams{
TemplateID: "x",
},
)
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.journeys.templates.TemplateArchiveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
TemplateArchiveParams params = TemplateArchiveParams.builder()
.templateId("x")
.notificationId("x")
.build();
client.journeys().templates().archive(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.journeys.templates.archive("x", template_id: "x")
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->journeys->templates->archive('x', templateID: 'x');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Journeys.Templates;
CourierClient client = new();
TemplateArchiveParams parameters = new()
{
TemplateID = "x",
NotificationID = "x",
};
await client.Journeys.Templates.Archive(parameters);courier journeys:templates archive \
--api-key 'My API Key' \
--template-id x \
--notification-id xcurl --request DELETE \
--url https://api.courier.com/journeys/{templateId}/templates/{notificationId} \
--header 'Authorization: Bearer <token>'{
"message": "Example message text",
"type": "invalid_request_error"
}{
"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
Journey id
Minimum string length:
1Notification template id
Minimum string length:
1Response
Archived
⌘I