headless lms

Create a workflow automation (staff)

POST /api/automations. Create a workflow automation (staff). Headless LMS Automations API reference.

POST
/api/automations

Staff only (owner, admin, instructor). 400 when a trigger is reserved, not an event the system emits or an unsupported schedule, or an action is reserved for webhooks.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/automations" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "triggers": [      "string"    ],    "actions": [      {        "type": "string",        "input": {          "property1": null,          "property2": null        }      }    ]  }'
{  "orgId": "string",  "id": "string",  "name": "string",  "kind": "workflow",  "description": "string",  "triggers": [    "string"  ],  "actions": [    {      "type": "string",      "input": {        "property1": null,        "property2": null      }    }  ],  "enabled": true,  "filter": {    "property1": null,    "property2": null  },  "source": "system",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}
{  "error": "string",  "message": "string",  "requestId": "string",  "issues": [    {      "path": "string",      "message": "string"    }  ]}
{  "error": "string",  "message": "string",  "requestId": "string"}
{  "error": "string",  "message": "string",  "requestId": "string"}
{  "error": "string",  "message": "string",  "requestId": "string"}