sync

Create Azure Sync

Create an Azure Blob Storage Sync for a collection and start the initial backfill. Azure authenticates with the storage account's name and account key (stored securely, never returned), so there is no region, endpoint_url, or assume-role; the container is echoed back as bucket. Returns the sync; indexing runs asynchronously.

post/v2/collections/{collection_name}/sync/azure

Path parameters

collection_namestring required

Destination collection.

Headers

authorizationstring nullable

Bearer {api_key}. Your Captain API key.

Request body

containerstring required

Azure Blob container to keep in sync with the collection (3-63 chars, lowercase letters, digits, single hyphens). Echoed as bucket in sync responses.

account_namestring required

Azure storage account name (the <account> in https://<account>.blob.core.windows.net; 3-24 lowercase letters and digits).

account_keystring required

Storage account access key (key1 or key2) with read access to the container. Stored securely, never returned. Rotate later with PATCH /v2/syncs/{sync_id}.

prefixstring

Object-name prefix to scope the sync (e.g. 'docs/2024/'). Empty syncs the whole bucket.

processing_type'advanced' | 'basic' required

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

include_patternsstring[]

Glob patterns; only matching blob names are synced.

exclude_patternsstring[]

Glob patterns; matching blob names are excluded.

deletion_policy'mirror' | 'archive' | 'ignore'

How to propagate blobs removed from Azure: mirror removes them from the collection so they no longer appear in search; archive keeps the document's content but marks it archived, excluded from search by default and surfaced with include_archived: true; ignore leaves the indexed copy in place.

metadata_mappingobject nullable

Maps an Azure blob metadata key to a Captain metadata field name.

custom_metadataAzureSyncCreateRequestDocsCustomMetadata

Static metadata applied to every synced document.

sync_interval_minutesinteger nullable

Scheduled reconcile cadence in minutes (minimum 5; below 5 clamps to 5). Defaults to 60 for Azure so reconcile backstops any missed Event Grid delivery; null = manual (no scheduled reconcile).

Response

Successful Response

sync_idstring
collection_namestring
bucketstring
prefixstring
regionstring
storage_type's3' | 'gcs' | 'r2' | 'supabase' | 'backblaze' | 'azure'

The sync's cloud storage type. Returned by the list endpoint (GET /v2/syncs) only; other sync endpoints omit this field.

auth_method'iam_role' | 'access_key' | 'service_account' | 'account_key'

How the sync authenticates to the bucket: 'iam_role' (AWS cross-account assume-role), 'access_key' (S3-compatible key pair), or 'service_account' (GCS service-account JSON).

account_namestring nullable

Azure Blob syncs only: the storage account name. Null for other providers.

endpoint_urlstring nullable

S3-compatible endpoint URL (access-key syncs on non-AWS providers); null for AWS S3. Returned by the list endpoint (GET /v2/syncs) only; other sync endpoints omit this field.

processing_type'advanced' | 'basic'
include_patternsstring[]
exclude_patternsstring[]
deletion_policy'mirror' | 'archive' | 'ignore'
status'active' | 'paused' | 'inactive'
secret_setboolean

True once an event-webhook secret has been minted.

sns_subscribe_urlstring nullable

SNS subscribe URL; only surfaced by the subscribe-webhook endpoint.

last_backfill_job_idstring nullable
last_reconcile_atstring nullable
sync_interval_minutesinteger nullable

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

next_sync_atinteger nullable

Epoch ms of the next due scheduled reconcile.

sync_state'idle' | 'running' | 'error'
last_sync_atinteger nullable
last_sync_errorstring nullable
created_atstring
updated_atstring nullable

Changes

Changed in 2 of the 13 revisions of this API.2