> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send an RCS message



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/messaging/rcs.yml post /messages/rcs
openapi: 3.1.0
info:
  title: Telnyx RCS Messaging API
  version: 2.0.0
  description: API for RCS messaging.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /messages/rcs:
    post:
      tags:
        - RCS
      summary: Send an RCS message
      operationId: SendRCSMessage
      requestBody:
        description: RCS message body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RCSMessage'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RCSResponse'
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.messages.rcs.send({
              agent_id: 'Agent007',
              agent_message: {},
              messaging_profile_id: 'messaging_profile_id',
              to: '+13125551234',
            });

            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.messages.rcs.send(
                agent_id="Agent007",
                agent_message={},
                messaging_profile_id="messaging_profile_id",
                to="+13125551234",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Messages.Rcs.Send(context.TODO(), telnyx.MessageRcSendParams{\n\t\tAgentID:            \"Agent007\",\n\t\tAgentMessage:       telnyx.RcsAgentMessageParam{},\n\t\tMessagingProfileID: \"messaging_profile_id\",\n\t\tTo:                 \"+13125551234\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.messages.RcsAgentMessage;
            import com.telnyx.sdk.models.messages.rcs.RcSendParams;
            import com.telnyx.sdk.models.messages.rcs.RcSendResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    RcSendParams params = RcSendParams.builder()
                        .agentId("Agent007")
                        .agentMessage(RcsAgentMessage.builder().build())
                        .messagingProfileId("messaging_profile_id")
                        .to("+13125551234")
                        .build();
                    RcSendResponse response = client.messages().rcs().send(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.messages.rcs.send_(
              agent_id: "Agent007",
              agent_message: {},
              messaging_profile_id: "messaging_profile_id",
              to: "+13125551234"
            )

            puts(response)
        - lang: CLI
          source: |-
            telnyx messages:rcs send \
              --api-key 'My API Key' \
              --agent-id Agent007 \
              --agent-message '{}' \
              --messaging-profile-id messaging_profile_id \
              --to +13125551234
components:
  schemas:
    RCSMessage:
      required:
        - agent_id
        - to
        - messaging_profile_id
        - agent_message
      type: object
      properties:
        agent_id:
          type: string
          description: RCS Agent ID
          example: Agent007
        to:
          type: string
          description: Phone number in +E.164 format
          example: '+13125551234'
        messaging_profile_id:
          type: string
          description: A valid messaging profile ID
        type:
          type: string
          description: Message type - must be set to "RCS"
          example: RCS
          enum:
            - RCS
        webhook_url:
          description: The URL where webhooks related to this message will be sent.
          type: string
          format: url
        agent_message:
          $ref: '#/components/schemas/RCSAgentMessage'
        sms_fallback:
          $ref: '#/components/schemas/SMSFallback'
        mms_fallback:
          $ref: '#/components/schemas/MMSFallback'
    RCSResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            record_type:
              type: string
              example: message
            direction:
              type: string
              example: outbound
            id:
              type: string
              description: message ID
              example: 4031938e-60e4-4235-a8dd-0b1c55a23e7a
            type:
              type: string
              example: RCS
            organization_id:
              type: string
              example: 9f61d8e1-7687-4d6d-9cae-9ff682985983
            messaging_profile_id:
              type: string
              example: 4001781e-626f-4a41-a914-b1b682150f94
            from:
              $ref: '#/components/schemas/RCSFrom'
            to:
              $ref: '#/components/schemas/RCSTo'
            body:
              $ref: '#/components/schemas/RCSAgentMessage'
            encoding:
              type: string
              example: utf-8
            received_at:
              type: string
              format: date-time
            wait_seconds:
              type:
                - number
                - 'null'
              format: float
              description: >-
                Seconds the message is queued due to rate limiting before being
                sent to the carrier. Represents the maximum wait across all
                applicable rate limits (account, carrier, campaign). 0.0 = no
                queuing delay.
              example: 0.5
    RCSAgentMessage:
      type: object
      properties:
        content_message:
          $ref: '#/components/schemas/RCSContentMessage'
        event:
          $ref: '#/components/schemas/RCSEvent'
        expire_time:
          type: string
          format: date-time
          description: Timestamp in UTC of when this message is considered expired
          example: '2024-10-02T15:01:23Z'
        ttl:
          type: string
          description: Duration in seconds ending with 's'
          example: 10.5s
    SMSFallback:
      type: object
      properties:
        from:
          type: string
          description: Phone number in +E.164 format
          example: '+13125551234'
        text:
          type: string
          description: Text (maximum 3072 characters)
          example: Hello world!
    MMSFallback:
      type: object
      properties:
        from:
          type: string
          description: Phone number in +E.164 format
          example: '+13125551234'
        subject:
          type: string
          description: Subject of the message
          example: Test Message
        media_urls:
          type: array
          description: List of media URLs
          items:
            type: string
        text:
          type: string
          description: Text
          example: Hello world!
    RCSFrom:
      type: object
      properties:
        agent_id:
          type: string
          example: Agent007
          description: agent ID
        carrier:
          type: string
          example: Telnyx
        agent_name:
          type: string
          example: Test Agent
    RCSTo:
      type: array
      items:
        $ref: '#/components/schemas/RCSToItem'
    messaging_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/messaging_Error'
    RCSContentMessage:
      type: object
      properties:
        suggestions:
          type: array
          description: List of suggested actions and replies
          items:
            $ref: '#/components/schemas/RCSSuggestion'
        text:
          type: string
          description: Text (maximum 3072 characters)
          example: Hello world!
        rich_card:
          $ref: '#/components/schemas/RCSRichCard'
        content_info:
          $ref: '#/components/schemas/RCSContentInfo'
    RCSEvent:
      type: object
      description: RCS Event to send to the recipient
      properties:
        event_type:
          type: string
          example: IS_TYPING
          enum:
            - TYPE_UNSPECIFIED
            - IS_TYPING
            - READ
    RCSToItem:
      type: object
      properties:
        phone_number:
          type: string
          example: '+13125551234'
        status:
          type: string
          example: queued
        carrier:
          type: string
          example: Verizon Wireless
        line_type:
          type: string
          example: Wireless
    messaging_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
          x-format: integer
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
    RCSSuggestion:
      type: object
      properties:
        reply:
          $ref: '#/components/schemas/RCSReply'
        action:
          $ref: '#/components/schemas/RCSAction'
    RCSRichCard:
      type: object
      properties:
        carousel_card:
          $ref: '#/components/schemas/RCSCarouselCard'
        standalone_card:
          $ref: '#/components/schemas/RCSStandaloneCard'
    RCSContentInfo:
      required:
        - file_url
      type: object
      properties:
        file_url:
          type: string
          format: url
          description: Publicly reachable URL of the file.
          example: https://example.com/elephant.jpg
        thumbnail_url:
          type: string
          format: url
          description: Publicly reachable URL of the thumbnail. Maximum size of 100 kB.
        force_refresh:
          type: boolean
          description: If set the URL content will not be cached.
    RCSReply:
      type: object
      properties:
        text:
          type: string
          description: Text that is shown in the suggested reply (maximum 25 characters)
        postback_data:
          type: string
          description: >-
            Payload (base64 encoded) that will be sent to the agent in the user
            event that results when the user taps the suggested action. Maximum
            2048 characters.
    RCSAction:
      type: object
      description: When tapped, initiates the corresponding native action on the device.
      properties:
        text:
          type: string
          description: Text that is shown in the suggested action. Maximum 25 characters.
          example: Hello world
        postback_data:
          type: string
          description: >-
            Payload (base64 encoded) that will be sent to the agent in the user
            event that results when the user taps the suggested action. Maximum
            2048 characters.
        fallback_url:
          type: string
          description: >-
            Fallback URL to use if a client doesn't support a suggested action.
            Fallback URLs open in new browser windows. Maximum 2048 characters.
          format: url
        dial_action:
          $ref: '#/components/schemas/RCSDialAction'
        view_location_action:
          $ref: '#/components/schemas/RCSViewLocationAction'
        create_calendar_event_action:
          $ref: '#/components/schemas/RCSCreateCalendarEventAction'
        open_url_action:
          $ref: '#/components/schemas/RCSOpenUrlAction'
        share_location_action:
          $ref: '#/components/schemas/RCSShareLocationAction'
    RCSCarouselCard:
      required:
        - card_width
        - card_contents
      type: object
      description: Carousel of cards.
      properties:
        card_width:
          type: string
          example: SMALL
          description: The width of the cards in the carousel.
          enum:
            - CARD_WIDTH_UNSPECIFIED
            - SMALL
            - MEDIUM
        card_contents:
          description: >-
            The list of contents for each card in the carousel. A carousel can
            have a minimum of 2 cards and a maximum 10 cards.
          type: array
          items:
            $ref: '#/components/schemas/RCSCardContent'
    RCSStandaloneCard:
      required:
        - card_orientation
        - thumbnail_image_alignment
        - card_content
      type: object
      description: Standalone card
      properties:
        card_orientation:
          type: string
          example: HORIZONTAL
          description: Orientation of the card.
          enum:
            - CARD_ORIENTATION_UNSPECIFIED
            - HORIZONTAL
            - VERTICAL
        thumbnail_image_alignment:
          type: string
          example: LEFT
          description: Image preview alignment for standalone cards with horizontal layout.
          enum:
            - THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED
            - LEFT
            - RIGHT
        card_content:
          $ref: '#/components/schemas/RCSCardContent'
    RCSDialAction:
      required:
        - phone_number
      type: object
      description: >-
        Opens the user's default dialer app with the agent-specified phone
        number filled in.
      properties:
        phone_number:
          type: string
          description: Phone number in +E.164 format
          example: '+13125551234'
    RCSViewLocationAction:
      type: object
      description: >-
        Opens the user's default map app and selects the agent-specified
        location.
      properties:
        lat_long:
          $ref: '#/components/schemas/RCSLatLng'
        label:
          type: string
          description: The label of the pin dropped
        query:
          type: string
          description: query string (Android only)
    RCSCreateCalendarEventAction:
      type: object
      description: >-
        Opens the user's default calendar app and starts the new calendar event
        flow with the agent-specified event data pre-filled.
      properties:
        start_time:
          type: string
          format: date-time
          example: '2024-10-02T15:01:23Z'
        end_time:
          type: string
          format: date-time
          example: '2024-10-02T15:02:31Z'
        title:
          type: string
          description: Event title. Maximum 100 characters.
        description:
          type: string
          description: Event description. Maximum 500 characters.
    RCSOpenUrlAction:
      required:
        - url
        - application
        - webview_view_mode
      type: object
      description: Opens the user's default web browser app to the specified URL.
      properties:
        url:
          type: string
          format: url
          example: http://example.com
        application:
          type: string
          example: BROWSER
          description: URL open application, browser or webview.
          enum:
            - OPEN_URL_APPLICATION_UNSPECIFIED
            - BROWSER
            - WEBVIEW
        webview_view_mode:
          type: string
          example: HALF
          enum:
            - WEBVIEW_VIEW_MODE_UNSPECIFIED
            - FULL
            - HALF
            - TALL
        description:
          type: string
          description: Accessbility description for webview.
    RCSShareLocationAction:
      type: object
      description: >-
        Opens the RCS app's location chooser so the user can pick a location to
        send back to the agent.
    RCSCardContent:
      type: object
      properties:
        title:
          type: string
          description: Title of the card (at most 200 characters)
          example: Elephant
        description:
          type: string
          description: Description of the card (at most 2000 characters)
        media:
          $ref: '#/components/schemas/RCSMedia'
        suggestions:
          type: array
          description: List of suggestions to include in the card. Maximum 10 suggestions.
          items:
            $ref: '#/components/schemas/RCSSuggestion'
    RCSLatLng:
      required:
        - latitude
        - longitude
      type: object
      properties:
        latitude:
          type: number
          description: The latitude in degrees. It must be in the range [-90.0, +90.0].
          example: 41.8
        longitude:
          type: number
          description: The longitude in degrees. It must be in the range [-180.0, +180.0].
          example: -87.6
    RCSMedia:
      type: object
      description: A media file within a rich card.
      properties:
        height:
          type: string
          example: MEDIUM
          description: >-
            The height of the media within a rich card with a vertical layout.
            For a standalone card with horizontal layout, height is not
            customizable, and this field is ignored.
          enum:
            - HEIGHT_UNSPECIFIED
            - SHORT
            - MEDIUM
            - TALL
        content_info:
          $ref: '#/components/schemas/RCSContentInfo'
  responses:
    messaging_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/messaging_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````