Skip to main content

Stop Automation

POST /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

ParameterTypeRequiredDescription
idstring (uuid)YesLead ID

Request Body

FieldTypeRequiredDescription
workflow_idstring (uuid)YesWorkflow 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

FieldTypeDescription
workflow_run_idstringThe workflow run that was stopped
cadence_pausedbooleanWhether cadence was paused
tasks_cancelledintegerNumber of pending tasks that were cancelled
already_stoppedbooleanReturned 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.