Unenroll Lead
curl --request DELETE \
--url https://app.tuco.ai/api/goal-bots/{id}/enroll \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leadId": "<string>"
}
'import requests
url = "https://app.tuco.ai/api/goal-bots/{id}/enroll"
payload = { "leadId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({leadId: '<string>'})
};
fetch('https://app.tuco.ai/api/goal-bots/{id}/enroll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.tuco.ai/api/goal-bots/{id}/enroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'leadId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.tuco.ai/api/goal-bots/{id}/enroll"
payload := strings.NewReader("{\n \"leadId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.tuco.ai/api/goal-bots/{id}/enroll")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"leadId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/goal-bots/{id}/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"leadId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyGoal Bots
Unenroll Lead
Unenroll a lead from a Tuco AI goal bot — stops further AI replies and cancels scheduled messages while preserving conversation history.
DELETE
/
api
/
goal-bots
/
{id}
/
enroll
Unenroll Lead
curl --request DELETE \
--url https://app.tuco.ai/api/goal-bots/{id}/enroll \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leadId": "<string>"
}
'import requests
url = "https://app.tuco.ai/api/goal-bots/{id}/enroll"
payload = { "leadId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({leadId: '<string>'})
};
fetch('https://app.tuco.ai/api/goal-bots/{id}/enroll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.tuco.ai/api/goal-bots/{id}/enroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'leadId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.tuco.ai/api/goal-bots/{id}/enroll"
payload := strings.NewReader("{\n \"leadId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.tuco.ai/api/goal-bots/{id}/enroll")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"leadId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/goal-bots/{id}/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"leadId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyInstruction 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.
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.Authorization: Bearer tuco_xxxxxxxxxxxxx
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
curl -X DELETE "https://app.tuco.ai/api/goal-bots/6a970c3429603484fb08b211/enroll" \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "leadId": "6ac3ea0d71adb32c88d56219" }'
Success (200 OK)
{
"success": true,
"message": "Lead unenrolled from instruction"
}
stats.inProgress decrements.
Errors
| Status | When | Body |
|---|---|---|
400 | Malformed {id} | { "error": "Invalid instruction ID" } |
400 | leadId missing or malformed | { "error": "Valid leadId is required" } |
400 | Lead is not enrolled in this instruction | { "error": "Lead is not enrolled in this instruction" } |
401 | Missing or invalid API key | { "error": "Unauthorized" } |
404 | Lead not in your workspace | { "error": "Lead not found" } |