Skip to main content

Invoke an Automation

Invoke an automation run from an automation template.

URL: https://api.courier.com/automations/:templateId/invoke

Method: POST

Path Parameters

templateIdstringrequired
A unique identifier representing the automation template to be invoked. This could be the Automation Template ID or the Automation Template Alias.

Body Parameters

brandstring
A unique identifier that represents the brand that should be used for rendering the notification.
templatestring
A unique identifier that can be mapped to an individual Notification. This could be the "Notification ID” on Notification detail pages (see the Notifications page in the Courier app) or a custom string mapped to the event in settings.
recipientstring
A unique identifier associated with the recipient of the delivered message.
datajson
An object that includes any data you want to pass to the automation. This data can be referenced throughout the automation using refs.data. The data will also be passed along to any send call made by the automation.
profilejson
An object that includes any key-value pairs required by your chosen Integrations (see our Provider Documentation for the requirements for each Integration.) If profile information is included in the request and that information already exists in the profile for the recipientId, that information will be merged.

Response

status: 200 OK

runIdstring
A unique identifier associated with the automation run.

Request Example

curl --request POST \
--url https://api.courier.com/automations/:templateId/invoke \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"brand": "W50NC77P524K14M5300PGPEK4JMJ",
"template": "EXAMPLE_NOTIFICATION",
"recipient": "8ec8c99a-c5f7-455b-9f60-8222b8a27056",
"data": {
"name": "Jane Doe",
"age": 27
},
"profile": {
"phone_number": "2025550125",
"email": "hello@example.com"
}
}
'

Responses Example

{
"runId": "1-5e2b2615-05efbb3acab9172f88dd3f6f"
}

Example

Method: POST

URL: https://api.courier.com/automations/S6CME56DCCM6DVQA7CVZR1MTPFPA/invoke

Body: ​

{
"brand": "W50NC77P524K14M5300PGPEK4JMJ",
"template": "S6CME56DCCM6DVQA7CVZR1MTPFPA",
"recipient": "8ec8c99a-c5f7-455b-9f60-8222b8a27056",
"data": {
"name": "Jane Doe",
"age": 27
},
"profile": {
"phone_number": "2025550125",
"email": "hello@example.com"
}
}
Was this helpful?