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 journeysListResponse = await client.journeys.list();
console.log(journeysListResponse.cursor);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
journeys_list_response = client.journeys.list()
print(journeys_list_response.cursor)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
journeysListResponse, err := client.Journeys.List(context.TODO(), courier.JourneyListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", journeysListResponse.Cursor)
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.journeys.JourneyListParams;
import com.courier.models.journeys.JourneysListResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
JourneysListResponse journeysListResponse = client.journeys().list();
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
journeys_list_response = courier.journeys.list
puts(journeys_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 {
$journeysListResponse = $client->journeys->list(
cursor: 'cursor', version: 'published'
);
var_dump($journeysListResponse);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Journeys;
CourierClient client = new();
JourneyListParams parameters = new();
var journeysListResponse = await client.Journeys.List(parameters);
Console.WriteLine(journeysListResponse);courier journeys list \
--api-key 'My API Key'curl --request GET \
--url https://api.courier.com/journeys \
--header 'Authorization: Bearer <token>'{
"templates": [
{
"name": "Welcome Journey",
"id": "jry_01kx4m9ntsfk6vny01z4ttha0p",
"version": "published",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-02T00:00:00Z"
},
{
"name": "Onboarding Flow",
"id": "jry_01kx4m9ntsfk6vny08tx3qssyn",
"version": "published",
"createdAt": "2024-01-03T00:00:00Z",
"updatedAt": "2024-01-04T00:00:00Z"
}
],
"cursor": "eyJpZCI6InRlbXBsYXRlLTIifQ=="
}Journeys
List Journeys
Lists the workspace’s journeys, each carrying a name, state, and enabled flag. Paged by cursor.
GET
/
journeys
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 journeysListResponse = await client.journeys.list();
console.log(journeysListResponse.cursor);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
journeys_list_response = client.journeys.list()
print(journeys_list_response.cursor)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
journeysListResponse, err := client.Journeys.List(context.TODO(), courier.JourneyListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", journeysListResponse.Cursor)
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.journeys.JourneyListParams;
import com.courier.models.journeys.JourneysListResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
JourneysListResponse journeysListResponse = client.journeys().list();
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
journeys_list_response = courier.journeys.list
puts(journeys_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 {
$journeysListResponse = $client->journeys->list(
cursor: 'cursor', version: 'published'
);
var_dump($journeysListResponse);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Journeys;
CourierClient client = new();
JourneyListParams parameters = new();
var journeysListResponse = await client.Journeys.List(parameters);
Console.WriteLine(journeysListResponse);courier journeys list \
--api-key 'My API Key'curl --request GET \
--url https://api.courier.com/journeys \
--header 'Authorization: Bearer <token>'{
"templates": [
{
"name": "Welcome Journey",
"id": "jry_01kx4m9ntsfk6vny01z4ttha0p",
"version": "published",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-02T00:00:00Z"
},
{
"name": "Onboarding Flow",
"id": "jry_01kx4m9ntsfk6vny08tx3qssyn",
"version": "published",
"createdAt": "2024-01-03T00:00:00Z",
"updatedAt": "2024-01-04T00:00:00Z"
}
],
"cursor": "eyJpZCI6InRlbXBsYXRlLTIifQ=="
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
A cursor token for pagination. Use the cursor from the previous response to fetch the next page of results.
The version of journeys to retrieve. Accepted values are published (for published journeys) or draft (for draft journeys). Defaults to published.
Available options:
published, draft ⌘I