curl --request POST \
--url https://app.thinnest.ai/api/v1/agents/{id}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "get_appointment",
"description": "Look up a patient's next appointment by their phone number before answering anything about timings.",
"method": "GET",
"url": "https://api.sunrisedental.in/appointments?phone={{phone}}",
"parameters": [
{
"name": "phone",
"description": "The patient's mobile number with country code, e.g. +919876543210",
"required": true
}
],
"headers": {
"Authorization": "Bearer sk_clinic_7Hq2…"
},
"speakBefore": "One moment, let me check the diary."
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'get_appointment',
description: 'Look up a patient\'s next appointment by their phone number before answering anything about timings.',
method: 'GET',
url: 'https://api.sunrisedental.in/appointments?phone={{phone}}',
parameters: [
{
name: 'phone',
description: 'The patient\'s mobile number with country code, e.g. +919876543210',
required: true
}
],
headers: {Authorization: 'Bearer sk_clinic_7Hq2…'},
speakBefore: 'One moment, let me check the diary.'
})
};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/agents/{id}/actions"
payload = {
"name": "get_appointment",
"description": "Look up a patient's next appointment by their phone number before answering anything about timings.",
"method": "GET",
"url": "https://api.sunrisedental.in/appointments?phone={{phone}}",
"parameters": [
{
"name": "phone",
"description": "The patient's mobile number with country code, e.g. +919876543210",
"required": True
}
],
"headers": { "Authorization": "Bearer sk_clinic_7Hq2…" },
"speakBefore": "One moment, let me check the diary."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "act_9b2f4e17-6c3a-4d81-b5e2-7a0c9d3f1e46",
"agent": "ag_3f6a9c21-7d4e-4b58-9a1f-0c2e8b7d5a34",
"name": "get_appointment",
"description": "Look up a patient's next appointment by their phone number before answering anything about timings.",
"method": "GET",
"url": "https://api.sunrisedental.in/appointments?phone={{phone}}",
"parameters": [
{
"name": "phone",
"description": "The patient's mobile number with country code, e.g. +919876543210",
"required": true
}
],
"bodyTemplate": null,
"headerNames": [
"Authorization"
],
"speakBefore": "One moment, let me check the diary.",
"speakAfter": null,
"enabled": false,
"createdAt": "2026-10-05T09:41:00.210Z",
"updatedAt": "2026-10-05T09:41:00.210Z"
}Create Action
Give the agent a call to your own API, with placeholders it fills from what the customer said. Dotted placeholders are filled by the platform, never the model: {{call.id}} (the id GET /calls lists), {{call.from}}, {{call.to}}, {{call.direction}} (empty outside a call), {{conversation.id}}, {{contact.id}}, {{contact.phone}}, {{agent.id}}, {{workspace.id}} and {{test.chat}} (true during a test chat, empty otherwise) — in the path, query, body or a header value, never the host; an unknown one is refused. Every call also sends X-Call-Id, X-Conversation-Id, X-Agent-Id and X-Workspace-Id when known, and X-Test-Chat: true during a test chat (POST /agents/{id}/test-chat), where the call values are empty and X-Call-Id is absent — so your endpoint can answer without writing anything. A new action is always off: test it with POST …/test, then PATCH enabled: true — sending enabled here is refused. Header values are sealed on arrival and never returned. A build key may do this.
curl --request POST \
--url https://app.thinnest.ai/api/v1/agents/{id}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "get_appointment",
"description": "Look up a patient's next appointment by their phone number before answering anything about timings.",
"method": "GET",
"url": "https://api.sunrisedental.in/appointments?phone={{phone}}",
"parameters": [
{
"name": "phone",
"description": "The patient's mobile number with country code, e.g. +919876543210",
"required": true
}
],
"headers": {
"Authorization": "Bearer sk_clinic_7Hq2…"
},
"speakBefore": "One moment, let me check the diary."
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'get_appointment',
description: 'Look up a patient\'s next appointment by their phone number before answering anything about timings.',
method: 'GET',
url: 'https://api.sunrisedental.in/appointments?phone={{phone}}',
parameters: [
{
name: 'phone',
description: 'The patient\'s mobile number with country code, e.g. +919876543210',
required: true
}
],
headers: {Authorization: 'Bearer sk_clinic_7Hq2…'},
speakBefore: 'One moment, let me check the diary.'
})
};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/agents/{id}/actions"
payload = {
"name": "get_appointment",
"description": "Look up a patient's next appointment by their phone number before answering anything about timings.",
"method": "GET",
"url": "https://api.sunrisedental.in/appointments?phone={{phone}}",
"parameters": [
{
"name": "phone",
"description": "The patient's mobile number with country code, e.g. +919876543210",
"required": True
}
],
"headers": { "Authorization": "Bearer sk_clinic_7Hq2…" },
"speakBefore": "One moment, let me check the diary."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "act_9b2f4e17-6c3a-4d81-b5e2-7a0c9d3f1e46",
"agent": "ag_3f6a9c21-7d4e-4b58-9a1f-0c2e8b7d5a34",
"name": "get_appointment",
"description": "Look up a patient's next appointment by their phone number before answering anything about timings.",
"method": "GET",
"url": "https://api.sunrisedental.in/appointments?phone={{phone}}",
"parameters": [
{
"name": "phone",
"description": "The patient's mobile number with country code, e.g. +919876543210",
"required": true
}
],
"bodyTemplate": null,
"headerNames": [
"Authorization"
],
"speakBefore": "One moment, let me check the diary.",
"speakAfter": null,
"enabled": false,
"createdAt": "2026-10-05T09:41:00.210Z",
"updatedAt": "2026-10-05T09:41:00.210Z"
}Authorizations
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. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Body
Response
The action, switched off.