Download OpenAPI specification:Download
Switchboard Conversations (SBC) is a backend messaging platform that clients can leverage for any messaging experience. The platform handles conversational storage as well as sending/receiving messages across various channels. Currently, the platform is focused on the SMS channel and the in-app channel, but the in-app channel spans multiple persona’s and clients, such as Alan’s in FUB (through STIP), Alan’s in PA App, Beth in ZG app, LO’s in Salesforce, Operators in Pearl (soon to come). SBC is also set up in a way to easily add channels to their platform.
Beyond the basic conversational functionality, SBC provides enhanced functionality that clients can leverage through their API’s. Things such as unread count, pagination, silent messages, and message statuses. SBC is ever evolving, however, as we seek to become a state of the art messaging system. Thus, we are always looking to improve and increase our features set. We work closely with clients to understand their top priorities and add those to our set of features that are available to all. You can see more below around current features and future features.
Conversations are a foundational piece to every connection, transaction, and overall customer experience. Thus, as we continue to strive for the Zillow 2.0 vision, we need to continue to invest in our conversation capabilities for not only Beth, but for all our personas. Switchboard Conversations is here to help all engineering teams across Zillow build the best conversational experience possible and do it quicker than ever. From our platform you will be able to immediately leverage critical backend messaging capabilities, to build out your conversational experience faster and better than ever.
1. Registering as a client in SBC's UI
Clients are required to access Switchboard's UI and begin the registration process.
Environment | SBC's User Interface |
---|---|
Production | https://switchboard-admin-ui-prod.corp.connectionsplatform-prod-k8s.zg-int.net/client-management |
2. Providing client information
After accesing the UI, clients must click on the "New Client" button and provide the following information:
3. Initiate integration
After details are registered, clients can start the integration process. The base URL for the API requests varies depending on the environment:
When making requests to the API, ensure you include the following headers:
Key | Value |
---|---|
Content-Type | application/json |
Immediate Request Validation: Get instant feedback on request validity without waiting for async status callbacks.
Reduced Complexity: Eliminate the bugs and inefficiencies associated with syncing data between SBC, SMS, and Twilio.
Simplified Architecture: Manage conversations directly within SBC, removing dependencies on Twilio and reducing architectural complexity.
To migrate from async to sync endpoints, clients should make the following changes:
Creating a Conversation: Migrate from /ReceiveConversationEvent to /CreateConversation to create 1-to-1 or group conversations.
Sending a Message: Migrate from /ReceiveMessageEvent to /SendMessage to dispatch messages to specified conversations.
Checking Delivery Status: Use /GetMessage to retrieve message details, including status, persona, metadata, and whether it is a silent message.
The base URL for all API requests varies depending on the environment:
Concept | Definition |
---|---|
Conversation | Refers to the space where two or more participants can exchange messages. |
Message | Is a text exchanged between participants within a conversation. |
Participant | Refers to a specific user who is part of a conversation. |
Bot | Is a software program that interacts with other users in a conversation by sending automated messages. |
Unread Count | Is the number of messages a specific participant has not yet read in a conversation. |
Persona | Refers to the type of participant in a conversation. SBC supports the following persona types: UNSPECIFIED, CONSUMER, BUYER, SELLER, SYSTEM, CONCIERGEREP, SELLERAGENT, BUYERAGENT, LOANPROCESSOR, LOANOFFICER_ASSISTANT, LOANOFFICER_MANAGER, AGENT, ZG_AI_LLM_BOT, and ZILLOW. |
Native System | Refers to the unique client name for the participant's platform that was assigned when onboarded to SBC. |
This endpoint allows clients to create either a one-to-one or group conversation. If an identical set of participants is already in an existing conversation, the endpoint will not create a new conversation and will instead return the existing one. This prevents duplicate conversations from being created with the same participants.
client_name required | string client_name is the unique client name for the sender's platform that was assigned when onboarded to SBC. |
required | Array of objects participants represent the active participants in the conversation. |
Array of objects metadata is the metadata related to the conversation | |
version required | string Default: "V0" Enum: "V0" "V1" version is the workflow version. Clients should always use V1. |
{- "client_name": "mercury-in-app-messaging-dev",
- "participants": [
- {
- "reference": {
- "id": "32646860",
- "type": "zuid"
}, - "persona": "AGENT",
- "channels": [
- {
- "type": "IN_APP",
- "sms": {
- "phone_number": "+12061234567"
}, - "in_app": {
- "native_system": "beth-messaging-service-switchboard-api-gateway-dev",
- "projected_address": {
- "phone_number": "+12061234567"
}
}
}
], - "is_active": true
}
], - "metadata": [
- {
- "type": "plain_text",
- "data": "hello world!"
}
], - "version": "V1"
}
{- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "create_dt": "2024-05-13T20:22:24.772122129Z"
}
The /GetConversationDetails endpoint is designed to be both fast and lightweight, enabling clients to retrieve the details of the participants, message metadata, and unread count, all without the need to fetch all the messages in the conversation.
conversation_id required | string conversation_id is the unique id of the conversation. |
{- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49"
}
{- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "participants": [
- {
- "participant": {
- "reference_id": "32646860",
- "reference_type": "zuid",
- "persona": "AGENT",
- "channels": {
- "type": "IN_APP",
- "sms": {
- "phone_number": "+12061234567"
}, - "in_app": {
- "native_system": "beth-messaging-service-switchboard-api-gateway-dev",
- "projected_address": {
- "phone_number": "+12061234567"
}
}
}, - "is_active": true,
- "create_dt": "2024-05-13T08:09:24.136044709Z",
- "update_dt": "2024-05-13T08:09:24.136044709Z"
}, - "unread_count": 4
}
], - "create_dt": "2024-05-13T08:09:24.136044709Z",
- "metadata": [
- {
- "type": "plain_text",
- "data": "hello world!"
}
]
}
Returns the all conversations for a given participant reference. This includes the conversation's last read message and the unread count for that participant.
object is the participant's id and type | |
limit | integer [ 1 .. 10 ] the number of conversations to be returned in each list page. The maximum is 10. |
cursor | string optional field which, when provided, returns the conversations following the cursor |
{- "participant": {
- "id": "32646860",
- "type": "zuid"
}, - "limit": 10,
- "cursor": "MjAyNS0wNC0zMFQxNTowMzoyNS44ODYyMDYzMDZa"
}
{- "conversations": [
- {
- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "create_dt": "2024-05-13T08:09:24.136044709Z",
- "participants": [
- {
- "reference_id": "32646860",
- "reference_type": "zuid",
- "persona": "AGENT",
- "channels": {
- "type": "IN_APP",
- "sms": {
- "phone_number": "+12061234567"
}, - "in_app": {
- "native_system": "beth-messaging-service-switchboard-api-gateway-dev",
- "projected_address": {
- "phone_number": "+12061234567"
}
}
}, - "is_active": true,
- "create_dt": "2024-05-13T08:09:24.136044709Z",
- "update_dt": "2024-05-13T08:09:24.136044709Z"
}
], - "latest_message": {
- "message_id": 1789930931922931700,
- "body": "Hello from Beth",
- "sender": {
- "id": "32646860",
- "type": "zuid"
}, - "create_dt": "2024-05-13T08:09:24.136044709Z",
- "attachments": [
- {
- "mime_type": "image/jpeg"
}
]
}, - "unread_count": 5,
- "is_archived": false
}
], - "pagination": {
- "cursor": "MjAyNS0wNC0zMFQxNTowMzoyNS44ODYyMDYzMDZa"
}
}
Retrieve all conversations in which a specific participant has taken part, and provide the count of unread messages for that user along with the associated conversation IDs.
required | object is the participant's id and type |
{- "participant": {
- "id": "32646860",
- "type": "zuid"
}
}
{- "conversations": [
- {
- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "unread_count": 10
}
]
}
This endpoint allows clients to add one or more participants to an existing conversation. Participants can be added with their reference, persona type, and optional channels.
conversation_id required | string The UUID of the conversation |
required | Array of objects non-empty List of participants to add to the conversation |
{- "conversation_id": "string",
- "participants": [
- {
- "reference": {
- "id": "32646860",
- "type": "zuid"
}, - "persona": "AGENT",
- "channels": [
- {
- "type": "IN_APP",
- "sms": {
- "phone_number": "+12061234567"
}, - "in_app": {
- "native_system": "beth-messaging-service-switchboard-api-gateway-dev",
- "projected_address": {
- "phone_number": "+12061234567"
}
}
}
], - "is_active": true
}
]
}
{ }
Below are the API's related to sending and fetching messages. We have a couple unique properties that you can apply to a message for unique functionality.
Feature | Functionality | How To |
---|---|---|
Silent | Sending a message that does not add to the unread count nor appear in the recent message preview for the recipients of the message. | Set isSilent = True on the message object when using /SendMessage. |
Targeted | Sending a message to a subset of participants in a conversation, instead of all the participants. Targeted messages will only notify the specified recipients of a new message. The message is still threaded in the conversation history. Thus, when retrieving messages, clients can add a filter to specify from which participant perspective they want to retrieve the messages. | When sending a message indicate an array of recipients on the message object. When retrieving messages, specify a participant as a filter |
Attachments | SBC platform allows its in-App clients to upload and retrieve media Messages in a safe and secure way. SBC is responsible for securely storing messages via zDocs sent between users and efficiently retrieving them when needed. This ensures that clients have access to fetch user message history at all times. Clients can send up to 10 media attachments per message. The client is responsible for determining how messages are rendered in the chat interface. This includes deciding on the layout and style when messages contain various types of content, such as multiple images or a combination of images and text. The client (example: ZIM, FUB etc.) allows Beth/Alan to send and receive messages, manage their conversations, and engage with other features of the chat application | Clients first must request an uploadURL via SBC in order to upload their content. SBC returns upload URL to the client. For every attachment uploaded, the client gets a token back which they pass in the attachments object in the SendMessage request. |
This endpoint supports pagination for retrieving the messages of a conversation.
conversation_id required | string conversation_id is the unique id of the conversation. |
cursor | string cursor is provided by the API. If the cursor is empty, then all the messages are returned starting with the latest message up until the limit is reached. If the cursor is provided, then all the messages from a conversation starting at that corresponding message up until the limit will be returned. |
limit required | number [ 1 .. 250 ] limit is the number of messages to be returned in each list page. |
object is the participant's id and type |
{- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "cursor": 1780533361220997000,
- "limit": 20,
- "filter": {
- "id": "32646860",
- "type": "zuid"
}
}
{- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "messages": [
- {
- "sender_id": "32646860",
- "persona": "AGENT",
- "message": "Hello from Beth",
- "create_dt": "2024-05-13T08:09:24.136044709Z",
- "update_dt": "2024-05-13T08:09:24.136044709Z",
- "status": "SENT",
- "message_id": "1789930931922931712",
- "metadata": [
- {
- "type": "plain_text",
- "data": "hello world!"
}
], - "is_silent": true,
- "recipients": [
- {
- "reference": {
- "id": "32646860",
- "type": "zuid"
}, - "status": "string",
- "update_dt": "string"
}
], - "attachments": [
- {
- "mime_type": "image/jpeg",
- "filename": "home-photo.jpg",
- "attachment_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "preview_url_expires_at": "2024-03-21T10:30:00Z"
}
]
}
], - "pagination": {
- "cursor": 1780533361220997000
}
}
Get a given message by its ID. Clients can use this to get the message details, including the status, persona, metadata and if it's a silent message. When clients make a request to SBC to retrieve their media message(s), SBC will make a request to zDocs to generate time-limited URLs which clients can use to render the media in the UI.
message_id required | string message_id is the id of the message |
{- "message_id": "1789930931922931712"
}
{- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "notification_connection_id": "6319582f-1887-11ef-b681-2678d607e699",
- "message_id": "1789930931922931712",
- "message": {
- "sender_id": "32646860",
- "persona": "AGENT",
- "message": "Hello from Beth",
- "create_dt": "2024-05-13T08:09:24.136044709Z",
- "update_dt": "2024-05-13T08:09:24.136044709Z",
- "status": "SENT",
- "message_id": "1789930931922931712",
- "metadata": [
- {
- "type": "plain_text",
- "data": "hello world!"
}
], - "is_silent": true,
- "recipients": [
- {
- "reference": {
- "id": "32646860",
- "type": "zuid"
}, - "status": "string",
- "update_dt": "string"
}
], - "attachments": [
- {
- "mime_type": "image/jpeg",
- "filename": "home-photo.jpg",
- "attachment_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "preview_url_expires_at": "2024-03-21T10:30:00Z"
}
]
}
}
SendMessage allows a client to send a message to a specified conversation. The message can include text and metadata, and it will be processed and stored in the database.
The client can specify the origin of the message (e.g., HDP, SMS_reply, ZIM_inbox) and the platform (Web, Mobile, iOS, Android) using dedicated headers. These headers allow SBC to track where the message was sent from and the platform used. Idempotency can also be provisioned by including a dedicated z-idempotency-key header in the request. SBC will then stream this data into the Data Lake, making it available for data analytics purposes.
This endpoint also checks the validity of the sender, increments the unread count of other participants, and it publishes the message created event.
z-user-platform | string Example: iOS Indicates where the message was sent from (Web, Mobile, iOS, Android.) |
z-message-origin | string Example: HDP Indicates source through which the sender's message arrives in SBC (e.g., HDP, SMS_reply, ZIM_inbox). |
z-idempotency-key | string Example: 93aae560-e4f6-11ef-a6d8-f2a8468e00ea Indicates idempotency key for the message. |
conversation_id required | string conversation_id is the unique id of the conversation. |
required | object |
{- "conversation_id": "986b391a-0a5c-11ef-bc51-96e8f7b18a49",
- "message": {
- "sender": {
- "id": "32646860",
- "type": "zuid"
}, - "message": "Hello from Beth",
- "metadata": [
- {
- "type": "plain_text",
- "data": "hello world!"
}
], - "is_silent": false,
- "recipients": [
- {
- "id": "32646860",
- "type": "zuid"
}
], - "attachments": [
- {
- "filename": "autotest_samplejpg.jpg",
- "upload_token": "z6gz7fjjg"
}
]
}
}
{- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "message_id": 1789930931922931700,
- "create_dt": "2024-05-13T08:09:24.136Z"
}
The client would call SBC’s /GetUploadURL endpoint with payload provided. Then SBC will do following:
Request Auth JWT token for the tenant which this conversation uses for saving data. Do an authenticated request to zDocs /api/v1/documents/actions/upload/request (spec) to retrieve a pre-signed url with a TTL of 24 hours SBC’s response to client will contain both the zDocs signedUrl and the expires_at time.
conversation_id required | string conversation_id is the unique id of the conversation. |
{- "conversation_id": "986b391a-0a5c-11ef-bc51-96e8f7b18a49"
}
{- "expires_at": "2006-01-02T15:04:05.999999999Z07:00"
}
Retrieves new OAuth Token
z-client-id required | string non-empty The name of the service which is making the request |
client_id required | string non-empty Zillow OAuth Client ID |
client_secret required | string non-empty Zillow OAuth Client Secret |
grant_type required | string non-empty Grant type, always 'client_credentials' |
scopes required | Array of strings Array of requested scopes. 'sbc/conversations.write' is necessary. |
{- "client_id": "string",
- "client_secret": "string",
- "grant_type": "string",
- "scopes": [
- "string"
]
}
{- "access_token": "string",
- "token_type": "string",
- "expires_in": 0
}
Lists conversations for a participant or a group of participants.
participant required | Array of strings non-empty One or more participant ID in the format of |
limit | integer <int32> Limits the number of returned conversations when querying for a single participant. If omitted, all matching conversations are returned. Does not apply to querying for a group of participants. |
cursor | string A pagination marker from which to continue retrieving next |
exact_match | boolean When set to true, multi-participant search for N participants may find exactly one conversation: the one involving all the participants and no one else. When set to false or omitted, returns the conversations which involve all the listed participants and may be some additional users - having N+ participants. |
is_archived | boolean Filter the conversations by is_archived status |
z-client-id required | string non-empty The name of the service which is making the request |
{- "conversations": [
- {
- "latest_message": {
- "attachments": [
- {
- "preview_url": "string",
- "preview_url_expires_at": "string",
- "download_url": "string",
- "download_url_expires_at": "string",
- "id": "string",
- "filename": "string",
- "mime_type": "string"
}
], - "metadata": [
- {
- "data": "string",
- "type": "string"
}
], - "recipients": [
- {
- "userid": "string",
- "userid_type": "string",
- "delivery_status": "string",
- "delivery_failure_reason": "string",
- "update_dt": "string"
}
], - "sender": {
- "userid": "string",
- "userid_type": "string"
}, - "id": "string",
- "body": "string",
- "is_silent": true,
- "create_dt": "string",
- "update_dt": "string"
}, - "metadata": [
- {
- "data": "string",
- "type": "string"
}
], - "participants": [
- {
- "userid": "string",
- "userid_type": "string",
- "persona": "string",
- "channels": [
- {
- "type": "SMS",
- "phone_number": "string"
}
], - "create_dt": "string",
- "update_dt": "string"
}
], - "id": "string",
- "is_archived": true,
- "create_dt": "string",
- "update_dt": "string"
}
], - "meta": {
- "cursor": "string"
}
}
Creates a one-to-one or group conversation.
The set of participants, identified by their userid
and userid_type
pairs, must be unique.
If a conversation with the given set of participants already exists, a 409 error is returned.
z-client-id required | string non-empty The name of the service which is making the request |
Array of objects Some additional information about this conversation | |
required | Array of objects >= 2 items Participants, at least two |
{- "metadata": [
- {
- "type": "discussion-topic",
- "data": "Pizza"
}
], - "participants": [
- {
- "userid": "+14158887766",
- "userid_type": "phone",
- "persona": "CUSTOMER",
- "channels": [
- {
- "type": "SMS",
- "phone_number": "string"
}
]
}, - {
- "userid": "+14158887766",
- "userid_type": "phone",
- "persona": "CUSTOMER",
- "channels": [
- {
- "type": "SMS",
- "phone_number": "string"
}
]
}
]
}
{- "metadata": [
- {
- "data": "string",
- "type": "string"
}
], - "participants": [
- {
- "userid": "string",
- "userid_type": "string",
- "persona": "string",
- "channels": [
- {
- "type": "SMS",
- "phone_number": "string"
}
], - "create_dt": "string",
- "update_dt": "string"
}
], - "id": "string",
- "is_archived": true,
- "create_dt": "string",
- "update_dt": "string"
}
Retrieves details about a conversation. Messages are not included.
convID required | string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}... Conversation UUID |
z-client-id required | string non-empty The name of the service which is making the request |
{- "metadata": [
- {
- "data": "string",
- "type": "string"
}
], - "participants": [
- {
- "userid": "string",
- "userid_type": "string",
- "persona": "string",
- "channels": [
- {
- "type": "SMS",
- "phone_number": "string"
}
], - "create_dt": "string",
- "update_dt": "string"
}
], - "id": "string",
- "is_archived": true,
- "create_dt": "string",
- "update_dt": "string"
}
This endpoint allows users to update a subset of mutable fields (listed below). If a field is included it will be updated, otherwise it will be ignored. The conversation must exist, otherwise a 404 error is returned.
convID required | string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}... Conversation UUID |
z-client-id required | string non-empty The name of the service which is making the request |
is_archived | boolean If true, the conversation will be marked as archived; if false, it will be unarchived. Archived conversations cannot send or receive new messages |
Array of objects A list of metadata objects to associate with the conversation. Each metadata entry can store additional information about the conversation. |
{- "is_archived": true,
- "metadata": [
- {
- "data": "string",
- "type": "string"
}
]
}
{- "msg": "string",
- "meta": { }
}
Adds one or more participants to an existing conversation. The conversation must exist, otherwise a 409 conflict is returned.
convID required | string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}... Conversation UUID |
z-client-id required | string non-empty The name of the service which is making the request |
required | Array of objects non-empty Participants, at least one |
{- "participants": [
- {
- "userid": "+14158887766",
- "userid_type": "phone",
- "persona": "CUSTOMER",
- "channels": [
- {
- "type": "SMS",
- "phone_number": "string"
}
]
}
]
}
{- "msg": "string",
- "meta": { }
}
Creates a signed, expiring upload URL for uploading media files.
convID required | string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}... Conversation UUID |
z-client-id required | string non-empty The name of the service which is making the request |
{- "upload_url": "string",
- "expires_at": "string"
}
Retrieves a summary of conversations for a user, including unread message counts. Can be filtered by allowed channel types.
userID required | string Examples: phone:+14158887722 User ID for which the conversation summary is requested |
conversation_channel_type | Array of strings List only those conversations where ALL participants use that channel type |
z-client-id required | string non-empty The name of the service which is making the request |
{- "conversations": [
- {
- "id": "string",
- "unread_count": 0
}
]
}
Get all the details of the message. Given a conversation ID and a message ID, this endpoint will fetch the relevant attributes of the requested message. If the message is not found, then a 404 error is returned.
convID required | string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}... |
required | string or string |
z-client-id required | string non-empty The name of the service which is making the request |
{- "attachments": [
- {
- "preview_url": "string",
- "preview_url_expires_at": "string",
- "download_url": "string",
- "download_url_expires_at": "string",
- "id": "string",
- "filename": "string",
- "mime_type": "string"
}
], - "metadata": [
- {
- "data": "string",
- "type": "string"
}
], - "recipients": [
- {
- "userid": "string",
- "userid_type": "string",
- "delivery_status": "string",
- "delivery_failure_reason": "string",
- "update_dt": "string"
}
], - "sender": {
- "userid": "string",
- "userid_type": "string"
}, - "id": "string",
- "body": "string",
- "is_silent": true,
- "create_dt": "string",
- "update_dt": "string"
}
Given a conversation ID and a limit, fetches the limit number of the messages for that conversation. If the conversation does not exist, then a 404 error is returned.
convID required | string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}... Conversation UUID |
participant | Array of strings Optional query parameter to allow filtering by participants. It accepts an array of participant ids of the form {type:ID} |
limit | integer <int32> [ 1 .. 250 ] Optional query parameter to return the provided limit number of messages. Should be in the range of [1, 250]. Defaults to 20 messages if the parameter is not provided. |
before | string Optional query parameter for cursor-based pagination. Returns messages that were created before (older than) the specified cursor. Cannot be used together with the 'after' parameter. |
after | string Optional query parameter for cursor-based pagination. Returns messages that were created after (newer than) the specified cursor. Cannot be used together with the 'before' parameter. |
z-client-id required | string non-empty The name of the service which is making the request |
{- "messages": [
- {
- "attachments": [
- {
- "preview_url": "string",
- "preview_url_expires_at": "string",
- "download_url": "string",
- "download_url_expires_at": "string",
- "id": "string",
- "filename": "string",
- "mime_type": "string"
}
], - "metadata": [
- {
- "data": "string",
- "type": "string"
}
], - "recipients": [
- {
- "userid": "string",
- "userid_type": "string",
- "delivery_status": "string",
- "delivery_failure_reason": "string",
- "update_dt": "string"
}
], - "sender": {
- "userid": "string",
- "userid_type": "string"
}, - "id": "string",
- "body": "string",
- "is_silent": true,
- "create_dt": "string",
- "update_dt": "string"
}
], - "meta": {
- "cursor": "string"
}
}
Given a Conversation ID, adds a message to the conversation.
Clients can specify the origin of the message (e.g., HDP, SMS_reply, ZIM_inbox) and the platform (Web, Mobile, iOS, Android) using dedicated headers. These headers allow SBC to track where the message was sent from and the platform used.
Idempotency is also supported by including a dedicated z-idempotency-key header in the request.
The endpoint increments the unread count of other participants and kicks off the async process for message delivery.
The message can include text, metadata or attachments (files, images). The endpoint checks that Sender is a participant in the conversation. Supports targeted messages by specifying a set of recipients (subset of participants). Otherwise message will be delivered to all the participants in the conversation. Supports silent messages (via is_silent field) which means the message will not be counted towards unread count and is also not shown in the latest message view.
convID required | string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}... Conversation UUID |
z-client-id required | string non-empty The name of the service which is making the request |
z-user-platform | string Indicates where the message was sent from - Web, Mobile, iOS, Android. |
z-message-origin | string Indicates source through which the sender's message arrives in SBC. e.g., HDP, SMS_reply, ZIM_inbox. |
z-idempotency-key | string Indicates idempotency key for the message. Rejects duplicate requests with the same key |
body required | string The plain text content of the message |
is_silent | boolean When true, the message will not count towards unread count and also doesn't show up in the latest message view. Default value is false. |
required | object Reference to the user sending the message |
Array of objects If empty or omitted, message will be delivered to all the participants Otherwise, message will be delivered to specified recipients | |
Array of objects Additional metadata associated with the message | |
Array of objects Files or other content attached to the message |
{- "body": "string",
- "is_silent": true,
- "sender": {
- "userid": "string",
- "userid_type": "string"
}, - "recipients": [
- {
- "userid": "string",
- "userid_type": "string"
}
], - "metadata": [
- {
- "data": "string",
- "type": "string"
}
], - "attachments": [
- {
- "filename": "string",
- "upload_token": "string"
}
]
}
{- "attachments": [
- {
- "preview_url": "string",
- "preview_url_expires_at": "string",
- "download_url": "string",
- "download_url_expires_at": "string",
- "id": "string",
- "filename": "string",
- "mime_type": "string"
}
], - "metadata": [
- {
- "data": "string",
- "type": "string"
}
], - "recipients": [
- {
- "userid": "string",
- "userid_type": "string",
- "delivery_status": "string",
- "delivery_failure_reason": "string",
- "update_dt": "string"
}
], - "sender": {
- "userid": "string",
- "userid_type": "string"
}, - "id": "string",
- "body": "string",
- "is_silent": true,
- "create_dt": "string",
- "update_dt": "string"
}
Updates the delivery status of a given recipient.
This endpoint allows users to update the delivery status and/or failure reason for a message's recipient.
If the status is FAILED
, failure reason may be provided.
convID required | string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}... Conversation UUID |
required | string or string Message ID |
userID required | string Examples: phone:+14158887722 Participant details in the format of |
z-client-id required | string non-empty The name of the service which is making the request |
delivery_status required | string Enum: "UNDEFINED" "PENDING" "FANOUT" "SENT" "DELIVERED" "CLIENT_RECEIVED" "READ" "FAILED" "UNDELIVERED" "NOT_APPLICABLE" The delivery status of the message for the recipient. |
delivery_failure_reason | string The optional failure reason for cases where the delivery status is |
{- "delivery_status": "UNDEFINED",
- "delivery_failure_reason": "string"
}
{- "msg": "string",
- "meta": { }
}
Message Status gives clients the ability to track the delivery status of each message through the SBC platform. These statuses are updated in real time and reflect the current state of delivery from the platform's perspective.
The diagram below illustrates the various statuses a message can have throughout the conversation flow.
Status | Definition |
---|---|
UNDEFINED | The default value. |
PENDING | The message has been created and is in the queue, waiting to be processed. This status indicates that the message has not yet been sent and is still in the intial stages of delivery. |
FANOUT | The message is being processed by SBC Delivery System. |
SENT | The message has been successfully sent to the recipient's messaging service or network. This status confirms that the message has been handed off by SBC but does not yet guarantee that it has been received by the recipient. |
DELIVERED | The message has been successfully delivered to the recipient's application. This status confirms that the message is now available for the recipient to view. It indicates successful transmission of a message from SBC to the messaging service; however, it does not guarantee that the receipient received the message on their native device. |
CLIENT_RECEIVED | This status indicates that the recipient has received a notification of the message on their device. NOTE: Not all client systems support this status. |
READ | This status indicates that the recipient has opened and viewed the message. It confirms that the message has not only been delivered but also seen by the recipient, providing an additional level of confirmation beyond delivery. |
FAILED | The message could not be sent or delivered by SBC due to an error. This status indicates that an issue occurred during the delivery process for SBC, and the message was not successfully sent or received. |
UNDELIVERED | The client could not deliver the message to the recipient. |
NOT_APPLICABLE | The message isn't meant to be delivered to this recipient by SBC. Usually happens for inbound SMS messages in SMS group conversation. Such messages are delivered to other SMS recipients by the messaging service, not SBC. |
SBC allows for updating the message status on a per-participant basis, enabling the capture of individual recipient engagement. When a message status is updated for a recipient, it will also impact that user's unread message count. Specifically, marking a message as read will reset the user's last read message to the one indicated in the request payload, ensuring accurate tracking of message engagement and unread messages.
conversation_id required | string conversation_id is the unique id for the conversation. |
message_id required | any message_id is the ID of the message |
required | object is the participant's id and type |
status required | string Enum: "PENDING" "SENT" "DELIVERED" "CLIENT_RECEIVED" "READ" "FAILED" "UNDELIVERED" Go to message status definitions. |
{- "conversation_id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "message_id": "1789930931922931712",
- "recipient": {
- "id": "32646860",
- "type": "zuid"
}, - "status": "SENT"
}
{ }
Post hooks are HTTP callbacks that Switchboard sends to your application when specific events occur within the platform. These webhooks allow your system to react in real-time to events such as message delivery, conversation updates, and status changes.
Event Type | Description | Trigger |
---|---|---|
message.created | Triggered when a message is successfully sent | After message passes through SBC delivery system |
message.updated | Triggered when a message is updated | When message is updated |
conversation.created | Triggered when a new conversation is created | After successful conversation creation |
conversation.updated | Triggered when conversation details are modified | When conversation is archived or metadata changes |
participant.created | Triggered when participants are added to conversation | After successful participant addition |
All post hooks follow a consistent payload structure based on the PostHookRequest schema. Any changes to the schema will be backwards compatible. Each webhook contains:
For complete schema definitions, see the PostHookRequest and related schemas in the components section.
This documents the webhook payload structure that Switchboard sends to your registered webhook URL.
When events occur in Switchboard (message creation, conversation updates, etc.), the system will send HTTP POST requests to your configured webhook endpoint with this payload structure.
Webhook Configuration:
Event Types:
message.created
- Triggered when a message is successfully sentmessage.updated
- Triggered when a message is updatedconversation.created
- Triggered when a new conversation is createdconversation.updated
- Triggered when conversation details are modifiedparticipant.created
- Triggered when participants are added to a conversationparticipant.updated
- Triggered when participant details are modifiedPayload Structure:
All webhooks follow the consistent PostHookRequest
schema structure shown below.
The webhook payload sent by Switchboard to your configured endpoint
event_id required | string non-empty Unique identifier for the webhook event |
event_dt required | string The timestamp (ISO 8601 format) indicating when the system created the event |
event_type required | string Enum: "message.created" "message.updated" "conversation.created" "conversation.updated" "participant.created" "participant.updated" The type of post-hook event that occurred |
required | object Structured contextual data included with the event, such as the associated conversation, message, participants, etc |
required | object Previous state of the resource (empty object for creation events) |
required | object The updated state of the resource after the event |
Example webhook payload when a new message is created
{- "event_id": "550e8400-e29b-41d4-a716-446655440000",
- "event_dt": "2024-05-13T08:09:24.136Z",
- "event_type": "message.created",
- "context": {
- "conversation": {
- "id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "is_archived": false,
- "metadata": [ ],
- "participants": [
- {
- "userid": "32646860",
- "userid_type": "zuid",
- "persona": "CONSUMER"
}, - {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:09:24.136Z"
}
}, - "before": { },
- "after": {
- "message": {
- "id": "1789930931922931712",
- "body": "Hello from Beth",
- "is_silent": false,
- "attachments": [ ],
- "metadata": [ ],
- "sender": {
- "id": "32646860",
- "type": "zuid"
}, - "recipients": [
- {
- "userid": "32646861",
- "userid_type": "zuid",
- "delivery_status": "SENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z"
}
}
}
This webhook is triggered after a message passes through the SBC delivery system and is successfully sent to recipients.
Information about the message that was created
event_id required | string non-empty Unique identifier for the webhook event |
event_dt required | string The timestamp (ISO 8601 format) indicating when the system created the event |
event_type required | string Enum: "message.created" "message.updated" "conversation.created" "conversation.updated" "participant.created" "participant.updated" The type of post-hook event that occurred |
required | object Structured contextual data included with the event, such as the associated conversation, message, participants, etc |
required | object Previous state of the resource (empty object for creation events) |
required | object The updated state of the resource after the event |
{- "event_id": "550e8400-e29b-41d4-a716-446655440000",
- "event_dt": "2024-05-13T08:09:24.136Z",
- "event_type": "message.created",
- "context": {
- "conversation": {
- "id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "is_archived": false,
- "metadata": [ ],
- "participants": [
- {
- "userid": "32646860",
- "userid_type": "zuid",
- "persona": "CONSUMER"
}, - {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:09:24.136Z"
}
}, - "before": { },
- "after": {
- "message": {
- "id": "1789930931922931712",
- "body": "Hello from Beth",
- "is_silent": false,
- "attachments": [ ],
- "metadata": [ ],
- "sender": {
- "id": "32646860",
- "type": "zuid"
}, - "recipients": [
- {
- "userid": "32646861",
- "userid_type": "zuid",
- "delivery_status": "SENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z"
}
}
}
This webhook is triggered when a message is updated, such as when the delivery status changes for recipients.
Information about the message that was updated
event_id required | string non-empty Unique identifier for the webhook event |
event_dt required | string The timestamp (ISO 8601 format) indicating when the system created the event |
event_type required | string Enum: "message.created" "message.updated" "conversation.created" "conversation.updated" "participant.created" "participant.updated" The type of post-hook event that occurred |
required | object Structured contextual data included with the event, such as the associated conversation, message, participants, etc |
required | object Previous state of the resource (empty object for creation events) |
required | object The updated state of the resource after the event |
{- "event_id": "550e8400-e29b-41d4-a716-446655440003",
- "event_dt": "2024-05-13T08:10:15.247Z",
- "event_type": "message.updated",
- "context": {
- "conversation": {
- "id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "is_archived": false,
- "metadata": [ ],
- "participants": [
- {
- "userid": "32646860",
- "userid_type": "zuid",
- "persona": "CONSUMER"
}, - {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:09:24.136Z"
}
}, - "before": {
- "message": {
- "id": "1789930931922931712",
- "body": "Hello from Beth",
- "is_silent": false,
- "attachments": [ ],
- "metadata": [ ],
- "sender": {
- "id": "32646860",
- "type": "zuid"
}, - "recipients": [
- {
- "userid": "32646861",
- "userid_type": "zuid",
- "delivery_status": "SENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:09:24.136Z"
}
}, - "after": {
- "message": {
- "id": "1789930931922931712",
- "body": "Hello from Beth",
- "is_silent": false,
- "attachments": [ ],
- "metadata": [ ],
- "sender": {
- "id": "32646860",
- "type": "zuid"
}, - "recipients": [
- {
- "userid": "32646861",
- "userid_type": "zuid",
- "delivery_status": "DELIVERED"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:10:15.247Z"
}
}
}
This webhook is triggered after a conversation is successfully created with participants.
Information about the conversation that was created
event_id required | string non-empty Unique identifier for the webhook event |
event_dt required | string The timestamp (ISO 8601 format) indicating when the system created the event |
event_type required | string Enum: "message.created" "message.updated" "conversation.created" "conversation.updated" "participant.created" "participant.updated" The type of post-hook event that occurred |
required | object Structured contextual data included with the event, such as the associated conversation, message, participants, etc |
required | object Previous state of the resource (empty object for creation events) |
required | object The updated state of the resource after the event |
{- "event_id": "550e8400-e29b-41d4-a716-446655440001",
- "event_dt": "2024-05-13T08:09:24.136Z",
- "event_type": "conversation.created",
- "context": { },
- "before": { },
- "after": {
- "conversation": {
- "id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "is_archived": false,
- "participants": [
- {
- "userid": "32646860",
- "userid_type": "zuid",
- "persona": "CONSUMER"
}, - {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z"
}
}
}
This webhook is triggered when conversation details are modified, such as when a conversation is archived or metadata changes.
Information about the conversation that was updated
event_id required | string non-empty Unique identifier for the webhook event |
event_dt required | string The timestamp (ISO 8601 format) indicating when the system created the event |
event_type required | string Enum: "message.created" "message.updated" "conversation.created" "conversation.updated" "participant.created" "participant.updated" The type of post-hook event that occurred |
required | object Structured contextual data included with the event, such as the associated conversation, message, participants, etc |
required | object Previous state of the resource (empty object for creation events) |
required | object The updated state of the resource after the event |
{- "event_id": "550e8400-e29b-41d4-a716-446655440004",
- "event_dt": "2024-05-13T08:15:30.542Z",
- "event_type": "conversation.updated",
- "context": { },
- "before": {
- "conversation": {
- "id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "is_archived": false,
- "metadata": [ ],
- "participants": [
- {
- "userid": "32646860",
- "userid_type": "zuid",
- "persona": "CONSUMER"
}, - {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:09:24.136Z"
}
}, - "after": {
- "conversation": {
- "id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "is_archived": true,
- "metadata": [ ],
- "participants": [
- {
- "userid": "32646860",
- "userid_type": "zuid",
- "persona": "CONSUMER"
}, - {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:15:30.542Z"
}
}
}
This webhook is triggered after participants are successfully added to an existing conversation.
Information about the participant that was added
event_id required | string non-empty Unique identifier for the webhook event |
event_dt required | string The timestamp (ISO 8601 format) indicating when the system created the event |
event_type required | string Enum: "message.created" "message.updated" "conversation.created" "conversation.updated" "participant.created" "participant.updated" The type of post-hook event that occurred |
required | object Structured contextual data included with the event, such as the associated conversation, message, participants, etc |
required | object Previous state of the resource (empty object for creation events) |
required | object The updated state of the resource after the event |
{- "event_id": "550e8400-e29b-41d4-a716-446655440002",
- "event_dt": "2024-05-13T08:09:24.136Z",
- "event_type": "participant.created",
- "context": {
- "conversation": {
- "id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "is_archived": false,
- "metadata": [ ],
- "participants": [
- {
- "userid": "32646860",
- "userid_type": "zuid",
- "persona": "CONSUMER"
}, - {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:09:24.136Z"
}
}, - "before": { },
- "after": {
- "participant": {
- "userid": "32646862",
- "userid_type": "zuid",
- "persona": "CONSUMER",
- "channels": [
- {
- "type": "IN_APP",
- "in_app": {
- "native_system": "beth-messaging-service"
}
}
], - "create_dt": "2024-05-13T08:09:24.136Z"
}
}
}
This webhook is triggered when a participant is updated in a conversation, such as when participant metadata or channel information changes.
Information about the participant that was updated
event_id required | string non-empty Unique identifier for the webhook event |
event_dt required | string The timestamp (ISO 8601 format) indicating when the system created the event |
event_type required | string Enum: "message.created" "message.updated" "conversation.created" "conversation.updated" "participant.created" "participant.updated" The type of post-hook event that occurred |
required | object Structured contextual data included with the event, such as the associated conversation, message, participants, etc |
required | object Previous state of the resource (empty object for creation events) |
required | object The updated state of the resource after the event |
{- "event_id": "550e8400-e29b-41d4-a716-446655440007",
- "event_dt": "2024-05-13T08:30:42.123Z",
- "event_type": "participant.updated",
- "context": {
- "conversation": {
- "id": "829feab5-1166-11ef-a6af-16e4c685cd49",
- "is_archived": false,
- "metadata": [ ],
- "participants": [
- {
- "userid": "32646860",
- "userid_type": "zuid",
- "persona": "CONSUMER"
}, - {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT"
}
], - "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:09:24.136Z"
}
}, - "before": {
- "participant": {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT",
- "channels": [
- {
- "type": "IN_APP",
- "in_app": {
- "native_system": "beth-messaging-service"
}
}
], - "metadata": [ ],
- "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:09:24.136Z"
}
}, - "after": {
- "participant": {
- "userid": "32646861",
- "userid_type": "zuid",
- "persona": "AGENT",
- "channels": [
- {
- "type": "IN_APP",
- "in_app": {
- "native_system": "agent-messaging-service"
}
}
], - "metadata": [ ],
- "create_dt": "2024-05-13T08:09:24.136Z",
- "update_dt": "2024-05-13T08:30:42.123Z"
}
}
}
Allows a client to send a notification to a recipient on a specific channel.
conversation_id required | string conversation_id is the unique id of the conversation. |
message_id | string message_id is the unique id of the message generated by SBC. |
required | object |
{- "conversation_id": "986b391a-0a5c-11ef-bc51-96e8f7b18a49",
- "message_id": "1789930931922931712",
- "notification": {
- "content": "Hi Beth! You have a new Notification from Alan.",
- "recipient": {
- "id": "32646860",
- "type": "zuid"
}, - "channel": {
- "type": "IN_APP",
- "sms": {
- "phone_number": "+12061234567"
}, - "in_app": {
- "native_system": "beth-messaging-service-switchboard-api-gateway-dev",
- "projected_address": {
- "phone_number": "+12061234567"
}
}
}
}
}
{ }