Subscribe to an event (create webhook)

Registers a webhook. Atlas will send an HTTP POST to hookUrl every time the chosen event fires for the campaign. The delivered body is a JSON array of event objects and contains no event-type field — the type is known only from which subscription fired, so register a distinct hookUrl per triggerName if one endpoint must serve multiple events.

Authentication

api-keystring

Your Atlas API key. Get it from the Atlas Portal under Settings > API Keys.

Request

This endpoint expects an object.
hookUrlstringRequiredformat: "uri"
HTTPS URL that Atlas will POST the event payload to.
campaignIdstringRequired

ID of the campaign to subscribe to. Use ”*” to receive the event from every campaign.

triggerNameenumRequired
The event that triggers webhook delivery.
providerenumRequired

Identifies the webhook integration. For direct API usage this is always custom.

inactivityTimeoutMinutesintegerOptional1-10080

Minutes of inactivity before a messaging conversation is considered complete. Only applicable to the message_session_completed trigger. Maximum 10080 (7 days).

Response

Subscription created
idstring

Identifier of the subscription (the registered hookUrl).

campaignIdstring
triggerNameenum
The event that triggers webhook delivery.

Errors

400
Bad Request Error
500
Internal Server Error