curl -X POST https://api.thinnest.ai/webhooks/endpoints \
-H "Authorization: Bearer $THINNESTAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}'
import requests
url = "https://api.thinnest.ai/webhooks/endpoints"
headers = {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
}
payload = {
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://api.thinnest.ai/webhooks/endpoints", {
method: "POST",
headers: {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}`)
req, _ := http.NewRequest("POST", "https://api.thinnest.ai/webhooks/endpoints", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"status": "success",
"endpoint": {
"id": 1,
"url": "https://your-app.com/webhooks/thinnestai",
"secret": "a1b2c3d4e5f6...",
"event_types": ["chat.message.completed", "voice.call.ended"],
"agent_id": null,
"description": "Production webhook",
"is_active": true,
"max_retries": 3,
"timeout_ms": 5000,
"created_at": "2026-03-16T10:00:00"
}
}
Webhooks
Create Webhook Endpoint
Register a new URL to receive webhook events.
POST
/
webhooks
/
endpoints
curl -X POST https://api.thinnest.ai/webhooks/endpoints \
-H "Authorization: Bearer $THINNESTAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}'
import requests
url = "https://api.thinnest.ai/webhooks/endpoints"
headers = {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
}
payload = {
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://api.thinnest.ai/webhooks/endpoints", {
method: "POST",
headers: {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}`)
req, _ := http.NewRequest("POST", "https://api.thinnest.ai/webhooks/endpoints", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"status": "success",
"endpoint": {
"id": 1,
"url": "https://your-app.com/webhooks/thinnestai",
"secret": "a1b2c3d4e5f6...",
"event_types": ["chat.message.completed", "voice.call.ended"],
"agent_id": null,
"description": "Production webhook",
"is_active": true,
"max_retries": 3,
"timeout_ms": 5000,
"created_at": "2026-03-16T10:00:00"
}
}
curl -X POST https://api.thinnest.ai/webhooks/endpoints \
-H "Authorization: Bearer $THINNESTAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}'
import requests
url = "https://api.thinnest.ai/webhooks/endpoints"
headers = {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
}
payload = {
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://api.thinnest.ai/webhooks/endpoints", {
method: "POST",
headers: {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"url": "https://your-app.com/webhooks/thinnestai",
"event_types": [
"chat.message.completed",
"voice.call.ended"
],
"description": "Production webhook",
"max_retries": 3,
"timeout_ms": 5000
}`)
req, _ := http.NewRequest("POST", "https://api.thinnest.ai/webhooks/endpoints", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Request Body
HTTPS URL to receive events
List of event types to subscribe to
Filter events to a specific agent (null = all agents)
Human-readable description
Number of retry attempts (0–5)
Request timeout in milliseconds
Response
{
"status": "success",
"endpoint": {
"id": 1,
"url": "https://your-app.com/webhooks/thinnestai",
"secret": "a1b2c3d4e5f6...",
"event_types": ["chat.message.completed", "voice.call.ended"],
"agent_id": null,
"description": "Production webhook",
"is_active": true,
"max_retries": 3,
"timeout_ms": 5000,
"created_at": "2026-03-16T10:00:00"
}
}
secret is only returned on creation. Save it immediately — it cannot be retrieved later.
Errors
| Status | Description |
|---|---|
400 | Invalid URL (not HTTPS), invalid event types, or max 20 endpoints reached |
401 | Missing or invalid API key |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Successful Response
⌘I

