---
title: "Create Canary Deploy"
method: POST
path: "/ai/assistants/{assistant_id}/canary-deploys"
tags: ["Assistants"]
---

# Create Canary Deploy

`POST /ai/assistants/{assistant_id}/canary-deploys`

Endpoint to create a canary deploy configuration for an assistant.

Creates a new canary deploy configuration with multiple version IDs and their traffic
percentages for A/B testing or gradual rollouts of assistant versions.

## Path parameters

- `assistant_id` string, required

## Request body

- CanaryDeployRequest — Create/update request body. Accepts: - ``rules`` — canonical ordered list of routing rules
  - `rules` RuleInput[]
    - `match` Clause[]
      - `attribute` string, required — Attribute name from the routing context
      - `operator` 'in' | 'not_in' | 'starts_with', required
      - `values` string[], required
    - `serve` Serve, required — 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
      - `version_id` string
      - `rollout` RolloutSlot[]
        - `version_id` string, required
        - `weight` number, required

## Response `200`

Successful Response

- CanaryDeployResponse — Response shape. Always carries ``rules`` (canonical).
  - `assistant_id` string, required
  - `rules` RuleOutput[], required
    - `match` Clause[]
      - `attribute` string, required — Attribute name from the routing context
      - `operator` 'in' | 'not_in' | 'starts_with', required
      - `values` string[], required
    - `serve` Serve, required — 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
      - `version_id` string
      - `rollout` RolloutSlot[]
        - `version_id` string, required
        - `weight` number, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/team-telnyx/apis/telnyx-api-2.md) · [All operations](https://skmtc.net/team-telnyx/apis/telnyx-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/team-telnyx/telnyx-api-2/revisions/8f5f4e537994/schema)
