---
title: "Transcode a message"
method: POST
path: "/v1/projects/{project_id}/messages:transcode"
tags: ["Transcoding"]
---

# Transcode a message

`POST /v1/projects/{project_id}/messages:transcode`

Transcodes the message from the Conversation API format to the
channel-specific formats for the requested channels. No message
is sent to the contact.

## Request body

- TranscodeMessageRequest
  - `app_id` string, required — The ID of the app used to transcode the message.
  - `app_message` union, required
    - object — Field containing a Card Message
      - `card_message` CardMessage — Message containing text, media and choices.
        - `choices` Choice[] — You may include choices in your Card Message. The number of choices is limited to 10.
          - union
            - object — Message for triggering a call.
              - …
            - object — Message containing geographic location.
              - …
            - object — A message containing only text.
              - …
            - object — A generic URL message.
              - …
            - object — Message containing details about a calendar event.
              - …
            - object — Message requesting location from a user.
              - …
        - `description` string — This is an optional description field that is displayed below the title on the card.
        - `height` 'UNSPECIFIED_HEIGHT' | 'SHORT' | 'MEDIUM' | 'TALL' — You can set the desired size of the card in the message.
        - `title` string — The title of the card message.
        - `media_message` MediaProperties
          - `thumbnail_url` string — An optional parameter. Will be used where it is natively supported.
          - `url` string, required — Url to the media file.
          - `filename_override` string — Overrides the media file name.
        - `message_properties` object — Optional additional properties.
          - `whatsapp_header` string — Optional. Sets the header for the footer of a WhatsApp reply button message, if there is no media in the message. Ignored for other channels. Ignored if not transcoded to a native WhatsApp message with reply buttons.
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
    - object — Message containing a list of cards often rendered horizontally on supported channels.
      - `carousel_message` object
        - `cards` CardMessage[], required — A list of up to 10 cards.
          - `choices` Choice[] — You may include choices in your Card Message. The number of choices is limited to 10.
            - union
              - …
          - `description` string — This is an optional description field that is displayed below the title on the card.
          - `height` 'UNSPECIFIED_HEIGHT' | 'SHORT' | 'MEDIUM' | 'TALL' — You can set the desired size of the card in the message.
          - `title` string — The title of the card message.
          - `media_message` MediaProperties
            - `thumbnail_url` string — An optional parameter. Will be used where it is natively supported.
            - `url` string, required — Url to the media file.
            - `filename_override` string — Overrides the media file name.
          - `message_properties` object — Optional additional properties.
            - `whatsapp_header` string — Optional. Sets the header for the footer of a WhatsApp reply button message, if there is no media in the message. Ignored for other channels. Ignored if not transcoded to a native WhatsApp message with reply buttons.
        - `choices` Choice[] — Optional. Outer choices on the carousel level. The number of outer choices is limited to 3.
          - union
            - object — Message for triggering a call.
              - …
            - object — Message containing geographic location.
              - …
            - object — A message containing only text.
              - …
            - object — A generic URL message.
              - …
            - object — Message containing details about a calendar event.
              - …
            - object — Message requesting location from a user.
              - …
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
    - object — Message containing choices/actions.
      - `choice_message` object — Additional properties for the message.
        - `choices` Choice[], required — The number of choices is limited to 10.
          - union
            - object — Message for triggering a call.
              - …
            - object — Message containing geographic location.
              - …
            - object — A message containing only text.
              - …
            - object — A generic URL message.
              - …
            - object — Message containing details about a calendar event.
              - …
            - object — Message requesting location from a user.
              - …
        - `text_message` object
          - `text` string, required — The text to be sent.
        - `message_properties` object
          - `whatsapp_footer` string — Optional. Sets the text for the footer of a WhatsApp reply button or URL button message. Ignored for other channels.
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
    - object — Message containing geographic location.
      - `location_message` object
        - `coordinates` Coordinates, required
          - `latitude` number, float, required — The latitude.
          - `longitude` number, float, required — The longitude.
        - `label` string — Label or name for the position.
        - `title` string, required — The title is shown close to the button or link that leads to a map showing the location. The title can be clickable in some cases.
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
    - object — A message containing a media component, such as an image, document, or video.
      - `media_message` MediaProperties
        - `thumbnail_url` string — An optional parameter. Will be used where it is natively supported.
        - `url` string, required — Url to the media file.
        - `filename_override` string — Overrides the media file name.
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
    - object — Message referring to predefined template
      - `template_message` object
        - `channel_template` object — Optional. Channel specific template reference with parameters per channel. The channel template if exists overrides the omnichannel template. At least one of `channel_template` or `omni_template` needs to be present. The key in the map must point to a valid conversation channel as defined by the enum ConversationChannel.
        - `omni_template` TemplateReferenceWithVersion — The referenced template can be an omnichannel template stored in Conversation API Template Store as an AppMessage. You may also reference external channel-specific templates, such as a WhatsApp Business Template. Note that channel-specific template references are not supported when populating the `explicit_channel_omni_message` field.
          - `version` string, required — Used to specify what version of a template to use. Required when using `omni_channel_override` and `omni_template` fields. This will be used in conjunction with `language_code`. Note that, when referencing omni-channel templates using the [Sinch Customer Dashboard](https://dashboard.sinch.com/), the latest version of a given omni-template can be identified by populating this field with `latest`.
          - `language_code` string — The BCP-47 language code, such as `en_US` or `sr_Latn`. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. English is the default `language_code`. Note that, while many API calls involving templates accept either the dashed format (`en-US`) or the underscored format (`en_US`), some channel specific templates (for example, WhatsApp channel-specific templates) only accept the underscored format. Note that this field is required for WhatsApp channel-specific templates.
          - `parameters` object — Required if the template has parameters. Concrete values must be present for all defined parameters in the template. Parameters can be different for different versions and/or languages of the template.
          - `template_id` string, required — The ID of the template. Note that, in the case of WhatsApp channel-specific templates, this field must be populated by the name of the template.
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
    - object — A message containing only text.
      - `text_message` object
        - `text` string, required — The text to be sent.
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
    - object — A message containing a list of options to choose from. All items must be of the same type.
      - `list_message` object
        - `title` string, required — A title for the message that is displayed near the products or choices.
        - `description` string — This is an optional field, containing a description for the message.
        - `media` MediaProperties
          - `thumbnail_url` string — An optional parameter. Will be used where it is natively supported.
          - `url` string, required — Url to the media file.
          - `filename_override` string — Overrides the media file name.
        - `sections` ListSection[], required — List of ListSection objects containing choices to be presented in the list message.
          - `title` string — Optional parameter. Title for list section.
          - `items` ListItem[], required
            - union — Item containing either choiceItem or ProductItem
              - …
        - `message_properties` object — Additional properties for the message. Required if sending a product list message.
          - `catalog_id` string — Required if sending a product list message. The ID of the catalog to which the products belong.
          - `menu` string — Optional. Sets the text for the menu of a choice list message.
          - `whatsapp_header` string — Optional. Sets the text for the header of a WhatsApp choice list message. Ignored for other channels.
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
    - object — Message containing contact information.
      - `contact_info_message` object
        - `name` NameInfo, required — Name information of the contact.
          - `full_name` string, required — Full name of the contact
          - `first_name` string — First name.
          - `last_name` string — Last name.
          - `middle_name` string — Middle name.
          - `prefix` string — Prefix before the name. e.g. Mr, Mrs, Dr etc.
          - `suffix` string — Suffix after the name.
        - `phone_numbers` PhoneNumberInfo[], required — Phone numbers of the contact
          - `phone_number` string, required — Phone number with country code included.
          - `type` string — Phone number type, e.g. WORK or HOME.
        - `addresses` AddressInfo[] — Physical addresses of the contact
          - `city` string — City Name
          - `country` string — Country Name
          - `state` string — Name of a state or region of a country.
          - `zip` string — Zip/postal code
          - `type` string — Address type, e.g. WORK or HOME
          - `country_code` string — Two letter country code.
        - `email_addresses` EmailInfo[] — Email addresses of the contact
          - `email_address` string, required — Email address.
          - `type` string — Email address type. e.g. WORK or HOME.
        - `organization` OrganizationInfo — Organization information of the contact.
          - `company` string — Company name
          - `department` string — Department at the company
          - `title` string — Corporate title, e.g. Software engineer
        - `urls` UrlInfo[] — URLs/websites associated with the contact
          - `url` string, required — The URL to be referenced
          - `type` string — Optional. URL type, e.g. Org or Social
        - `birthday` string — Date of birth in YYYY-MM-DD format.
      - `explicit_channel_message` object — Allows you to specify a channel and define a corresponding channel specific message payload that will override the standard Conversation API message types. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The message content must be provided in a string format. You may use the [transcoding endpoint](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Transcoding/) to help create your message. For more information about how to construct an explicit channel message for a particular channel, see that [channel's corresponding documentation](https://developers.sinch.com/docs/conversation/channel-support/) (for example, using explicit channel messages with [the WhatsApp channel](https://developers.sinch.com/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages)).
      - `explicit_channel_omni_message` object — Override the message's content for specified channels. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`. The content defined under the specified channel will be sent on that channel.
      - `channel_specific_message` object — Channel specific messages, overriding any transcoding. The structure of this property is more well-defined than the open structure of the `explicit_channel_message` property, and may be easier to use. The key in the map must point to a valid conversation channel as defined in the enum `ConversationChannel`.
      - `agent` Agent — Represents an agent that is involved in a conversation.
        - `display_name` string — Agent's display name
        - `type` 'UNKNOWN_AGENT_TYPE' | 'HUMAN' | 'BOT' — Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        - `picture_url` string — The Agent's picture url.
  - `channels` ConversationChannel[], required — The list of channels for which the message shall be transcoded.
  - `from` string — Optional.
  - `to` string — Optional.

## Response `200`

A successful response.

- TranscodeMessageResponse
  - `transcoded_message` object — The transcoded message for the different channels. The keys in the map correspond to channel names, as defined by the type ConversationChannel.

## Other responses

- `400` — Malformed request. See [common error responses](https://developers.sinch.com/docs/conversation/api-reference/#common-error-responses) for more information.
- `401` — Incorrect credentials. See [common error responses](https://developers.sinch.com/docs/conversation/api-reference/#common-error-responses) for more information.
- `403` — Correct credentials but you don't have access to the requested resource. See [common error responses](https://developers.sinch.com/docs/conversation/api-reference/#common-error-responses) for more information.
- `500` — Correct credentials but you don't have access to the requested resource. See [common error responses](https://developers.sinch.com/docs/conversation/api-reference/#common-error-responses) for more information.
- `501` — Something went wrong on our end, try again with exponential back-off. See [common error responses](https://developers.sinch.com/docs/conversation/api-reference/#common-error-responses) for more information.

---

[API](https://skmtc.net/sinch/apis/conversation-api-sinch.md) · [All operations](https://skmtc.net/sinch/apis/conversation-api-sinch/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sinch/conversation-api-sinch/revisions/bdb3e0c48bf7/schema)
