API Reference
The reference below covers every endpoint in the Workflows API. Code examples are generated automatically; the live playground is disabled to prevent accidental writes to production from the docs site.
/api/v1/workflowsAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Query Parameters
Only workflows on this record type. Case-insensitive.
Value in
- "LEAD"
- "CONTACT"
- "DEAL"
- "EMAIL"
- "TASK"
Value in
- "CREATED"
- "STATUS_CHANGED"
- "STAGE_CHANGED"
- "REPLY_RECEIVED"
- "STALLED"
- "TIME_IN_STAGE"
Value in
- "true"
- "false"
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/workflows"{ "workflows": [ { "id": "string", "name": "string", "entity": "LEAD", "trigger": "CREATED", "active": true, "conditions": [ { "field": "string", "op": "eq", "value": "string" } ], "triggerConfig": { "idleDays": 1, "stage": "NEW", "days": 1 }, "actions": [ { "type": "CREATE_TASK" } ], "runCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } ]}{ "error": "products must not be empty."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:workflows."}/api/v1/workflowsAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/workflows" \ -H "Content-Type: application/json" \ -d '{ "name": "Round-robin web leads", "entity": "LEAD", "trigger": "CREATED", "conditions": [ { "field": "source", "op": "contains", "value": "Web form" } ], "actions": [ { "type": "ASSIGN_ROUND_ROBIN" }, { "type": "CREATE_TASK", "title": "Call within a day", "dueInDays": 1, "assignToOwner": true } ] }'{ "workflow": { "id": "string", "name": "string", "entity": "LEAD", "trigger": "CREATED", "active": true, "conditions": [ { "field": "string", "op": "eq", "value": "string" } ], "triggerConfig": { "idleDays": 1, "stage": "NEW", "days": 1 }, "actions": [ { "type": "CREATE_TASK" } ], "runCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}{ "error": "The REPLY_RECEIVED trigger only works on CONTACT workflows."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:workflows."}/api/v1/workflows/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/workflows/string"{ "workflow": { "id": "string", "name": "string", "entity": "LEAD", "trigger": "CREATED", "active": true, "conditions": [ { "field": "string", "op": "eq", "value": "string" } ], "triggerConfig": { "idleDays": 1, "stage": "NEW", "days": 1 }, "actions": [ { "type": "CREATE_TASK" } ], "runCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:workflows."}{ "error": "Workflow not found."}/api/v1/workflows/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
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 PATCH "https://example.com/api/v1/workflows/string" \ -H "Content-Type: application/json" \ -d '{ "active": false }'{ "workflow": { "id": "string", "name": "string", "entity": "LEAD", "trigger": "CREATED", "active": true, "conditions": [ { "field": "string", "op": "eq", "value": "string" } ], "triggerConfig": { "idleDays": 1, "stage": "NEW", "days": 1 }, "actions": [ { "type": "CREATE_TASK" } ], "runCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}{ "error": "products must not be empty."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:workflows."}{ "error": "Workflow not found."}/api/v1/workflows/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/api/v1/workflows/string"{ "deleted": 1, "id": "string"}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:workflows."}{ "error": "Workflow not found."}/api/v1/workflows/{id}/runsAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
Query Parameters
1 <= value <= 10050Value in
- "OK"
- "ERROR"
- "SKIPPED"
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/workflows/string/runs"{ "runs": [ { "id": "string", "recordId": "string", "status": "OK", "detail": "string", "at": "2019-08-24T14:15:22Z" } ]}{ "error": "products must not be empty."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:workflows."}{ "error": "Workflow not found."}