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

# Update conversation metadata

> Update metadata for a specific conversation.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/ai/analytics.yml put /ai/conversations/{conversation_id}
openapi: 3.1.0
info:
  title: Telnyx AI Analytics API
  version: 2.0.0
  description: API for AI conversations, insights, embeddings, and clusters.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ai/conversations/{conversation_id}:
    put:
      tags:
        - Conversations
      summary: Update conversation metadata
      description: Update metadata for a specific conversation.
      operationId: update_conversation_by_id_public_conversations_put
      parameters:
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the conversation to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConversationRequest'
      responses:
        '200':
          description: Successful Update
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Conversation'
        '404':
          description: Conversation Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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 conversation = await
            client.ai.conversations.update('conversation_id');


            console.log(conversation.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
            )
            conversation = client.ai.conversations.update(
                conversation_id="conversation_id",
            )
            print(conversation.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\tconversation, err := client.AI.Conversations.Update(\n\t\tcontext.TODO(),\n\t\t\"conversation_id\",\n\t\ttelnyx.AIConversationUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", conversation.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.ai.conversations.ConversationUpdateParams;

            import
            com.telnyx.sdk.models.ai.conversations.ConversationUpdateResponse;


            public final class Main {
                private Main() {}

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

                    ConversationUpdateResponse conversation = client.ai().conversations().update("conversation_id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            conversation = telnyx.ai.conversations.update("conversation_id")

            puts(conversation)
        - 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 {
              $conversation = $client->ai->conversations->update(
                'conversation_id', metadata: ['foo' => 'string']
              );

              var_dump($conversation);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:conversations update \
              --api-key 'My API Key' \
              --conversation-id conversation_id
components:
  schemas:
    UpdateConversationRequest:
      properties:
        metadata:
          type: object
          description: >-
            Metadata associated with the conversation. Set `ai_disabled` to
            `true` to stop AI from responding to messages (e.g., when a human
            agent takes over). Set to `false` to re-enable AI responses.
          additionalProperties:
            type: string
      type: object
      title: UpdateConversationRequest
    Conversation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        name:
          type: string
          example: ''
        created_at:
          type: string
          description: The datetime the conversation was created.
          format: date-time
          example: '2025-04-15T13:07:28.764Z'
        metadata:
          type: object
          description: >-
            Metadata associated with the conversation. Telnyx provides several
            pieces of metadata, but customers can also add their own. The
            reserved field `ai_disabled` (boolean) can be set to `true` to
            prevent AI-generated responses on this conversation. When
            `ai_disabled` is `true`, calls to the chat endpoint will return a
            400 error. Set to `false` or remove the field to re-enable AI
            responses. This is useful when a human agent needs to take over the
            conversation mid-stream (e.g., a technician stepping in while AI was
            messaging a resident).
          additionalProperties:
            type: string
          example:
            telnyx_conversation_channel: sms
            telnyx_agent_target: '+13128675309'
            telnyx_end_user_target: '+13128675309'
            assistant_id: assistant-123
        last_message_at:
          type: string
          description: The datetime of the latest message in the conversation.
          format: date-time
          example: '2025-04-15T13:07:28.764Z'
      required:
        - id
        - created_at
        - metadata
        - last_message_at
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````