CTRLK

Shared components

Webhook subscriptions in CPaaS X

|

View as Markdown

Webhooks are created through subscriptions, an Infobip platform feature for real-time event notifications. In CPaaS X, subscriptions support scoped event delivery through criteria filtering: you can subscribe to events for a specific applicationId, entityId, or both. This keeps each entity informed about its own events without mixing data from other entities.


The multi-tenant event delivery challenge [#multi-tenant-event-delivery-challenge]

In traditional multi-tenant platforms without scoped subscriptions, all events flow to a single webhook without filtering. Your code must attribute each event to the correct customer, adding complexity and creating security risks if events are misrouted.

Without scoped subscriptions

Without scoped subscriptions

A single webhook receives all events from all customers. Your system must manually parse, filter, and route events by customer. This is complex, error-prone, and creates security risks with cross-customer data leakage.

With scoped subscriptions

With scoped subscriptions

Each customer gets their own webhook that receives only their events. CPaaS X filters at the platform level using criteria. No manual parsing, routing, or filtering needed in your code.



How scoped subscriptions work [#how-scoped-subscriptions-work]

When creating a subscription in CPaaS X, you define filters to scope events by applicationId, entityId, user, or resource. A subscription triggers only when all filter conditions match the event. You can manage subscriptions through the web interface (Developer tools > Subscriptions Management) or the Subscriptions API.

json
1{
2 "subscriptionId": "customer-a-sms",
3 "events": ["DELIVERY", "INBOUND_MESSAGE"],
4 "criteria": [
5 {
6 "applicationId": "production",
7 "entityId": "customer-a"
8 }
9 ],
10 "profile": {
11 "profileId": "NOTIF-32395",
12 "webhook": {
13 "notifyUrl": "https://customer-a.yourplatform.com/webhooks/sms"
14 }
15 }
16}

The customer-a webhook automatically receives only customer-a events, eliminating manual filtering logic from your code.



Why scoped event delivery matters [#why-scoped-event-delivery-matters]

Scoped subscriptions provide three critical advantages for multi-tenant platforms:

Data isolation

Data isolation

Enforced at the platform level. Customer A's webhook never receives Customer B's events. Audit trails are naturally segregated per entity for compliance.

Simplified integration

Simplified integration

Each webhook receives only events for its assigned entity. No need to receive all events and parse them to determine which customer they belong to.

Direct customer integration

Direct customer integration

Give each customer their own entity-scoped webhook endpoint. They receive real-time updates about their own events and can build integrations independently.



Subscription types [#subscription-types]

Application-level subscriptions

Application-level subscriptions

Receives all events from all entities within an application. Scoped by applicationId only (no entityId).

Best for: Platform monitoring, usage tracking, and compliance audits by your admin and operations teams.

Entity-level subscriptions

Entity-level subscriptions

Receives only events for a specific entity. Scoped by both applicationId and entityId.

Best for: Customer-facing updates and per-customer event handling. Each customer or backend system serving a specific entity gets its own webhook.



Supported channels and event types [#supported-channels-and-events]

Subscriptions support more than 20 channels, products, and services including SMS, MMS, Email, WhatsApp, RCS, Viber, and Voice. For the complete list of events by channel, see Available webhook events.



Event content with entity/application context [#event-content]

When CPaaS X sends webhook events, they include the entity and application context. Both applicationId and entityId appear in delivery reports and callback events, allowing you to track traffic and events by application and entity.

json
1{
2 "eventId": "evt-12345",
3 "timestamp": "2026-02-16T10:30:00Z",
4 "eventType": "message.delivered",
5 "entityId": "customer-a",
6 "applicationId": "production",
7 "data": {
8 "messageId": "msg-67890",
9 "recipient": "+1-555-0123",
10 "status": "delivered"
11 }
12}
NOTE

For the complete list of event types and payload schemas, refer to the Webhook subscriptions documentation.

Learn more


Related pages

Applications and entities
Core concepts and data isolation.

Sending strategies
Resource associations and intelligent routing.

Metrics and reporting
Per-customer usage tracking and analytics.