Create S3 Sync

Create a Sync for a collection and start the initial backfill. AWS S3 authenticates with cross-account assume-role (recommended) or an access key. Works across S3-compatible cloud storage: AWS S3, Cloudflare R2, Supabase Storage, and Backblaze B2 (each has its own create endpoint). Returns the sync; indexing runs asynchronously.

Path parameters

collection_namestringRequired
Destination collection.

Headers

authorizationstring or nullOptional

Bearer {api_key}. Your Captain API key.

Request

This endpoint expects an object.
bucketstringRequired
Bucket to keep in sync with the collection.
authobjectRequired

Auth for reading the bucket: assume-role (AWS S3) or access-key (S3 or S3-compatible). Non-S3 stores require access-key auth.

processing_typeenumRequired

Parsing tier. ‘advanced’ = full document understanding; ‘basic’ = faster/cheaper.

prefixstringOptionalDefaults to

Key prefix to scope the sync (e.g. ‘docs/2024/’). Empty syncs the whole bucket.

regionstringOptionalDefaults to us-east-1

Region of the bucket (AWS region for S3, or the provider’s region, e.g. ‘auto’ for R2, ‘us-west-004’ for Backblaze B2).

storage_typeenumOptionalDefaults to s3

Cloud storage type. ‘s3’ = AWS S3 (assume-role or access-key). ‘r2’/‘supabase’/‘backblaze’ are S3-compatible and require access-key auth with an endpoint_url.

include_patternslist of stringsOptional

Glob patterns; only matching keys are synced. Empty includes everything under the prefix.

exclude_patternslist of stringsOptional

Glob patterns; matching keys are excluded.

deletion_policyenumOptionalDefaults to mirror

How to propagate deletes: mirror removes from the collection, archive retains but marks, ignore leaves untouched.

custom_metadatamap from strings to anyOptional
Static metadata applied to every synced document.
sync_interval_minutesinteger or nullOptional

Scheduled reconcile cadence. MINIMUM 5 minutes (the scheduler ticks every 5 min); values below 5 are silently raised to 5; >=5 honored exactly. null/omitted = manual (events + on-demand only). For sub-5-min propagation use the event webhook.

Response

Successful Response
sync_idstringOptional
collection_namestringOptional
bucketstringOptional
prefixstringOptional
regionstringOptional
storage_typeenumOptional
The sync's cloud storage type.
auth_methodenumOptional

‘iam_role’ for assume-role syncs, ‘access_key’ for access-key syncs.

endpoint_urlstring or nullOptional

S3-compatible endpoint URL (access-key syncs on non-AWS providers); null for AWS S3.

processing_typeenumOptional
include_patternslist of stringsOptional
exclude_patternslist of stringsOptional
deletion_policyenumOptional
statusenumOptional
secret_setbooleanOptional

True once an event-webhook secret has been minted.

sns_subscribe_urlstring or nullOptional

Event-webhook subscribe URL (only surfaced by the webhooks endpoint).

last_backfill_job_idstring or nullOptional
last_reconcile_atstring or nullOptional
sync_interval_minutesinteger or nullOptional

Effective (already-clamped) cadence; null = manual.

next_sync_atinteger or nullOptional
Epoch ms of the next due scheduled reconcile.
sync_stateenum or nullOptional
last_sync_atinteger or nullOptional
last_sync_errorstring or nullOptional
created_atstringOptional
updated_atstring or nullOptional
© 2026 Captain