Skip to navigation

Webhooks

Receive real-time events from Atlas in your own systems

Webhooks let Atlas push events to your systems the moment they happen — when a call starts or ends, when a chat message is received or sent, or when a chat session completes. Instead of polling the API, you register a URL once and Atlas sends an HTTP POST to it every time the event fires.

This is the inverse of Atlas Actions: Actions let your agent call out to your API during a conversation, while webhooks let Atlas notify your API after something happens.

How it works

  1. You register a webhook for a campaign and an event (a trigger).
  2. When that event fires, Atlas sends a POST request to your URL with the event payload as JSON.
  3. Your endpoint responds quickly with a 2xx status code.

All requests use the standard API base URL and api-key authentication — see API Overview.

https://api.youratlas.com/v1/api

Events

You can subscribe to five events. The triggerName value is what you pass when subscribing.

EventtriggerNameFires when
Call startedcall_startedAn outbound or inbound call begins
Call completedcall_completedA call ends (includes summary, transcript, recording)
Message receivedmessage_receivedA customer message arrives on a chat campaign
Message sentmessage_sentThe agent sends a chat message
Session completedmessage_session_completedA chat session ends after a period of inactivity (one event per session, with the full transcript and a summary)

Subscribe (create a webhook)

Register a webhook by POSTing to /events-gateway/trigger/subscribe.

curl --location 'https://api.youratlas.com/v1/api/events-gateway/trigger/subscribe' \
--header 'api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"hookUrl": "https://example.com/atlas/webhook",
"campaignId": "76effd5c-7286-4d3c-9f8e-e5d4c8287d12",
"triggerName": "call_completed",
"provider": "custom"
}'
FieldRequiredDescription
hookUrlYesHTTPS URL Atlas will deliver the event to.
campaignIdYesThe campaign to subscribe to. Use "*" to receive the event from every campaign.
triggerNameYesOne of the events above.
providerYesIdentifies the webhook integration. For direct API usage send "custom".
inactivityTimeoutMinutesNomessage_session_completed only. How long a chat session must be idle before it’s considered complete. Integer between 1 and 10080 (7 days). Defaults to 60. Ignored for other events.

A successful subscription returns 201:

{
"id": "https://example.com/atlas/webhook",
"campaignId": "76effd5c-7286-4d3c-9f8e-e5d4c8287d12",
"triggerName": "call_completed"
}

Each subscription is one event for one campaign. To receive both call_started and call_completed, subscribe twice.

Event payloads

When an event fires, Atlas sends a POST to your hookUrl with Content-Type: application/json. The body is a JSON array containing the event object.

call_started

[
{
"campaignId": "string",
"agentId": "string",
"callId": "string",
"customerNumber": "string",
"customerName": "string",
"campaignName": "string",
"agentName": "string",
"campaignType": "string"
}
]

call_completed

Includes everything from call_started, plus the call result:

[
{
"campaignId": "string",
"agentId": "string",
"callId": "string",
"customerNumber": "string",
"customerName": "string",
"campaignName": "string",
"agentName": "string",
"campaignType": "string",
"callSummary": "string",
"startedAt": "2026-06-02T13:04:30.000Z",
"endedAt": "2026-06-02T13:08:11.000Z",
"durationMs": 221000,
"durationSeconds": 221,
"durationMinutes": 3.68,
"callTranscript": "string",
"audioUrl": "https://...",
"customerEmail": "string",
"status": "Accepted",
"endedReason": "customer-ended-call"
}
]

status is the call’s terminal disposition — one of Accepted, Rejected, or Missed. endedReason is the raw end-of-call reason (for example customer-ended-call), passed through verbatim.

message_received / message_sent

[
{
"campaignId": "string",
"agentId": "string",
"customerNumber": "string",
"customerName": "string",
"campaignName": "string",
"agentName": "string",
"campaignType": "string",
"messageContent": "string",
"receivedAt": "2026-06-02T13:04:30.000Z"
}
]

message_sent uses sentAt instead of receivedAt.

message_session_completed

Fires once when a chat session ends — that is, after the session has been idle for inactivityTimeoutMinutes (60 by default). Includes the full transcript and a summary of the conversation.

[
{
"campaignId": "string",
"agentId": "string",
"customerNumber": "string",
"customerName": "string",
"campaignName": "string",
"agentName": "string",
"campaignType": "string",
"sessionId": "string",
"startedAt": "2026-06-02T13:04:30.000Z",
"endedAt": "2026-06-02T13:14:30.000Z",
"messageCount": 3,
"messages": [
{
"role": "user",
"content": "Hello, I would like to schedule an appointment.",
"timestamp": "2026-06-02T13:04:30.000Z"
},
{
"role": "assistant",
"content": "Sure! I can help you with that. When would you like to come in?",
"timestamp": "2026-06-02T13:04:30.000Z"
},
{
"role": "user",
"content": "Tomorrow at 2pm works for me.",
"timestamp": "2026-06-02T13:14:30.000Z"
}
],
"conversationSummary": "The customer requested an appointment and agreed on tomorrow at 2pm."
}
]

Before subscribing, you can fetch a sample payload built from a real campaign to develop against:

curl --location 'https://api.youratlas.com/v1/api/events-gateway/trigger/perform/call_completed?campaignId=YOUR_CAMPAIGN_ID' \
--header 'api-key: YOUR_API_KEY'

List webhooks

See every webhook registered for a campaign:

curl --location 'https://api.youratlas.com/v1/api/events-gateway/triggers/campaign/YOUR_CAMPAIGN_ID' \
--header 'api-key: YOUR_API_KEY'

Unsubscribe (delete a webhook)

Stop delivery by sending a DELETE to /events-gateway/trigger/unsubscribe with the same values you subscribed with:

curl --location --request DELETE 'https://api.youratlas.com/v1/api/events-gateway/trigger/unsubscribe' \
--header 'api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"hookUrl": "https://example.com/atlas/webhook",
"campaignId": "76effd5c-7286-4d3c-9f8e-e5d4c8287d12",
"triggerName": "call_completed",
"provider": "custom"
}'

Building your receiver

  • Respond with 2xx quickly. Acknowledge the request and do any heavy processing asynchronously. Slow endpoints may time out.
  • Expect retries to be best-effort. If your endpoint is unreachable, the event may not be redelivered — don’t rely on a webhook as your only record of an event; the Calls and chat endpoints remain the source of truth.
  • Handle duplicates. Treat delivery as at-least-once and de-duplicate on callId (calls) or message identifiers where it matters.

Atlas does not currently sign webhook requests. Treat your hookUrl as a secret: use HTTPS and a hard-to-guess path (for example, include a random token in the URL) so only Atlas can post to it.