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

# Modify an RCS agent



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/messaging/rcs.yml patch /messaging/rcs/agents/{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:
  /messaging/rcs/agents/{id}:
    patch:
      tags:
        - RCS
      summary: Modify an RCS agent
      operationId: UpdateRCSAgentById
      parameters:
        - name: id
          in: path
          description: RCS agent ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RCSAgentUpdate'
      responses:
        '200':
          description: Successful response with the updated RCS agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RCSAgentResponse'
        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 rcsAgentResponse = await
            client.messaging.rcs.agents.update('id');


            console.log(rcsAgentResponse.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
            )
            rcs_agent_response = client.messaging.rcs.agents.update(
                id="id",
            )
            print(rcs_agent_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\trcsAgentResponse, err := client.Messaging.Rcs.Agents.Update(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\ttelnyx.MessagingRcAgentUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", rcsAgentResponse.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.messaging.rcs.agents.AgentUpdateParams;
            import com.telnyx.sdk.models.rcsagents.RcsAgentResponse;

            public final class Main {
                private Main() {}

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

                    RcsAgentResponse rcsAgentResponse = client.messaging().rcs().agents().update("id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            rcs_agent_response = telnyx.messaging.rcs.agents.update("id")

            puts(rcs_agent_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 {
              $rcsAgentResponse = $client->messaging->rcs->agents->update(
                'id',
                profileID: '4001932a-b8a3-42fc-9389-021be6388909',
                webhookFailoverURL: 'http://example.com',
                webhookURL: 'http://example.com',
              );

              var_dump($rcsAgentResponse);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx messaging:rcs:agents update \
              --api-key 'My API Key' \
              --id id
components:
  schemas:
    RCSAgentUpdate:
      type: object
      properties:
        profile_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Messaging profile ID associated with the RCS Agent
          example: 4001932a-b8a3-42fc-9389-021be6388909
        webhook_url:
          type:
            - string
            - 'null'
          format: url
          description: URL to receive RCS events
          example: http://example.com
        webhook_failover_url:
          type:
            - string
            - 'null'
          format: url
          description: Failover URL to receive RCS events
          example: http://example.com
    RCSAgentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/RCSAgent'
    RCSAgent:
      type: object
      properties:
        agent_id:
          type: string
          description: RCS Agent ID
          example: TestAgent
        user_id:
          type: string
          description: User ID associated with the RCS Agent
          example: 2ecf295b-36c6-4d43-ad05-71eb1e560518
        profile_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Messaging profile ID associated with the RCS Agent
          example: 4001932a-b8a3-42fc-9389-021be6388909
        webhook_url:
          type:
            - string
            - 'null'
          format: url
          description: URL to receive RCS events
          example: http://example.com
        webhook_failover_url:
          type:
            - string
            - 'null'
          format: url
          description: Failover URL to receive RCS events
          example: http://example.com
        agent_name:
          type: string
          description: Human readable agent name
          example: Test Agent
        enabled:
          type: boolean
          description: Specifies whether the agent is enabled
          example: true
        created_at:
          type: string
          format: date-time
          description: Date and time when the resource was created
          example: '2024-01-01T12:00:00.000Z'
        updated_at:
          type: string
          format: date-time
          description: Date and time when the resource was updated
          example: '2024-01-01T12:00:00.000Z'
    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

````