Conversations
Conversations over API
Manage calls and messages over API

Manage calls and messages


This section describes how to configure call center-specific features and how to manage messages within Conversations. All standard Conversations setup steps apply here as well.


Calls

To learn how to make and receive calls, refer to the WebRTC calls documentation.

Below is a high-level overview of the required setup and call center integration steps.

Prerequisites

Before working with calls, complete the following:

  1. Create an application using the Use Conversations configuration option.
  2. Register agents (opens in a new tab) using their Agent ID (opens in a new tab).
  3. Add the Infobip RTC JS SDK (opens in a new tab) to your application.

Make calls

To make an outbound call:

  1. Create an outbound call conversation (opens in a new tab).

  2. Generate CallOptions (opens in a new tab), including the following parameters inside customData (opens in a new tab):

    • conversationsID - obtained from the conversation created in the previous step.
    • calleeClientType - WebRTC for in-app calls or PSTN for calls to phone numbers.
    javascript
     
        const callOptions = CallOptions.builder()
           .setCustomData({
               isOutbound: true,
               outboundTo: outgoingCallRequest.destination,
               outboundFrom: outgoingCallRequest.sender,
               outboundAgentId: this.context.user.agentId,
               conversationId: outgoingCallRequest.conversationId,
               calleeClientType: calleeClientType,
           }).build();
     
  3. Use the callConversations (opens in a new tab) method with the CallOptions.

  4. Manage the conversation as you would for any other channel.

Receive calls

To receive calls:

  1. Configure your Voice number to forward calls to Conversations, or use the Dial to Conversations (opens in a new tab) script in IVR.
  2. You can also initiate a call from your application to Conversations using the callConversations method (Web (opens in a new tab), Android (opens in a new tab), iOS (opens in a new tab)).
  3. Set agent heartbeat (opens in a new tab).
  4. Register the incoming call event handler on the InfobipRTC (opens in a new tab) client and implement answering and rejecting logic.

Wrap-up time

After a call ends, agents may need time to write notes or summaries before closing the conversation.

During wrap-up:

Waiting strategy

A waiting strategy shapes the caller experience while they wait to connect with an agent.

You can configure:

  • Strategy name
  • Applicable numbers or applications
  • Maximum waiting time

Optional components:

  • Greeting message - played at the beginning of the call
  • Hold music - audio played while waiting
  • Announcement message - periodic updates for callers
  • Maximum wait time message - played before the call

Learn more about the waiting strategy for calls.

With the available API methods, you can:

Transfer calls

Currently, there are three methods available for transferring calls:

Additionally, you can retrieve a list of all queues (opens in a new tab) and return them along with their current activity status.

Recording

You can create account recording configuration (opens in a new tab) to record agent-customer conversations to comply with regulatory requirements, ensure quality, or support other business needs.

System-level recording settings

You can choose to record:

  • Inbound calls (answered by agents)
  • Outbound calls (initiated by agents)
  • Both inbound and outbound

Recording video calls

Calls in Conversations can include video. You can decide how these calls should be recorded:

  • Media type: audio only, video only, or both.
  • Default behavior:

Video calls are recorded and stored in Infobip cloud storage as high-quality streamable files that cannot be downloaded.

To generate files you can download, copy, or move to your own storage, enable Video Download Preparation.

NotePreparing video files for download may take time depending on file duration, service load, and internet connection.

Configuration management

Recording file management

You can get (opens in a new tab), download (opens in a new tab), and delete (opens in a new tab) recording files.


Messages

You can use Messages API for engagement campaigns where a new conversation is created when sending the initial mobile-terminated (MT) message (opens in a new tab).

Create messages

Inbound messages are automatically threaded if channels and senders are configured for conversation threading.

To add outbound messages to a conversation, use the Create message (opens in a new tab) method to send a message through any supported channel.

Get messages

Use the Get messages (opens in a new tab) method to retrieve all messages exchanged within a conversation.

x-agent-id attribute

The x-agent-id HTTP header attribute identifies the agent sending the message.

It is used when integrations authenticate with an API key and need to associate outgoing messages with a specific agent.

  • The value is the agentId, which is the primary key of the agent entity.
  • You can find agentId in responses from the Agents API.
  • Adding x-agent-id to every request is not mandatory since its use depends on whether your account uses agents.

Behavior matrix

Conversation assignment statusNo x-agent-id providedx-agent-id = AGENTx-agent-id = SUPERVISOR
UnassignedOK (no-agents-used scenario)ErrorError
Assigned to AgentErrorOKOK
Assigned to SupervisorErrorErrorOK

Usage rules

If you do not use agents:

  • Keep conversations unassigned.
  • Omit the x-agent-id parameter entirely from the Create Message request header.

If you use agents:

  • Your account must have at least one agent (license not required) created via the Create agent (opens in a new tab) API.
  • The x-agent-id header must contain the correct agentId, depending on who is sending the message.

Role behavior

  • Agent role can reply only to conversations assigned to them.
  • Supervisor role can reply to any conversation.
  • The x-agent-id header must always reflect the correct agentId based on who is performing the action.


Need assistance

Explore Infobip Tutorials

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary
Service status

Copyright @ 2006-2025 Infobip ltd.

Service Terms & ConditionsPrivacy policyTerms of use