Set up the RCS CONVERSATION_STARTED webhook event
Configure the CONVERSATION_STARTED webhook event to receive real-time notifications when an end user replies to an RCS message and initiates a conversational session. Use this event to track when the billing model changes from non-conversational to conversational, and to monitor traffic types (A2P or P2A) for billing purposes.
This tutorial walks through creating a subscription with a notification profile, sending an RCS message, and handling the webhook payloads that Infobip delivers to your endpoint.
This tutorial focuses specifically on the CONVERSATION_STARTED event. To set up webhooks for other messaging events such as delivery reports, seen reports, and inbound messages, refer to Set up webhook notifications for messaging events.
Products and channels [#products-channels]
Use the following Infobip products to set up the CONVERSATION_STARTED webhook event for RCS.
| Product | Description |
|---|---|
| RCS | Channel used to send and receive rich business messages. |
| Subscriptions API | Create subscriptions and notification profiles to receive webhook events. |
Prerequisites [#prerequisites]
- Infobip account. If you do not have an account, sign up for a free trial account.
- Infobip API key with the
rcs:message:sendscope. Learn how to create an API key with the correct scope. - HTTP client for making API requests. This tutorial uses
cURL, but you can use any HTTP client or the official Infobip SDK for your preferred programming language. - RCS agent/sender with the Billing category set to Conversational. To configure a custom RCS sender, contact your Account Manager.
- Destination phone number for testing. If the RCS agent is not launched, you can send messages only to whitelisted phone numbers.
- Publicly accessible webhook endpoint URL where Infobip can send event notifications.
Process overview [#process-overview]
- Create a subscription and notification profile for the
CONVERSATION_STARTEDevent. - Send an RCS message to initiate a conversation.
- Handle the delivery report and the
CONVERSATION_STARTEDwebhook payload.
Step 1: Create the subscription and notification profile
Create a subscription that defines which message events should trigger webhook notifications to your endpoint. For this tutorial, subscribe to the CONVERSATION_STARTED event.
A complete list of available events for each Infobip product is available in the event subscriptions documentation.
Key points:
subscriptionId: Must not contain whitespaces. Use hyphens or underscores instead (e.g.,RCS-Conversation-Started).events: Set toCONVERSATION_STARTEDto receive notifications when an end user initiates a conversational session.resources: Specify your RCS sender name.profile: Notification profile with the webhook URL and security settings. You can create a new notification profile by providing details as described in the API schema, or pass in an existingprofileIdto reuse a previously created profile.
To set up webhooks from the Infobip web interface instead of the API, refer to the Create and manage subscriptions documentation.
Step 2: Send an RCS message
After the subscription is created, send an RCS message to initiate a conversation. The message must be sent from an RCS sender with the Billing category set to Conversational.
Step 3: Handle webhook notifications
After sending the RCS message, your webhook endpoint receives notifications at different stages of the conversation lifecycle.
Delivery report with conversation metadata
When the RCS message is delivered, the delivery report includes a new conversation parameter:
The conversation object indicates:
canInitiate: truemeans the message is not part of an active conversation and can start one.id: nullmeans no conversation session exists yet.
CONVERSATION_STARTED event
When the end user replies to the message, a conversational session begins. The CONVERSATION_STARTED event is triggered on your webhook, along with the traffic type:
The trafficType indicates the billing classification:
A2P_CONVERSATION: Application-to-person, the business initiated the conversation.P2A: Person-to-application, the end user initiated the conversation.
For more information about billing, refer to RCS global billing types.
Subsequent delivery reports
After a conversation starts, delivery reports for new messages include the conversation ID:
The conversation object now shows:
canInitiate: falsemeans the message is part of an active conversation.idcontains the unique conversation identifier.
Implementation outcome [#outcome]
After completing this tutorial, your system will automatically receive real-time notifications when:
- An RCS message is delivered, including whether it can initiate a conversation.
- An end user replies and starts a conversational session (
CONVERSATION_STARTEDevent). - Subsequent messages are part of an active conversation, identified by the conversation ID.
Additional resources [#additional-resources]
- Set up webhook notifications for messaging events — covers delivery, seen, inbound, and typing indicator webhooks
- RCS API reference
- RCS documentation
- RCS billing types
- Subscription management
- Response status and error codes
- Broadcast
- Infobip SDKs