Automations API
The Automations API allows you to programmatically manage your automation workflows, including creating, updating, and triggering automations.
List Automations
Retrieves a list of all automations in your account.
GET /api/automations
Response
[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Welcome Series",
"trigger_type": "subscription",
"is_active": true,
"definition": { "...": "..." },
"created_at": "2023-01-01T00:00:00.000Z",
"total_runs": 150,
"completed_runs": 145
}
]
Get Automation
Retrieves detailed information about a specific automation.
GET /api/automations/:id
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The ID of the automation |
Create Automation
Creates a new automation.
POST /api/automations
Body
| Field | Type | Description |
|---|---|---|
name | string | Required. Name of the automation |
triggerType | string | Required. Type of trigger (e.g., subscription, webhook) |
definition | object | Required. JSON object defining the automation steps |
isActive | boolean | Whether the automation is active (default: true) |
webhookSecret | string | Optional secret for webhook triggers |
Update Automation
Updates an existing automation.
PUT /api/automations/:id
Delete Automation
Deletes an automation.
DELETE /api/automations/:id
Trigger Automation (List)
Manually triggers an automation for all contacts in a specific email list.
POST /api/automations/:id/trigger
Body
| Field | Type | Description |
|---|---|---|
listId | string | Required. ID of the email list to process |
Trigger Automation (Contact)
Manually triggers an automation for a single contact. Useful for testing.
POST /api/automations/:id/test
Body
| Field | Type | Description |
|---|---|---|
contactId | string | Required. ID of the contact to trigger for |
Toggle Automation
Toggles the active state of an automation.
POST /api/automations/:id/toggle
Get Automation Runs
Retrieves the execution history of an automation.
GET /api/automations/:id/runs
Query Parameters
| Name | Type | Description |
|---|---|---|
limit | number | Number of records to return (default: 50) |
offset | number | Pagination offset (default: 0) |