---
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
    - `bucket_id` string — The Telnyx Storage bucket name. Required when `source_type` is `bucket`; ignored otherwise.
    - `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).

## Response `200`

The reconciled source list.

- SourceReconcileEnvelope
  - `data` Source[]
    - `bucket_id` string — The Telnyx Storage bucket name. Present only for `bucket` sources.
    - `collection_id` string, uuid
    - `id` string
    - `record_type` string — Identifies the record type. Always `ai_collection_source`.
    - `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).
    - `status` string
  - `meta` SourceReconcileMeta — Reports which source IDs were added, retained, and removed by a replace operation.
    - `added` string[]
    - `removed` string[]
    - `retained` 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`).

---

[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/3fdc16374d70/schema)
