Skip to main content
POST
/
automations
/
invoke
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: 'My API Key',
});

const automationInvokeResponse = await client.automations.invoke.invokeAdHoc({
  automation: {
    cancelation_token: 'delay-send--user-yes--abc-123',
    steps: [
      { action: 'delay', until: '20240408T080910.123' },
      { action: 'send', template: '64TP5HKPFTM8VTK1Y75SJDQX9JK0' },
    ],
  },
  data: { name: 'Foo' },
  profile: { tenant_id: 'abc-123' },
  recipient: 'user-yes',
});

console.log(automationInvokeResponse.runId);
{
  "runId": "1-65f240a0-47a6a120c8374de9bcf9f22c"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
automation
object
required
brand
string | null
data
object | null
profile
object | null
recipient
string | null
template
string | null

Response

200 - application/json
runId
string
required