curl --request POST \
--url https://app.thinnest.ai/api/v1/workflows/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "+91 98765 43210",
"event": "payment_received",
"data": {
"amount": "4999",
"invoice": "INV-1042"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '+91 98765 43210',
event: 'payment_received',
data: {amount: '4999', invoice: 'INV-1042'}
})
};
fetch('https://app.thinnest.ai/api/v1/workflows/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/workflows/events"
payload = {
"to": "+91 98765 43210",
"event": "payment_received",
"data": {
"amount": "4999",
"invoice": "INV-1042"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"recorded": true,
"event": "payment_received",
"waiting": 1
}Send a Workflow Event
Tells your workflows that something happened to a contact, such as a payment landing or a booking being made. Every run of that contact whose Await block waits for Your system sends an event with this name moves on through its Arrived path at the next check; only events sent after the run began waiting count. The contact is found by phone number. Needs a full key.
curl --request POST \
--url https://app.thinnest.ai/api/v1/workflows/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "+91 98765 43210",
"event": "payment_received",
"data": {
"amount": "4999",
"invoice": "INV-1042"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '+91 98765 43210',
event: 'payment_received',
data: {amount: '4999', invoice: 'INV-1042'}
})
};
fetch('https://app.thinnest.ai/api/v1/workflows/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/workflows/events"
payload = {
"to": "+91 98765 43210",
"event": "payment_received",
"data": {
"amount": "4999",
"invoice": "INV-1042"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"recorded": true,
"event": "payment_received",
"waiting": 1
}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. 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"