---
title: "Replace collection sources"
method: PUT
path: "/ai/collections/{uuid}/sources"
tags: ["AI Collections"]
---

# Replace collection sources

`PUT /ai/collections/{uuid}/sources`

## Request

- Base URL: `https://api.telnyx.com/v2`
- URL: `https://api.telnyx.com/v2/ai/collections/{uuid}/sources`
- Auth: HTTP bearer

Replaces the collection's entire source set. The response `meta` reports which sources were added, retained, and removed.

## Path parameters

- `uuid` string, uuid, required

## Request body

- ReplaceSourcesRequest
  - `sources` SourceRequest[], required
    - `source_type` 'voice' | 'meeting_bot' | 'message' | 'bucket', required: The type of Telnyx data attached as a source. `bucket` requires an additional `bucket_id`. Only `voice` is searchable today; `meeting_bot`, `message`, and `bucket` attach but are not yet searchable (Coming soon).
    - `bucket_id` string: The Telnyx Storage bucket name. Required when `source_type` is `bucket`; ignored otherwise.

## Response `200`

The reconciled source list.

- SourceReconcileEnvelope
  - `data` CollectionsSource[]
    - `id` string
    - `record_type` string: Identifies the record type. Always `ai_collection_source`.
    - `collection_id` string, uuid
    - `source_type` 'voice' | 'meeting_bot' | 'message' | 'bucket': The type of Telnyx data attached as a source. `bucket` requires an additional `bucket_id`. Only `voice` is searchable today; `meeting_bot`, `message`, and `bucket` attach but are not yet searchable (Coming soon).
    - `bucket_id` string: The Telnyx Storage bucket name. Present only for `bucket` sources.
    - `status` string
  - `meta` SourceReconcileMeta: Reports which source IDs were added, retained, and removed by a replace operation.
    - `added` string[]
    - `retained` string[]
    - `removed` string[]

## Other responses

- `400`: The request was malformed or failed validation.
- `401`: Missing or invalid authentication.
- `404`: The requested resource does not exist.
- `409`: The request conflicts with existing state (e.g. duplicate slug or duplicate source).
- `422`: Invalid source configuration -- `bucket` without a `bucket_id` (`invalid_source_configuration`) or an unknown `source_type` (`invalid_source_type`).

## Changes

- **2026-10-21** `67df31283a8a`: 5 breaking, 5 info
  - the `errors/items/code` response's property type changed from `integer` to `string`, and format from `int32` to no format for status `400`
  - the `errors/items/code` response's property type changed from `integer` to `string`, and format from `int32` to no format for status `401`
  - the `errors/items/code` response's property type changed from `integer` to `string`, and format from `int32` to no format for status `404`
  - the `errors/items/code` response's property type changed from `integer` to `string`, and format from `int32` to no format for status `409`
  - …6 more
- **2026-10-15** `a72569d69430`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/team-telnyx/apis/telnyx-api/changes/ai/collections/:uuid/sources/put.md)

---

[API](https://skmtc.dev/team-telnyx/apis/telnyx-api.md) - [All operations](https://skmtc.dev/team-telnyx/apis/telnyx-api/llms.txt) - [OpenAPI document](https://skmtc.dev/team-telnyx/apis/telnyx-api/revisions/a73101b68823?raw)
