Skip to main content
DELETE
Unenroll Lead
Instruction bots are being retired. They are the older stage-based engine: a lead is enrolled into one and walks a sequence of stages. The engine that replaced them — goal bots — has no stages and no enrolment: you tag a lead and the bot handles their replies.Build new work on goal bots. These endpoints stay up for integrations already using them.
Takes a lead back out of an instruction bot. Conversation history is preserved — only the enrolment state is cleared, so the bot stops picking the lead up. Also answers on DELETE /api/instructions/{id}/enroll.
Goal bots do not use this endpoint. To stop a goal bot handling a lead, remove its trigger tag with PATCH /api/leads/{id}.

Authentication

Pass your workspace API key as a Bearer token, or use a Clerk session token.

Path parameter

string
required
The instruction id the lead is currently enrolled in. A malformed id returns 400 Invalid instruction ID.

Request body

string
required
The lead to unenrol. Missing or malformed returns 400 Valid leadId is required.
DELETE here has a request body. Some HTTP clients drop bodies on DELETE by default — if you get 400 Valid leadId is required with a leadId you know is correct, that is why.

Example

Success (200 OK)

The lead’s stage, turn counter, collected fields and enrolment timestamp are cleared, and the instruction’s stats.inProgress decrements.

Errors