> ## 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.

# Generate RCS deeplink

> Generate a deeplink URL that can be used to start an RCS conversation with a specific agent.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/messaging/rcs.yml get /messages/rcs_deeplinks/{agent_id}
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_deeplinks/{agent_id}:
    get:
      tags:
        - RCS
      summary: Generate RCS deeplink
      description: >-
        Generate a deeplink URL that can be used to start an RCS conversation
        with a specific agent.
      operationId: GenerateRCSDeeplink
      parameters:
        - name: agent_id
          in: path
          description: RCS agent ID
          required: true
          schema:
            type: string
        - name: phone_number
          in: query
          description: Phone number in E164 format (URL encoded)
          required: false
          schema:
            type: string
          example: '%2B18445550001'
        - name: body
          in: query
          description: Pre-filled message body (URL encoded)
          required: false
          schema:
            type: string
          example: hello%20world
      responses:
        '200':
          description: Successful response with deeplink URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RCSDeeplinkResponse'
        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.generateDeeplink('agent_id');


            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.generate_deeplink(
                agent_id="agent_id",
            )
            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.GenerateDeeplink(\n\t\tcontext.TODO(),\n\t\t\"agent_id\",\n\t\ttelnyx.MessageRcGenerateDeeplinkParams{},\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.rcs.RcGenerateDeeplinkParams;

            import
            com.telnyx.sdk.models.messages.rcs.RcGenerateDeeplinkResponse;


            public final class Main {
                private Main() {}

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

                    RcGenerateDeeplinkResponse response = client.messages().rcs().generateDeeplink("agent_id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.messages.rcs.generate_deeplink("agent_id")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->messages->rcs->generateDeeplink(
                'agent_id', body: 'body', phoneNumber: 'phone_number'
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx messages:rcs generate-deeplink \
              --api-key 'My API Key' \
              --agent-id agent_id
components:
  schemas:
    RCSDeeplinkResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            url:
              type: string
              description: The generated deeplink URL
              example: >-
                sms:+18445550001?service_id=my_agent_id%40rbm.goog&body=hello%20world
          required:
            - url
      required:
        - data
    messaging_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/messaging_Error'
    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
  responses:
    messaging_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/messaging_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````