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

# Get Canary Deploy

> Endpoint to get a canary deploy configuration for an assistant.

Retrieves the current canary deploy configuration with all version IDs and their
traffic percentages for the specified assistant.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/ai/assistants.yml get /ai/assistants/{assistant_id}/canary-deploys
openapi: 3.1.0
info:
  title: Telnyx AI Assistants API
  version: 2.0.0
  description: >-
    API for managing AI Assistants, including CRUD fields, versions, tags,
    integrations, MCP servers, and shared tools.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ai/assistants/{assistant_id}/canary-deploys:
    get:
      tags:
        - Assistants
      summary: Get Canary Deploy
      description: >-
        Endpoint to get a canary deploy configuration for an assistant.


        Retrieves the current canary deploy configuration with all version IDs
        and their

        traffic percentages for the specified assistant.
      operationId: get_canary_deploy_assistants__assistant_id__canary_deploys_get
      parameters:
        - name: assistant_id
          in: path
          required: true
          schema:
            type: string
            title: Assistant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CanaryDeployResponse'
        '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 canaryDeployResponse = await
            client.ai.assistants.canaryDeploys.retrieve('assistant_id');


            console.log(canaryDeployResponse.assistant_id);
        - 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
            )

            canary_deploy_response =
            client.ai.assistants.canary_deploys.retrieve(
                "assistant_id",
            )

            print(canary_deploy_response.assistant_id)
        - 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\tcanaryDeployResponse, err := client.AI.Assistants.CanaryDeploys.Get(context.TODO(), \"assistant_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", canaryDeployResponse.AssistantID)\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.assistants.canarydeploys.CanaryDeployResponse;

            import
            com.telnyx.sdk.models.ai.assistants.canarydeploys.CanaryDeployRetrieveParams;


            public final class Main {
                private Main() {}

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

                    CanaryDeployResponse canaryDeployResponse = client.ai().assistants().canaryDeploys().retrieve("assistant_id");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            canary_deploy_response =
            telnyx.ai.assistants.canary_deploys.retrieve("assistant_id")


            puts(canary_deploy_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 {
              $canaryDeployResponse = $client->ai->assistants->canaryDeploys->retrieve(
                'assistant_id'
              );

              var_dump($canaryDeployResponse);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:assistants:canary-deploys retrieve \
              --api-key 'My API Key' \
              --assistant-id assistant_id
components:
  schemas:
    CanaryDeployResponse:
      properties:
        assistant_id:
          type: string
          title: Assistant Id
        rules:
          items:
            $ref: '#/components/schemas/Rule-Output'
          type: array
          title: Rules
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - assistant_id
        - rules
        - created_at
        - updated_at
      title: CanaryDeployResponse
      description: |-
        Response shape.

        Always carries ``rules`` (canonical).
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    Rule-Output:
      properties:
        match:
          items:
            $ref: '#/components/schemas/Clause'
          type: array
          title: Match
        serve:
          $ref: '#/components/schemas/Serve'
      type: object
      required:
        - serve
      title: Rule
      description: |-
        A targeting rule: ``match`` clauses (AND) gate ``serve``.

        An empty ``match`` is a catch-all (always fires).
    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
    Clause:
      properties:
        attribute:
          type: string
          title: Attribute
          description: Attribute name from the routing context
        operator:
          $ref: '#/components/schemas/Operator'
          description: Match operator
        values:
          items:
            type: string
          type: array
          minItems: 1
          title: Values
      type: object
      required:
        - attribute
        - operator
        - values
      title: Clause
      description: |-
        A single attribute/operator/values check.

        A clause matches when the routing context's value for ``attribute``
        satisfies ``operator`` against any of ``values``.
    Serve:
      properties:
        version_id:
          type: string
          title: Version Id
        rollout:
          title: Rollout
          items:
            $ref: '#/components/schemas/RolloutSlot'
          type: array
      type: object
      title: Serve
      description: |-
        What a rule serves when matched.

        Exactly one of:
        - ``version_id`` — serve a specific version
        - ``rollout`` — weighted random across versions; weights must sum to
          less than 100, with the leftover routing to the main version
    Operator:
      type: string
      enum:
        - in
        - not_in
        - starts_with
      title: Operator
    RolloutSlot:
      properties:
        version_id:
          type: string
          title: Version Id
        weight:
          type: number
          title: Weight
          minimum: 0
          maximum: 100
      type: object
      required:
        - version_id
        - weight
      title: RolloutSlot
      description: One slot in a percentage rollout.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````