curl --request POST \
--url https://app.thinnest.ai/api/v1/sequences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": "ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21",
"name": "After delivery",
"exitOnReply": true,
"triggerTags": [
"delivered"
],
"exitOnTags": [
"refunded"
],
"startOn": [
"order.delivered"
],
"stopOn": [
"order.returned"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent: 'ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21',
name: 'After delivery',
exitOnReply: true,
triggerTags: ['delivered'],
exitOnTags: ['refunded'],
startOn: ['order.delivered'],
stopOn: ['order.returned']
})
};
fetch('https://app.thinnest.ai/api/v1/sequences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/sequences"
payload = {
"agent": "ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21",
"name": "After delivery",
"exitOnReply": True,
"triggerTags": ["delivered"],
"exitOnTags": ["refunded"],
"startOn": ["order.delivered"],
"stopOn": ["order.returned"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "7c0e4b2a-9d3f-4e61-8a5c-1b7f3e9d2c08",
"name": "After delivery",
"status": "draft",
"agent": "ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21",
"exitOnReply": true,
"triggerTags": [
"delivered"
],
"exitOnTags": [
"refunded"
],
"startOn": [
"order.delivered"
],
"stopOn": [
"order.returned"
],
"steps": [],
"enrolments": {
"active": 0,
"completed": 0,
"exited": 0
},
"createdAt": "2026-10-06T10:00:04.512Z"
}{
"error": "\"order.delivered\" cannot both start and stop this sequence — pick one."
}{
"error": "Send a valid API key as `Authorization: Bearer <key>`."
}{
"error": "This API key is read-only: it can read everything but change nothing."
}{
"error": "That agent was not found."
}{
"error": "Over 240 requests a minute. Slow down and retry."
}Create Sequence
Creates a sequence as a draft: it sends nothing until you add a step with Add Sequence Step and turn it on with Activate Sequence. Tags are stored lower-case and hyphenated, and event names lower-case with dots, as the console stores them. A build key may do this.
curl --request POST \
--url https://app.thinnest.ai/api/v1/sequences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": "ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21",
"name": "After delivery",
"exitOnReply": true,
"triggerTags": [
"delivered"
],
"exitOnTags": [
"refunded"
],
"startOn": [
"order.delivered"
],
"stopOn": [
"order.returned"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent: 'ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21',
name: 'After delivery',
exitOnReply: true,
triggerTags: ['delivered'],
exitOnTags: ['refunded'],
startOn: ['order.delivered'],
stopOn: ['order.returned']
})
};
fetch('https://app.thinnest.ai/api/v1/sequences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/sequences"
payload = {
"agent": "ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21",
"name": "After delivery",
"exitOnReply": True,
"triggerTags": ["delivered"],
"exitOnTags": ["refunded"],
"startOn": ["order.delivered"],
"stopOn": ["order.returned"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "7c0e4b2a-9d3f-4e61-8a5c-1b7f3e9d2c08",
"name": "After delivery",
"status": "draft",
"agent": "ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21",
"exitOnReply": true,
"triggerTags": [
"delivered"
],
"exitOnTags": [
"refunded"
],
"startOn": [
"order.delivered"
],
"stopOn": [
"order.returned"
],
"steps": [],
"enrolments": {
"active": 0,
"completed": 0,
"exited": 0
},
"createdAt": "2026-10-06T10:00:04.512Z"
}{
"error": "\"order.delivered\" cannot both start and stop this sequence — pick one."
}{
"error": "Send a valid API key as `Authorization: Bearer <key>`."
}{
"error": "This API key is read-only: it can read everything but change nothing."
}{
"error": "That agent was not found."
}{
"error": "Over 240 requests a minute. Slow down and retry."
}Authorizations
Your API key (ta_live_…) from Settings → API keys, sent as Authorization: Bearer <key>. Keep it on a server: it can message every customer you have. A key is full, build or read-only; a request its level does not allow is refused with 403.
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Body
The agent whose sequence this is (ag_…). Cannot be changed later.
"ag_2c7e9a14-5b3d-4f8e-a1c6-7d9b0e3f5a21"
What you call it.
1 - 120"After delivery"
Whether a reply from the customer takes them out.
true
Tagging a contact with one of these enrols them. Normalised like contact tags.
["delivered"]
Tagging someone in it with one of these takes them out.
["refunded"]
Event names (Report Event) that enrol the contact. Normalised like event names: "Order Delivered" becomes order.delivered.
["order.delivered"]
Event names that take them out. An event cannot be in both lists.
["order.returned"]
Response
The new draft sequence.
The sequence's id — a bare uuid.
The sequence's name.
Only active sequences send.
draft, active, paused The agent it belongs to (ag_…).
Whether a reply from the customer takes them out.
Tagging a contact with one of these enrols them.
Tagging someone in it with one of these takes them out.
Event names (Report Event) that enrol the contact.
Event names that take them out.
The messages, in order.
Show child attributes
Show child attributes
How many people are in it now, have finished it, and left it early.
Show child attributes
Show child attributes
When it was created.