JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const journeyTemplateListResponse = await client.journeys.templates.list('x');
console.log(journeyTemplateListResponse.paging);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
journey_template_list_response = client.journeys.templates.list(
template_id="x",
)
print(journey_template_list_response.paging)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go/v4"
"github.com/trycourier/courier-go/v4/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
journeyTemplateListResponse, err := client.Journeys.Templates.List(
context.TODO(),
"x",
courier.JourneyTemplateListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", journeyTemplateListResponse.Paging)
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.journeys.JourneyTemplateListResponse;
import com.courier.models.journeys.templates.TemplateListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
JourneyTemplateListResponse journeyTemplateListResponse = client.journeys().templates().list("x");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
journey_template_list_response = courier.journeys.templates.list("x")
puts(journey_template_list_response)<?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 {
$journeyTemplateListResponse = $client->journeys->templates->list(
'x', cursor: 'cursor', limit: 1
);
var_dump($journeyTemplateListResponse);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Journeys.Templates;
CourierClient client = new();
TemplateListParams parameters = new() { TemplateID = "x" };
var journeyTemplateListResponse = await client.Journeys.Templates.List(parameters);
Console.WriteLine(journeyTemplateListResponse);courier journeys:templates list \
--api-key 'My API Key' \
--template-id xcurl --request GET \
--url https://api.courier.com/journeys/{templateId}/templates \
--header 'Authorization: Bearer <token>'{
"results": [
{
"id": "nt_01kx4m9ntsfk6vny0k8crygtc5",
"name": "Welcome email",
"tags": [],
"state": "PUBLISHED",
"created": 1715000000000,
"creator": "user-1"
},
{
"id": "nt_01kx4m9ntsfk6vny0zvwbzpnpb",
"name": "Welcome push",
"tags": [],
"state": "PUBLISHED",
"created": 1715000100000,
"creator": "user-1"
}
],
"paging": {
"more": false
}
}{
"message": "Example message text",
"type": "invalid_request_error"
}{
"message": "Example message text",
"type": "invalid_request_error"
}Journeys
List notification templates scoped to a journey
List notification templates scoped to this journey. Journey-scoped notification templates can only be referenced from send nodes within the same journey.
GET
/
journeys
/
{templateId}
/
templates
JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const journeyTemplateListResponse = await client.journeys.templates.list('x');
console.log(journeyTemplateListResponse.paging);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
journey_template_list_response = client.journeys.templates.list(
template_id="x",
)
print(journey_template_list_response.paging)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go/v4"
"github.com/trycourier/courier-go/v4/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
journeyTemplateListResponse, err := client.Journeys.Templates.List(
context.TODO(),
"x",
courier.JourneyTemplateListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", journeyTemplateListResponse.Paging)
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.journeys.JourneyTemplateListResponse;
import com.courier.models.journeys.templates.TemplateListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
JourneyTemplateListResponse journeyTemplateListResponse = client.journeys().templates().list("x");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
journey_template_list_response = courier.journeys.templates.list("x")
puts(journey_template_list_response)<?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 {
$journeyTemplateListResponse = $client->journeys->templates->list(
'x', cursor: 'cursor', limit: 1
);
var_dump($journeyTemplateListResponse);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Journeys.Templates;
CourierClient client = new();
TemplateListParams parameters = new() { TemplateID = "x" };
var journeyTemplateListResponse = await client.Journeys.Templates.List(parameters);
Console.WriteLine(journeyTemplateListResponse);courier journeys:templates list \
--api-key 'My API Key' \
--template-id xcurl --request GET \
--url https://api.courier.com/journeys/{templateId}/templates \
--header 'Authorization: Bearer <token>'{
"results": [
{
"id": "nt_01kx4m9ntsfk6vny0k8crygtc5",
"name": "Welcome email",
"tags": [],
"state": "PUBLISHED",
"created": 1715000000000,
"creator": "user-1"
},
{
"id": "nt_01kx4m9ntsfk6vny0zvwbzpnpb",
"name": "Welcome push",
"tags": [],
"state": "PUBLISHED",
"created": 1715000100000,
"creator": "user-1"
}
],
"paging": {
"more": false
}
}{
"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:
1Query Parameters
Pagination cursor from a prior response.
Page size. Minimum 1, maximum 100.
Required range:
1 <= x <= 100⌘I