Webhooks
Receive real-time notifications about events during client interactions with Amigo.
Webhook Destinations
Maximum Destinations
10 per organization
Event Filtering
Specify which event types to receive
Retry Configuration
Customize retry attempts for failed deliveries
Secret Management
Unique secret per destination for security
Managing Webhook Destinations
Use these endpoints to manage your webhook destinations
Create a new webhook destination. At most 10 webhook destinations can be defined per organization.
A secret will immediately be issued for the webhook destination. Every webhook sent to this destination will be signed using this secret. This secret is one-view only and cannot be retrieved later.
Permissions
This endpoint requires the following permissions:
Webhook:CreateWebhookDestination
for the webhook destination.
The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
[]
The URL to which the webhook will be sent. The URL must be in HTTPS.
A list of webhook types to receive.
The number of attempts to retry sending the webhook event in case of failure.
3
Succeeded.
The organization already has the maximum amount of webhook destinations defined.
Invalid authorization credentials.
Missing required permissions.
Specified organization is not found.
Invalid request path parameter or request body failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
POST /v1/{organization}/webhook_destination/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 74
{
"url": "https://example.com",
"accepted_types": [
"text"
],
"retry_attempts": 3
}
{
"webhook_destination_id": "text",
"secret": "text"
}
Remove a webhook destination from the organization. The webhook destination might still be active for a few seconds after this endpoint returns.
Permissions
This endpoint requires the following permissions:
Webhook:DeleteWebhookDestination
for the webhook destination.
The identifier of the webhook destination to update.
^[a-f0-9]{24}$
The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
[]
Succeeded.
No content
Invalid authorization credentials.
Missing required permissions.
Specified organization or webhook destination is not found.
Invalid request path parameter failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
DELETE /v1/{organization}/webhook_destination/{webhook_destination_id} HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
No content
Retrieve this organization's webhook destinations.
Permissions
This endpoint may be impacted by the following permissions:
Webhook:GetWebhookDestination
on the webhook destinations to retrieve.
The IDs of the webhook destinations to retrieve.
[]
The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
[]
Succeeded.
Invalid authorization credentials.
Missing required permissions.
Specified organization is not found.
Invalid request path parameter or request query parameter failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
GET /v1/{organization}/webhook_destination/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
"webhook_destinations": [
{
"id": "text",
"url": "text",
"secret_generated_at": "2025-10-11T22:48:22.027Z",
"retry_attempts": 1,
"accepted_types": [
"text"
]
}
]
}
Retrieve the webhook deliveries to a webhook destination.
Permissions
This endpoint may be impacted by the following permissions:
Webhook:GetWebhookDeliveries
on the webhook deliveries to retrieve.
The ID of the webhook destination whose deliveries to retrieve.
^[a-f0-9]{24}$
The status of the webhook delivery.
The type of the webhook.
An ISO8601 timestamp in UTC of the earliest creation time of the webhook deliveries to retrieve.
An ISO8601 timestamp in UTC of the latest creation time of the webhook deliveries to retrieve.
The maximum number of webhook deliveries to retrieve.
50
The token from the previous request to return the next page of webhook deliveries.
0
The fields to sort the webhook deliveries by. Supported fields are type
, status
, and created_at
. Specify a +
before the field name to indicate ascending sorting and -
for descending sorting. Multiple fields can be specified to break ties.
[]
The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
[]
Succeeded.
Invalid authorization credentials.
Missing required permissions.
Specified organization or webhook destination is not found.
Invalid request path parameter or request query parameter failed validation.
The user has exceeded the rate limit of 5 requests per minute for this endpoint.
The service is going through temporary maintenance.
GET /v1/{organization}/webhook_destination/{webhook_destination_id}/delivery HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
"webhook_deliveries": [
{
"id": "text",
"type": "text",
"webhook_content": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"status": "success",
"delivery_attempts": [
{
"delivery_time": "2025-10-11T22:48:22.027Z",
"status_code": 1
}
],
"dual_signed": true,
"created_at": "2025-10-11T22:48:22.027Z"
}
],
"has_more": true,
"continuation_token": 1
}
Delivery & Retries
Automatic Retry Logic Failed webhook deliveries are automatically retried with exponential backoff to ensure reliable event delivery.
Initial
0s
Immediate
Retry 1
5s
5s
Retry 2
10s
15s
Retry 3
20s
35s
Retry 4
20s
55s
Configure retry attempts via
retry_attempts
parameterView delivery history for past 30 days via API
Delivery Sequence
Security
Webhook Signatures
Every webhook request is cryptographically signed to ensure authenticity.
Secret Storage Store webhook secrets securely. Never commit them to version control or expose them in client-side code.
Signature Process:
Receive secret when creating webhook destination
Amigo signs all requests with HMAC-SHA256
Validate signature on receipt to verify authenticity
Request Headers
x-amigo-idempotent-key
Unique identifier persisting through retries for deduplication
x-amigo-request-timestamp
UNIX timestamp (milliseconds) of the delivery attempt
x-amigo-request-signature
HMAC-SHA256 signature of v1:{timestamp}:{body}
Signature Verification
const crypto = require('crypto');
function verifyWebhookSignature(body, timestamp, signature, secret) {
// 1. Concatenate version, timestamp, and body
const payload = `v1:${timestamp}:${body}`;
// 2. Compute HMAC-SHA256
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
// 3. Compare signatures
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expectedSignature)
);
}
Secret Rotation
Zero-Downtime Rotation Dual-signing period allows seamless secret rotation without missing events.
Rotation Process:
1
Call rotation endpoint
Immediate
2
Receive new secret
Immediate
3
Dual-signing begins
30 minutes
4
Update verification logic
During dual-signing
5
Old secret expires
After dual_signing_stops_at
During dual-signing period:
Amigo sends two signatures per request
Accept either old or new signature
No webhook deliveries are lost
Rotation States
Webhook Event Types
Post-Processing Events
conversation-post-processing-complete
conversation-post-processing-complete
Triggered when asynchronous post-processing analysis completes for a conversation.
Payload structure:
{
// The webhook event type
type: "conversation-post-processing-complete",
// The specific post-processing operation that completed
post_processing_type: "generate-tasks" | "generate-user-models" | "extract-memories" | "compute-metrics",
// Unique identifier for the conversation that was analyzed
conversation_id: string,
// Your organization's unique identifier
org_id: string
}
Post-Processing Types:
generate-user-models
Updates L2 user model with conversation insights
Enhanced personalization
extract-memories
Stores key information as L1 observations
Future context recall
compute-metrics
Calculates performance metrics
Quality and effectiveness measurement
Last updated
Was this helpful?