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

# Replace collection sources

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

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` Source[]
    - `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

> 81 revisions in range; 1 not diffed.

- **2026-09-16** `a6a61a29ecdd` — 5 breaking, 5 warning, 15 info
  - the `errors/items/code` response's property type changed from `string` to `integer`, and format from no format to `int32` for status `400`
  - the `errors/items/code` response's property type changed from `string` to `integer`, and format from no format to `int32` for status `401`
  - the `errors/items/code` response's property type changed from `string` to `integer`, and format from no format to `int32` for status `404`
  - the `errors/items/code` response's property type changed from `string` to `integer`, and format from no format to `int32` for status `409`
  - …21 more
- **2026-08-17** `1571b0380bd7` — 1 info
  - endpoint added

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

---

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