curl --request POST \
--url https://app.thinnest.ai/api/v1/agents/{id}/actions/{actionId}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"arguments": {
"phone": "+919876543210"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({arguments: {phone: '+919876543210'}})
};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/actions/{actionId}/test', 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/{actionId}/test"
payload = { "arguments": { "phone": "+919876543210" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"status": 200,
"result": "Next appointment: Thu 9 Oct, 11:30 AM, cleaning with Dr Mehta."
}Test Action
Make the call once, for real, through the same address checks and credentials the agent uses — and it works while the action is still off, which is the point. A test has no conversation, so only {{agent.id}} and {{workspace.id}} fill; the rest are empty. A failed call is still 200, with ok: false. On a POST, PUT, PATCH or DELETE action the test does the write. A build key may do this.
curl --request POST \
--url https://app.thinnest.ai/api/v1/agents/{id}/actions/{actionId}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"arguments": {
"phone": "+919876543210"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({arguments: {phone: '+919876543210'}})
};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/actions/{actionId}/test', 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/{actionId}/test"
payload = { "arguments": { "phone": "+919876543210" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"status": 200,
"result": "Next appointment: Thu 9 Oct, 11:30 AM, cleaning with Dr Mehta."
}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"
Response
What happened.