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.archive('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.archive(
"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.Archive(context.TODO(), "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.JourneyArchiveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
client.journeys().archive("x");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.journeys.archive("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->archive('x');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Journeys;
CourierClient client = new();
JourneyArchiveParams parameters = new() { TemplateID = "x" };
await client.Journeys.Archive(parameters);courier journeys archive \
--api-key 'My API Key' \
--template-id xcurl --request DELETE \
--url https://api.courier.com/journeys/{templateId} \
--header 'Authorization: Bearer <token>'{
"message": "Example message text",
"type": "invalid_request_error"
}{
"message": "Example message text",
"type": "invalid_request_error"
}Journeys
Archive a journey
Archives a journey so it can no longer be invoked. Runs already in flight continue to completion, so archiving never strands a user mid-sequence.
DELETE
/
journeys
/
{templateId}
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.archive('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.archive(
"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.Archive(context.TODO(), "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.JourneyArchiveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
client.journeys().archive("x");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.journeys.archive("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->archive('x');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Journeys;
CourierClient client = new();
JourneyArchiveParams parameters = new() { TemplateID = "x" };
await client.Journeys.Archive(parameters);courier journeys archive \
--api-key 'My API Key' \
--template-id xcurl --request DELETE \
--url https://api.courier.com/journeys/{templateId} \
--header 'Authorization: Bearer <token>'{
"message": "Example message text",
"type": "invalid_request_error"
}{
"message": "Example message text",
"type": "invalid_request_error"
}⌘I