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

# Bucket

> Index files from a Telnyx Storage bucket in an AI Search collection.

The `bucket` source indexes the files in one specific Telnyx Storage bucket. Attach multiple bucket sources to cover multiple buckets.

Searching bucket sources is coming soon. You can attach a `bucket` source today; its files are skipped by search until then.

## Where this data comes from

Bucket records are the objects stored in [Telnyx Cloud Storage](https://developers.telnyx.com/docs/cloud-storage/overview.md), the S3-compatible object store. Upload files to a bucket with the S3 API or the portal (see [Get Files Into a Bucket](#get-files-into-a-bucket) below); the `bucket` source indexes that one bucket's contents by its `bucket_id`.

## Get Files Into a Bucket

Upload documents with the S3-compatible API or the portal -- see the [Cloud Storage quickstart](https://developers.telnyx.com/docs/cloud-storage/quick-start.md). To search one bucket's documents directly today, use the [Embeddings API](https://developers.telnyx.com/docs/inference/embeddings.md).

## Attach the Source

A `bucket` source is the only type with required configuration -- its `bucket_id`:

```bash theme={null}
curl -X POST https://api.telnyx.com/v2/ai/collections/{uuid}/sources \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "source_type": "bucket", "bucket_id": "policy-docs" }'
```

Omitting `bucket_id` returns `422`:

```json theme={null}
{
  "errors": [{
    "code": "invalid_source_configuration",
    "title": "Invalid source configuration",
    "detail": "The bucket_id field is required when source_type is bucket.",
    "source": { "pointer": "/bucket_id" }
  }]
}
```

Buckets are reconciled by `source_type` + `bucket_id`, so the same bucket can back many collections. Removing a bucket source never touches the bucket's contents.

***

See all source types on the [Sources overview](https://developers.telnyx.com/docs/ai-search/sources.md).
