Skip to main content
GET
/
automations
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 automationTemplateListResponse = await client.automations.list();

console.log(automationTemplateListResponse.cursor);
{ "templates": [ { "name": "Welcome Email Automation", "id": "abc-123-def-456", "version": "published", "createdAt": "2024-01-01T00:00:00Z", "updatedAt": "2024-01-02T00:00:00Z" }, { "name": "Order Confirmation", "id": "xyz-789-ghi-012", "version": "published", "createdAt": "2024-01-03T00:00:00Z", "updatedAt": "2024-01-04T00:00:00Z" } ], "cursor": "eyJpZCI6InRlbXBsYXRlLTIifQ==" }

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

cursor
string

A cursor token for pagination. Use the cursor from the previous response to fetch the next page of results.

version
enum<string>
default:published

The version of templates to retrieve. Accepted values are published (for published templates) or draft (for draft templates). Defaults to published.

Available options:
published,
draft

Response

templates
AutomationTemplate · object[]
cursor
string

A cursor token for pagination. Present when there are more results available.