Stop Automation
/leads/{id}/automation/stop
Stops all AI automation for a lead's active workflow run. The AI will no longer respond to messages, cadence is paused, and pending scheduled tasks are cancelled.
Use this when a human agent takes over the conversation or the lead requests to stop being contacted.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | Lead ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
workflow_id | string (uuid) | Yes | Workflow to stop automation for |
Example
curl -X POST https://api.getnexor.ai/api/public/leads/lead-uuid/automation/stop \
-H "Content-Type: application/json" \
-H "X-API-Key: nxr_live_your_api_key" \
-d '{ "workflow_id": "workflow-uuid" }'
Responses
200 — Automation stopped
{
"success": true,
"workflow_run_id": "run-uuid",
"cadence_paused": true,
"tasks_cancelled": 2
}
If already stopped:
{
"success": true,
"already_stopped": true,
"workflow_run_id": "run-uuid"
}
Response Fields
| Field | Type | Description |
|---|---|---|
workflow_run_id | string | The workflow run that was stopped |
cadence_paused | boolean | Whether cadence was paused |
tasks_cancelled | integer | Number of pending tasks that were cancelled |
already_stopped | boolean | Returned if automation was already stopped (idempotent) |
400 — Missing workflow_id
{
"error": "workflow_id is required"
}
404 — No active run found
{
"error": "No active workflow run found for this lead and workflow"
}
This also applies if the lead is in a terminal status (e.g., expired, converted).
401 — Authentication error
See Authentication.