Skip to content

Overview

Send and receive messages globally over SMS, RCS, WhatsApp, Viber Business, Facebook messenger and other popular channels using the Sinch Conversation API.

Note:

If you would like help setting up your Conversation API solution, and want to quickly get started sending and receiving messages, review our Getting Started guide.

The Conversation API endpoint uses built-in transcoding to give you the power of conversation across all supported channels and, if required, full control over channel specific features.

Download the OpenAPI specification here.

Authentication

OAuth2.0 authentication

Achieve more secure API authentication with OAuth 2.0 access tokens.

Access tokens are short lived. Typically, they will only last one hour. This is done to keep your data (and ours) safer.

In exchanging credentials, you'll get a long string called an access token. This access token will serve as your bearer token in the authorization header of API calls.

Find your credentials in the Sinch Build Dashboard.

There are two pieces of information needed to obtain an access token: the key ID and key secret corresponding to your project ID.

To get an access token, do the following:

  1. Login to the Sinch Build Dashboard to get your access keys.

  2. Click on Create Access Key and when prompted, enter a display name, then click Confirm.

    Does it have to be a new key?

    Not at all. If you have existing credentials saved, feel free to use them.

  3. A Key ID and Key Secret will display. Save the project ID, key ID, and key secret someplace safe.

    Important!

    The key secret is only viewable at the time of initial creation.

    If you accidentally misplace they key secret, no worries! Create a new key.

  4. Using the following curl command, get your access token using the key ID and key secret.

    curl https://auth.sinch.com/oauth2/token \
    -d grant_type=client_credentials \
    -u YOUR_Key_ID:YOUR_Key_Secret
  5. You'll see your new access token in the response. Now you're ready to use this token on calls to the API. The access token will be useable for one hour.

Short lived

The access token is meant to be short lived for enhanced security. Generate one as often as it is necessary.

Basic authentication

HTTP Basic authentication works on all Sinch REST APIs. Basic auth is often the preferred option for testing because it is simple and easy to use.

Important!

Basic authentication is intended for test purposes only, and should only be used for experimenting with APIs and building prototypes. API calls using basic authentication are heavily rate limited, and these limits may change at any time without warning. Production systems should use OAuth access tokens instead.

Basic authentication is sent in the authorization header with each call.

No matter the programming language, there are three main components for successful basic authentication in a request:

  • The designation of authorization type, which is basic
  • The username, which in Sinch's case is YOUR_Key_ID, corresponding to your project
  • The password, which is YOUR_Key_Secret, again, corresponding to the project

You can view and manage your API credentials here.

Need help?

Check out this article for a walk-through on finding your key and secret.

To use basic auth in an API call, do the following:

  1. First, create a new access key in the Sinch Build Dashboard by clicking Create Access Key.

  2. Copy your project ID, key ID, and key secret.

    Important!

    Keep your key secret somewhere safe as it is only viewable upon initial project creation. The project ID and key ID are always readily available in the Sinch Build Dashboard. If you misplace your key secret, simply generate a new key!

  3. Use your key ID as the username (sometimes called the client_id) and your key secret as the password (can be referred to as the client_secret) in every call made to a Sinch API.

Base URL

The following URLs can be used when making calls to the Conversation API (or Template Management API, which is used in coordination with the Conversation API). The Conversation Batch API endpoints, which are available for beta testing, are also listed.

ServerURL
Conversation API (US Production)https://us.conversation.api.sinch.com
Conversation API (EU Production)https://eu.conversation.api.sinch.com
Conversation API (BR Production)https://br.conversation.api.sinch.com
Template Management API (US Production)https://us.template.api.sinch.com
Template Management API (EU Production)https://eu.template.api.sinch.com
Template Management API (BR Production)https://br.template.api.sinch.com
Conversation Batch API (Beta) (US)https://us.conversationbatch.api.sinch.com
Conversation Batch API (Beta) (EU)https://eu.conversationbatch.api.sinch.com
Conversation Batch API (Beta) (BR)https://br.conversationbatch.api.sinch.com

Note that, when making a call to the Conversation API or Template Management API, you must target the regional server that corresponds to the region in which you created your Conversation API app.

Postman collection

Sinch offers a Postman collection for easy setup and testing during development. For ease of use, follow the next link Postman Collection, into a Firefox browser or, use the Import option in Postman.

After importing the collection, fill in the following variables:

VariableValue
PROJECTYour PROJECT ID
APPYour app ID
CLIENT_IDYour CLIENT_ID
CLIENT_SECRETYour client secret

For testing purposes, fill the WEBHOOK_URL by visiting https://webhook.site/ and use the generated link - the one under the Your unique URL label.

Caution:

The https://webhook.site/ URL given above should only be used for testing purposes. Using the Conversation API can generate high volumes of callbacks, which can easily exceed the TPS limits of certain webhook services. Additionally, sensitive information may be included in the callback, including message content and contact information. Ensure that you use a scalable and secure callback/webhook processor after your initial testing is complete.

Values for other variables can be obtained by calling corresponding requests:

  • CONTACT - ID of contact created by calling Create contact request.
  • WEBHOOK_ID - ID of webhook created by calling Create webhook request.
  • CONVERSATION - a Conversation is created automatically when sending a new message. For example, with a Text Message request, send a message, then call List conversations to get the ID of the conversation for this variable.

Errors

When requests are erroneous, the Sinch Conversation API will respond with standard HTTP status codes, such as 4xx for client errors. All responses include a JSON body of the form:

{
  "error": {
    "code": 401,
    "message": "Request had invalid credentials.",
    "status": "UNAUTHENTICATED",
    "details": [{
      "@type": "type.googleapis.com/google.rpc.RetryInfo",
      ...
    }]
  }
}

The table below describes the fields of the error object:

NameDescriptionJSON Type
CodeHTTP status codeNumber
MessageA developer-facing error messageString
StatusResponse status nameString
DetailsList of detailed error descriptionsArray of objects

Common error responses

StatusDescription
400Malformed request. For example, the message body of a request made to the message/send endpoint does not contain the app_id field, which is required. Alternatively, this error may be triggered if required fields are included, but populated incorrectly. For example, the app_id field is included in a message/send request, but the value is not a ULID (and, therefore, fails a basic form check).
401Incorrect credentials. For example, you may get this error if you provide incorrect client_id and client_secret values when using basic authentication. You may also get this error if you provide a bearer token generated using incorrect basic authentication credentials or if you provide an expired token (generated using the OAuth2.0 client credentials flow).
403Correct credentials but you don't have access to the requested resource. This typically occurs paired with an UNAUTHORIZED message when the provided client_id and client_secret are not associated with the project_id required for most Conversation API calls. Starting February 19, 2025, this error may also be paired with a BILLING_CREDIT_LIMIT_BREACHED message. If paired with BILLING_CREDIT_LIMIT_BREACHED message, the project is blocked due to credit reasons. In this case, check your project's billing configuration and balance.
404The resources provided for the call are insufficient to complete the call, or the server cannot locate the required resources. For example, if the app_id provided in the call doesn't match a Conversation API app contained within the corresponding project, or the region in which the app was created does not match the regional server targeted by the call. Additionally, this error occurs if you provide designate Conversation API endpoint that doesn't actually exist.
429See Rate Limits.
500Something went wrong on our end, try again with exponential back-off
501Something went wrong on our end, try again with exponential back-off
503Something went wrong on our end, try again with exponential back-off

Rate Limits

The Conversation API has two kinds of rate limits that may result in status 429 Too Many Requests:

  • Conversation API apps have a maximum MT ingress queue size of 500000 messages, which are drained towards the channel at a rate of 20 messages per second by default (this rate may be higher if the channel has been purchased with a higher capacity).
  • Projects are limited to 800 requests per second across all apps and most endpoints. Making over 800 requests per second over an extended period of time may saturate the app-specific ingress queue, resulting in rate limiting.

In addition to project and app level limitations, each channel also has rate limitations that can affect performance, and may return a 429 Too Many Requests error. In some cases (for example, the SMS channel), these rate limits can be adjusted. In others (for example, the Instagram channel), they can't be adjusted. For more information about raising project, app, or channel rate limits, contact your Sinch account manager.

Download OpenAPI description
Overview
support at sinch

support@sinch.com

License

MIT

Languages
Servers
The {region} variable must be set to us, eu, or br, and it must match the region in which you created your Conversation API app.

https://{region}.conversation.api.sinch.com/

Messages

To start sending messages you must have a Conversation API app. The app holds information about the channel credentials and registered webhooks to which the API delivers callbacks such as message delivery receipts and contact messages. If you don't already have an app please follow the instructions in the getting started guide available in the Sinch Dashboard to create one.

Operations

App

Apps are created and configured through the Sinch Dashboard, are tied to the API user and come with a set of channel credentials for each underlying connected channel. The app has a list of conversations between itself and different contacts which share the same project.

Webhooks, which the app is attached to, defines the destination for various events coming from the Conversation API. An app has the following configurable properties:

FieldDescription
Display nameThe name visible in the Sinch Dashboard.
Conversation metadata reportSpecifies the amount of conversationmetadata that's returned as part of each callback.
Retention PolicyThe retention policy specifies how long messages, sent to or from an app, are stored by the Conversation API.
Operations

Contact

A contact is a collection that groups together underlying connected channel recipient identities. It's tied to a specific project and is therefore considered public to all apps sharing the same project. Most contact creation and maintenance is handled by the Conversation API's automatic contact management processes. However, you can also use API calls to manually manage your contacts.

A contact has the following configurable properties:

FieldDescription
Channel identitiesList of channel identities specifying how the contact is identified on underlying channels
Channel prioritySpecifies the channel priority order used when sending messages to this contact. This can be overridden by message specific channel priority order.
Display nameOptional display name used in chat windows and other UIs
EmailOptional Email of the contact
External idOptional identifier of the contact in external systems
MetadataOptional metadata associated with the contact.
Operations

Conversation

Endpoints for working with the conversation log.

Operations

Request

This operation lists all conversations that are associated with an app and/or a contact.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

Query
app_idstring

The ID of the app involved in the conversations. Note that either app_id or contact_id is required in order for the operation to function correctly.

contact_idstring

Resource name (ID) of the contact. Note that either app_id or contact_id is required in order for the operation to function correctly.

only_activeboolean

Set to true to list only active conversations. Set to false to list only inactive conversations.

page_sizeinteger(int32)

The maximum number of conversations to fetch. Defaults to 10 and the maximum is 20.

page_tokenstring

Next page token previously returned if any.

active_channelstring(Channel Identifier)

Only fetch conversations from the active_channel

Enum ValueDescription
WHATSAPP

The WhatsApp channel.

RCS

The RCS channel.

SMS

The SMS channel.

MESSENGER

The Facebook Messenger channel.

VIBERBM

The Viber Business Messages channel.

MMS

The MMS channel.

INSTAGRAM

The Instagram channel.

TELEGRAM

The Telegram channel.

KAKAOTALK

The KakaoTalk channel.

KAKAOTALKCHAT

The KakaoTalk chat channel (used primarily in ConsultationTalk).

Example: active_channel=WHATSAPP
curl -i -X GET \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations?app_id=string&contact_id=string&only_active=true&page_size=0&page_token=string&active_channel=WHATSAPP'

Responses

A successful response.

Bodyapplication/json
conversationsArray of objects(Conversation)read-only

List of conversations matching the search query.

next_page_tokenstring

Token that should be included in the next request to fetch the next page.

total_sizeinteger(int32)
Response
application/json
{ "conversations": [ {} ], "next_page_token": "string", "total_size": 0 }

Request

Creates a new empty conversation. It is generally not needed to create a conversation explicitly since sending or receiving a message automatically creates a new conversation if it does not already exist between the given app and contact. Creating empty conversation is useful if the metadata of the conversation should be populated when the first message in the conversation is a contact message or the first message in the conversation comes out-of-band and needs to be injected with InjectMessage endpoint.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

Bodyapplication/jsonrequired

The conversation to create. ID will be generated for the conversation and any ID in the given conversation will be ignored.

app_idstringrequired

The ID of the participating app.

contact_idstringrequired

The ID of the participating contact.

activeboolean

Flag for whether this conversation is active.

active_channelstring(Channel Identifier)

The identifier of the channel you want to include. Must be one of the enum values.

Enum ValueDescription
WHATSAPP

The WhatsApp channel.

RCS

The RCS channel.

SMS

The SMS channel.

MESSENGER

The Facebook Messenger channel.

VIBERBM

The Viber Business Messages channel.

MMS

The MMS channel.

INSTAGRAM

The Instagram channel.

TELEGRAM

The Telegram channel.

KAKAOTALK

The KakaoTalk channel.

KAKAOTALKCHAT

The KakaoTalk chat channel (used primarily in ConsultationTalk).

Example: "WHATSAPP"
metadata_jsonobject

Arbitrary data set by the Conversation API clients and/or provided in the conversation_metadata field of a SendMessageRequest. A valid JSON object.

correlation_idstring

Arbitrary correlation ID related to the MT message set by the Conversation API user.

metadatastringDeprecated

Arbitrary data set by the Conversation API clients. Up to 1024 characters long. NOTE: This field has been deprecated due to changes in the system architecture or functionality. It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code.

curl -i -X POST \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations' \
  -H 'Content-Type: application/json' \
  -d '{
    "active": true,
    "active_channel": "WHATSAPP",
    "app_id": "{APP_ID}",
    "contact_id": "{CONTACT_ID}",
    "id": "string",
    "metadata": "string",
    "metadata_json": {}
  }'

Responses

A successful response.

Bodyapplication/json
activeboolean

Flag for whether this conversation is active.

active_channelstring(Channel Identifier)

The identifier of the channel you want to include. Must be one of the enum values.

Enum ValueDescription
WHATSAPP

The WhatsApp channel.

RCS

The RCS channel.

SMS

The SMS channel.

MESSENGER

The Facebook Messenger channel.

VIBERBM

The Viber Business Messages channel.

MMS

The MMS channel.

INSTAGRAM

The Instagram channel.

TELEGRAM

The Telegram channel.

KAKAOTALK

The KakaoTalk channel.

KAKAOTALKCHAT

The KakaoTalk chat channel (used primarily in ConsultationTalk).

Example: "WHATSAPP"
app_idstring

The ID of the participating app.

contact_idstring

The ID of the participating contact.

metadata_jsonobject

Arbitrary data set by the Conversation API clients and/or provided in the conversation_metadata field of a SendMessageRequest. A valid JSON object.

correlation_idstring

Arbitrary correlation ID related to the MT message set by the Conversation API user.

idstring

The ID of the conversation.

last_receivedstring(date-time)read-only

The timestamp of the latest message in the conversation. The timestamp will be Thursday January 01, 1970 00:00:00 UTC if the conversation contains no messages.

metadatastringDeprecated

Arbitrary data set by the Conversation API clients. Up to 1024 characters long. NOTE: This field has been deprecated due to changes in the system architecture or functionality. It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code.

Response
application/json
{ "active": true, "active_channel": "WHATSAPP", "app_id": "string", "contact_id": "string", "metadata": "string", "metadata_json": {}, "correlation_id": "string", "id": "string", "last_received": "2019-08-24T14:15:22Z" }

Request

Retrieves a conversation by id. A conversation has two participating entities, an app and a contact.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

conversation_idstringrequired

The unique ID of the conversation. This is generated by the system.

curl -i -X GET \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations/{conversation_id}'

Responses

A successful response.

Bodyapplication/json
activeboolean

Flag for whether this conversation is active.

active_channelstring(Channel Identifier)

The identifier of the channel you want to include. Must be one of the enum values.

Enum ValueDescription
WHATSAPP

The WhatsApp channel.

RCS

The RCS channel.

SMS

The SMS channel.

MESSENGER

The Facebook Messenger channel.

VIBERBM

The Viber Business Messages channel.

MMS

The MMS channel.

INSTAGRAM

The Instagram channel.

TELEGRAM

The Telegram channel.

KAKAOTALK

The KakaoTalk channel.

KAKAOTALKCHAT

The KakaoTalk chat channel (used primarily in ConsultationTalk).

Example: "WHATSAPP"
app_idstring

The ID of the participating app.

contact_idstring

The ID of the participating contact.

metadata_jsonobject

Arbitrary data set by the Conversation API clients and/or provided in the conversation_metadata field of a SendMessageRequest. A valid JSON object.

correlation_idstring

Arbitrary correlation ID related to the MT message set by the Conversation API user.

idstring

The ID of the conversation.

last_receivedstring(date-time)read-only

The timestamp of the latest message in the conversation. The timestamp will be Thursday January 01, 1970 00:00:00 UTC if the conversation contains no messages.

metadatastringDeprecated

Arbitrary data set by the Conversation API clients. Up to 1024 characters long. NOTE: This field has been deprecated due to changes in the system architecture or functionality. It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code.

Response
application/json
{ "active": true, "active_channel": "WHATSAPP", "app_id": "string", "contact_id": "string", "metadata": "string", "metadata_json": {}, "correlation_id": "string", "id": "string", "last_received": "2019-08-24T14:15:22Z" }

Request

Deletes a conversation together with all the messages sent as part of the conversation.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

conversation_idstringrequired

The unique ID of the conversation. This is generated by the system.

curl -i -X DELETE \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations/{conversation_id}'

Responses

A successful response.

Response
No content

Request

This operation updates a conversation which can, for instance, be used to update the metadata associated with a conversation.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

conversation_idstringrequired

The unique ID of the conversation. This is generated by the system.

Query
update_maskArray of strings

The set of field mask paths.

metadata_update_strategystring(MetadataUpdateStrategy)

Update strategy for the conversation_metadata field.

Default "REPLACE"
Enum ValueDescription
REPLACE

The default strategy. Replaces the whole conversation_metadata field with the new value provided.

MERGE_PATCH

Patches the conversation_metadata field with the patch provided according to RFC 7386.

Bodyapplication/jsonrequired

The updated conversation.

activeboolean

Flag for whether this conversation is active.

active_channelstring(Channel Identifier)

The identifier of the channel you want to include. Must be one of the enum values.

Enum ValueDescription
WHATSAPP

The WhatsApp channel.

RCS

The RCS channel.

SMS

The SMS channel.

MESSENGER

The Facebook Messenger channel.

VIBERBM

The Viber Business Messages channel.

MMS

The MMS channel.

INSTAGRAM

The Instagram channel.

TELEGRAM

The Telegram channel.

KAKAOTALK

The KakaoTalk channel.

KAKAOTALKCHAT

The KakaoTalk chat channel (used primarily in ConsultationTalk).

Example: "WHATSAPP"
app_idstring

The ID of the participating app.

contact_idstring

The ID of the participating contact.

metadata_jsonobject

Arbitrary data set by the Conversation API clients and/or provided in the conversation_metadata field of a SendMessageRequest. A valid JSON object.

correlation_idstring

Arbitrary correlation ID related to the MT message set by the Conversation API user.

idstring

The ID of the conversation.

metadatastringDeprecated

Arbitrary data set by the Conversation API clients. Up to 1024 characters long. NOTE: This field has been deprecated due to changes in the system architecture or functionality. It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code.

curl -i -X PATCH \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations/{conversation_id}?update_mask=string&metadata_update_strategy=REPLACE' \
  -H 'Content-Type: application/json' \
  -d '{
    "app_id": "string ",
    "metadata": "string",
    "active_channel": "WHATSAPP",
    "active": true
  }'

Responses

A successful response.

Bodyapplication/json
activeboolean

Flag for whether this conversation is active.

active_channelstring(Channel Identifier)

The identifier of the channel you want to include. Must be one of the enum values.

Enum ValueDescription
WHATSAPP

The WhatsApp channel.

RCS

The RCS channel.

SMS

The SMS channel.

MESSENGER

The Facebook Messenger channel.

VIBERBM

The Viber Business Messages channel.

MMS

The MMS channel.

INSTAGRAM

The Instagram channel.

TELEGRAM

The Telegram channel.

KAKAOTALK

The KakaoTalk channel.

KAKAOTALKCHAT

The KakaoTalk chat channel (used primarily in ConsultationTalk).

Example: "WHATSAPP"
app_idstring

The ID of the participating app.

contact_idstring

The ID of the participating contact.

metadata_jsonobject

Arbitrary data set by the Conversation API clients and/or provided in the conversation_metadata field of a SendMessageRequest. A valid JSON object.

correlation_idstring

Arbitrary correlation ID related to the MT message set by the Conversation API user.

idstring

The ID of the conversation.

last_receivedstring(date-time)read-only

The timestamp of the latest message in the conversation. The timestamp will be Thursday January 01, 1970 00:00:00 UTC if the conversation contains no messages.

metadatastringDeprecated

Arbitrary data set by the Conversation API clients. Up to 1024 characters long. NOTE: This field has been deprecated due to changes in the system architecture or functionality. It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code.

Response
application/json
{ "active": true, "active_channel": "WHATSAPP", "app_id": "string", "contact_id": "string", "metadata": "string", "metadata_json": {}, "correlation_id": "string", "id": "string", "last_received": "2019-08-24T14:15:22Z" }

Request

This operation lists conversations and their most recent message, ordered by when the most recent message was sent for that conversation.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

Query
app_idstringrequired

The application ID

only_activeboolean

True if only active conversations should be listed. Default is false.

page_sizeinteger(int32)

The maximum number of conversations to fetch. Defaults to 10 and the maximum value is 50.

page_tokenstring

Next page token previously returned if any. When specifying this token, make sure to use the same values for the other parameters from the request that originated the token, otherwise the paged results may be inconsistent.

orderstring

Whether to sort conversations by newest message first or oldest. Default is DESC (newest first)

Enum ValueDescription
DESC

Descending order. Newest first.

ASC

Ascending order. Oldest first.

curl -i -X GET \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations:recent?app_id=string&only_active=true&page_size=0&page_token=string&order=ASC'

Responses

A successful response.

Bodyapplication/json
conversationsArray of objects(ConversationRecentMessage)

List of recent conversations

next_page_tokenstring

Token that should be included in the next request to fetch the next page.

total_sizeinteger(int32)
Response
application/json
{ "conversations": [ {} ], "next_page_token": "string", "total_size": 0 }

Request

This operation injects a conversation event in to a specific conversation. It only supports injecting App events in CONVERSATION mode.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

conversation_idstringrequired

The unique ID of the conversation. This is generated by the system.

Bodyapplication/jsonrequired

Inject event request

accept_timestring(date-time)required

The processed time of the message in UTC timezone. Must be less than current_time and greater than (current_time - 30 days).

app_eventComposing (object) or Composing End Event Type (object) or Comment Reply Event Type (object) or Agent Joined Event Type (object) or Agent Left Event Type (object) or Generic Type (object)(App Event)

Event originating from an app

One of:

Event originating from an app

conversation_idstring

Optional. The ID of the event's conversation. Will not be present for apps in Dispatch Mode.

contact_idstring

Optional. The ID of the contact. Will not be present for apps in Dispatch Mode.

channel_identityobject(Channel Identity)

A unique identity of message recipient on a particular channel. For example, the channel identity on SMS, WHATSAPP or VIBERBM is a MSISDN phone number.

processing_modestring(ProcessingMode)

Whether or not Conversation API should store contacts and conversations for the app. For more information, see Processing Modes.

Default "DISPATCH"
Enum ValueDescription
CONVERSATION

Creates contacts and conversations automatically when a message is sent or received and there's no existing contact or active conversation.

DISPATCH

The default Processing Mode. Does not associate messages with contacts and conversations. This processing mode is mostly intended for unidirectional high volume SMS use cases. The lack of contacts and conversations limits some API features as related data won't be queryable in the Contact and Conversation APIs.

curl -i -X POST \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations/{conversation_id}:inject-event' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "string",
    "direction": "TO_APP",
    "channel_identity": {
      "channel": "MESSENGER",
      "identity": "{{FACEBOOK_USER_NAME}}",
      "app_id": "{{APP_ID}}"
    },
    "app_event": {
      "composing_event": {}
    },
    "accept_time": "YYYY-MM-DDTHH:MM:SS"
  }'

Responses

A succcessful response.

Bodyapplication/json
event_idstring

Event id.

accepted_timestring(date-time)
Response
application/json
{ "event_id": "string", "accepted_time": "YYYY-MM-DDTHH:MM:SS" }

Request

This operation stops the referenced conversation, if the conversation is still active. A new conversation will be created if a new message is exchanged between the app or contact that was part of the stopped conversation.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

conversation_idstringrequired

The unique ID of the conversation. This is generated by the system.

curl -i -X POST \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations/{conversation_id}:stop'

Responses

A successful response.

Response
No content

Request

This operation injects a conversation message in to a specific conversation.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

conversation_idstringrequired

The ID of the conversation.

Bodyapplication/jsonrequired

Message to be injected.

One of:

A message on a particular channel.

channel_identityobject(Channel Identity)required

A unique identity of message recipient on a particular channel. For example, the channel identity on SMS, WHATSAPP or VIBERBM is a MSISDN phone number.

channel_identity.​identitystringrequired

The channel identity. This will differ from channel to channel. For example, a phone number for SMS, WhatsApp, and Viber Business.

channel_identity.​channelstring(Channel Identifier)required

The identifier of the channel you want to include. Must be one of the enum values.

Enum ValueDescription
WHATSAPP

The WhatsApp channel.

RCS

The RCS channel.

SMS

The SMS channel.

MESSENGER

The Facebook Messenger channel.

VIBERBM

The Viber Business Messages channel.

MMS

The MMS channel.

INSTAGRAM

The Instagram channel.

TELEGRAM

The Telegram channel.

KAKAOTALK

The KakaoTalk channel.

KAKAOTALKCHAT

The KakaoTalk chat channel (used primarily in ConsultationTalk).

Example: "WHATSAPP"
channel_identity.​app_idstring

Required if using a channel that uses app-scoped channel identities. Currently, FB Messenger, Instagram, LINE, and WeChat use app-scoped channel identities, which means contacts will have different channel identities on different Conversation API apps. These can be thought of as virtual identities that are app-specific and, therefore, the app_id must be included in the API call.

contact_idstringrequired

The ID of the contact registered in the conversation provided.

directionstring(ConversationDirection)required
Default "UNDEFINED_DIRECTION"
Enum ValueDescription
UNDEFINED_DIRECTION

The direction is undefined.

TO_APP

Sent to the Conversation API app.

TO_CONTACT

Sent to a recipient/contact from the Conversation API app.

accept_timestring(date-time)required

The processed time of the message in UTC timezone. Must be less than current_time and greater than (current_time - 30 days)

app_messageCard (object) or Carousel (object) or Choice (object) or Location (object) or Media Message (object) or Template Message (object) or Text (object) or List (object) or Contact Info (object)(Message originating from app)

A message originating from a Conversation API app

One of:

Field containing a Card Message

conversation_idstring

The ID of the conversation.

sender_idstring

For Contact Messages (MO messages), the sender ID represents the recipient to which the message was sent. This may be a phone number (in the case of SMS and MMS) or a unique ID (in the case of WhatsApp). This is field is not supported on all channels, nor is it supported for MT messages.

processing_modestring(ProcessingMode)

Whether or not Conversation API should store contacts and conversations for the app. For more information, see Processing Modes.

Default "DISPATCH"
Enum ValueDescription
CONVERSATION

Creates contacts and conversations automatically when a message is sent or received and there's no existing contact or active conversation.

DISPATCH

The default Processing Mode. Does not associate messages with contacts and conversations. This processing mode is mostly intended for unidirectional high volume SMS use cases. The lack of contacts and conversations limits some API features as related data won't be queryable in the Contact and Conversation APIs.

metadatastring

Optional. Metadata associated with the contact. Up to 1024 characters long.

curl -i -X POST \
  -u <username>:<password> \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/conversations/{conversation_id}:inject-message' \
  -H 'Content-Type: application/json' \
  -d '{
    "direction": "TO_CONTACT",
    "channel_identity": {
      "channel": "{{CHANNEL_NAME}}",
      "identity": "{{CHANNEL_IDENTITY}}"
    },
    "app_message": {
      "text_message": {
        "text": "string"
      }
    },
    "contact_id": "string",
    "accept_time": "YYYY-MM-DDTHH:MM:SS"
  }'

Responses

A successful response.

Response
No content

Events

Endpoint for sending events.

Operations

Transcoding

Endpoint for transcoding generic message format to channel-specific one.

Operations

Capability

A capability query checks the options available for reaching the contact on the channels on which it has a channel identity.

Capability queries can only be executed for contacts that already exist in a project and app. For executing the request, either the contact ID or the channel recipient identities of the contact are required.

The request is executed asynchronously, therefore the service responds immediately. The result of the capability query is sent to the registered webhook for the CAPABILITY trigger.

Operations
Operations
Operations