Create an automation

Creates an automation: when a contact submits the trigger event, the linked email template is rendered with their attributes and sent to them automatically.

POST/v2/accounts/{accountId}/automations

Base URL https://api.sendstreak.com. All v2 endpoints require a bearer token - see Authentication.

Path parameters

accountIdstringrequired

The account the request is scoped to.

Request body

Request body for creating or updating an automation. Update is a PATCH but takes the complete object, so both calls need every required field.

namestringrequired

Name of the automation, shown on the dashboard.

templateIdstringrequired

Id of the email template the automation sends.

triggerEventSlugstringrequired

Contact event that triggers the send - see List event names.

triggerEventConditionone of: once, everytimerequired

Send on the first occurrence of the event only, or on every occurrence. Only once is accepted when timingCondition is x_days_after.

timingConditionone of: immediately, x_days_afterrequired

Send as soon as the event arrives, or a number of days later. x_days_after additionally requires timingValue.

timingValueintegeroptional

Whole days to wait before sending. Required when timingCondition is x_days_after, omit it otherwise.

isEnabledbooleanrequired

Whether the automation fires; create it disabled to configure before going live.

Response

The created automation.

Errors

400

The request body or parameters failed validation.

401

Missing or invalid token, or the token is not authorized for this account/user.

See Errors and rate limits for what error responses look like.

curl --location --request POST 'https://api.sendstreak.com/v2/accounts/YOUR_ACCOUNT_ID/automations' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Example name",
  "templateId": "6650cc1d3e8a220013ef78ab",
  "triggerEventSlug": "signup",
  "triggerEventCondition": "once",
  "timingCondition": "immediately",
  "timingValue": 3,
  "isEnabled": false
}'
response200application/json
{
  "_id": "665f0a2b1c9d440012ab34cd",
  "name": "Example name",
  "templateId": "6650cc1d3e8a220013ef78ab",
  "triggerEventSlug": "signup",
  "triggerEventCondition": "once",
  "timingCondition": "immediately",
  "timingValue": 3,
  "isEnabled": false,
  "createDate": "2026-07-07T09:30:00.000Z"
}