> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixpeek.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Object storage and syncs

> Connect S3, GCS, Azure Blob, Google Drive, SharePoint, Box, R2, Backblaze, Mux, Iconik and more, then sync files into a bucket on a schedule.

Connect a storage provider once, then point a **sync** at a folder or prefix so new and changed files land in a Mixpeek [bucket](https://docs.mixpeek.com/docs/ingest/buckets.md) and get processed. Your files stay where they are; Mixpeek reads them with the credentials you give it.

A sync has two parts:

| Part | Scope | What it holds |
| - | - | - |
| **Storage connection** | Organization | Provider type and credentials. Created once, reused by any number of syncs |
| **Sync** | One bucket | Which path to read, how often, which files, and how file metadata maps to bucket fields |

## Prerequisites

* A bucket whose schema has a blob field for the files, such as `{"video": {"type": "video"}}`. See [Bucket schema](https://docs.mixpeek.com/docs/ingest/buckets.md#bucket-schema).
* A [collection](https://docs.mixpeek.com/docs/extract/collections.md) sourced from that bucket, if you want the files processed as they arrive.
* An API key with the **`admin`** permission to create the connection, because connections hold credentials. The Studio key presets stop at read, write and delete; tick **Admin** in the key's Edit dialog. Syncs, and reading connections, need only `write` and `read`.

## Connect and sync

The steps use Amazon S3 with an IAM role. Every other provider differs only in the `provider_type` and `provider_config` of step 1 and the `source_path` format of step 2; see [Providers](#providers).

**1. Create the storage connection**

Mixpeek's production API assumes your role from AWS account `931340738373`. Create a role that trusts that account, requires an external ID you choose (8 to 128 characters), and has `s3:ListBucket` on the bucket and `s3:GetObject` on its objects. The [S3 accordion](#providers) has the exact policies.

```bash cURL theme={null}
curl -X POST "https://api.mixpeek.com/v1/organizations/connections" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -H "Content-Type: application/json" \
  -d @- <<EOF
{
  "name": "video-library",
  "provider_type": "s3",
  "provider_config": {
    "credentials": {
      "type": "iam_role",
      "role_arn": "$AWS_ROLE_ARN",
      "external_id": "$AWS_EXTERNAL_ID"
    },
    "region": "us-east-1"
  },
  "test_before_save": false
}
EOF
```

```python Python theme={null}
import os, requests

resp = requests.post(
    "https://api.mixpeek.com/v1/organizations/connections",
    headers={"Authorization": f"Bearer {os.environ['MIXPEEK_API_KEY']}"},
    json={
        "name": "video-library",
        "provider_type": "s3",
        "provider_config": {
            "credentials": {
                "type": "iam_role",
                "role_arn": os.environ["AWS_ROLE_ARN"],
                "external_id": os.environ["AWS_EXTERNAL_ID"],
            },
            "region": "us-east-1",
        },
        "test_before_save": False,
    },
)
print(resp.json()["connection_id"])
```

```javascript JavaScript theme={null}
const resp = await fetch("https://api.mixpeek.com/v1/organizations/connections", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MIXPEEK_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "video-library",
    provider_type: "s3",
    provider_config: {
      credentials: {
        type: "iam_role",
        role_arn: process.env.AWS_ROLE_ARN,
        external_id: process.env.AWS_EXTERNAL_ID,
      },
      region: "us-east-1",
    },
    test_before_save: false,
  }),
});
console.log((await resp.json()).connection_id);
```

`test_before_save` defaults to `true`. For S3 the test calls `ListBuckets`, which needs `s3:ListAllMyBuckets` on `*`, a permission a read-only role usually lacks. With `false`, the first sync run is the test. You can test a saved connection any time with [`POST /v1/organizations/connections/{id}/test`](https://docs.mixpeek.com/docs/api-reference/organization-connections/test-storage-connection).

**2. Create the sync on your bucket**

```bash cURL theme={null}
curl -X POST "https://api.mixpeek.com/v1/buckets/$BUCKET_ID/syncs" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -H "X-Namespace: $NAMESPACE_ID" \
  -H "Content-Type: application/json" \
  -d @- <<EOF
{
  "connection_id": "$CONNECTION_ID",
  "source_path": "$S3_BUCKET/videos/",
  "sync_mode": "continuous",
  "polling_interval_seconds": 300,
  "file_filters": {"include_patterns": ["*.mp4", "*.mov"]}
}
EOF
```

```python Python theme={null}
sync = requests.post(
    f"https://api.mixpeek.com/v1/buckets/{os.environ['BUCKET_ID']}/syncs",
    headers={
        "Authorization": f"Bearer {os.environ['MIXPEEK_API_KEY']}",
        "X-Namespace": os.environ["NAMESPACE_ID"],
    },
    json={
        "connection_id": os.environ["CONNECTION_ID"],
        "source_path": f"{os.environ['S3_BUCKET']}/videos/",
        "sync_mode": "continuous",
        "polling_interval_seconds": 300,
        "file_filters": {"include_patterns": ["*.mp4", "*.mov"]},
    },
).json()
print(sync["sync_config_id"])
```

```javascript JavaScript theme={null}
const syncResp = await fetch(
  `https://api.mixpeek.com/v1/buckets/${process.env.BUCKET_ID}/syncs`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.MIXPEEK_API_KEY}`,
      "X-Namespace": process.env.NAMESPACE_ID,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      connection_id: process.env.CONNECTION_ID,
      source_path: `${process.env.S3_BUCKET}/videos/`,
      sync_mode: "continuous",
      polling_interval_seconds: 300,
      file_filters: { include_patterns: ["*.mp4", "*.mov"] },
    }),
  },
);
console.log((await syncResp.json()).sync_config_id);
```

The sync request rejects unknown top-level fields with `422`. Filters go inside `file_filters`.

**3. Run the first pass**

```bash cURL title="Trigger the sync now" theme={null}
curl -X POST "https://api.mixpeek.com/v1/buckets/$BUCKET_ID/syncs/$SYNC_ID/trigger" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -H "X-Namespace: $NAMESPACE_ID"
```

After this, a `continuous` sync polls on its own every `polling_interval_seconds`.

## Check that it worked

`GET /v1/buckets/{bucket_id}/syncs/{sync_config_id}` returns the sync's status and counters:

| Field | Meaning |
| - | - |
| `total_files_discovered` | Files found in the source, all runs |
| `total_files_synced` | Files that became objects |
| `total_files_failed` | Files that failed after retries and went to the dead-letter queue |
| `last_sync_at`, `next_sync_at` | Last completed run and next scheduled poll |
| `consecutive_failures` | Failed runs in a row. The sync suspends itself after a threshold |

Each run is a sync job: [`POST .../syncs/{sync_config_id}/jobs`](https://docs.mixpeek.com/docs/api-reference/bucket-syncs/list-sync-jobs) lists them. When filters exclude every file a run finds, the run's warning says so, and the job's `metadata.files_excluded_by_filter` counts the files each filter dropped, with example paths. New objects then follow the [object states](https://docs.mixpeek.com/docs/ingest/buckets.md#object-states) `PENDING` to `COMPLETED`.

## Providers

| Provider | `provider_type` | Credential `type` | `source_path` |
| - | - | - | - |
| Amazon S3 | `s3` | `iam_role`, `access_key` | `bucket/prefix` |
| S3-compatible: Cloudflare R2, Wasabi, STRG, MinIO | `s3` with `endpoint_url` | `access_key` | `bucket/prefix` |
| Google Cloud Storage | `gcs` | `service_account` | Prefix inside the connection's bucket, or `/` |
| Azure Blob Storage | `azure_blob` | `account_key`, `managed_identity` | Prefix inside the connection's container, or `/` |
| Google Drive | `google_drive` | `service_account`, `oauth` | Folder ID |
| SharePoint, OneDrive for Business | `sharepoint` | `client_credentials`, `delegated` | `/sites/SiteName/Shared Documents/folder` |
| Box | `box` | `ccg`, `jwt`, `oauth` | Path relative to the connection's `folder_id`, or `/` |
| Backblaze B2 | `backblaze` | `application_key` | `b2://bucket/prefix` |
| Tigris | `tigris` | `access_key` | `bucket/prefix` |
| Supabase Storage | `supabase` | `access_key`, `session_token` | `bucket/prefix` |
| Mux | `mux` | `access_token` | `mux://` or `mux://{asset_id}` |
| Iconik | `iconik` | `app_token` | `iconik://` |

Every secret is encrypted at rest. Reading a connection back returns `provider_config.credentials` with only its `type`. Databases, warehouses, RTSP cameras, RSS, HTTP APIs, social accounts and email use the same connection and sync calls and are covered in [Streams, databases and the web](https://docs.mixpeek.com/docs/ingest/other-sources.md).

> [accordion] Amazon S3
>
> Read policy for the role. To limit Mixpeek to a prefix, add `"Condition": {"StringLike": {"s3:prefix": ["videos/*"]}}` to the first statement and use `arn:aws:s3:::YOUR_BUCKET/videos/*` in the second.
>
> ```json title="Read policy" theme={null}
> {
>   "Version": "2012-10-17",
>   "Statement": [
>     {"Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": ["arn:aws:s3:::YOUR_BUCKET"]},
>     {"Effect": "Allow", "Action": ["s3:GetObject"], "Resource": ["arn:aws:s3:::YOUR_BUCKET/*"]}
>   ]
> }
> ```
>
> ```json title="Trust policy" theme={null}
> {
>   "Version": "2012-10-17",
>   "Statement": [{
>     "Effect": "Allow",
>     "Principal": {"AWS": "arn:aws:iam::931340738373:root"},
>     "Action": "sts:AssumeRole",
>     "Condition": {"StringEquals": {"sts:ExternalId": "YOUR_EXTERNAL_ID"}}
>   }]
> }
> ```
>
> * To trust only Mixpeek's API user, set the principal to `arn:aws:iam::931340738373:user/mixpeek-platform-prod`.
> * Mixpeek requests a 1-hour session per sync run. CloudTrail shows each session as `mixpeek-storage-sync-<timestamp>`.
> * Access keys also work: `{"type": "access_key", "access_key_id": "...", "secret_access_key": "..."}`. A role keeps the secret in your account.
> * `region` defaults to `us-east-1` and must match the bucket's region.
> * To read object tags in a schema mapping, also grant `s3:GetObjectTagging`.

> [accordion] Cloudflare R2, Wasabi, STRG and other S3-compatible stores
>
> Use `provider_type: "s3"` with access-key credentials and the store's `endpoint_url`:
>
> | Store | `endpoint_url` | `region` | Key |
> | - | - | - | - |
> | Cloudflare R2 | `https://ACCOUNT_ID.r2.cloudflarestorage.com` | `auto` | R2 API token with Object Read |
> | Wasabi | `https://s3.REGION.wasabisys.com` | The bucket's region | IAM user with the S3 read policy above |
> | STRG | `https://s3.us-east-1.strg.com` or `https://s3.eu-central-1.strg.com` | `us-east-1` or `eu-central-1` | Read and list key scoped to the bucket |
>
> ```json title="provider_config for R2" theme={null}
> {
>   "credentials": {"type": "access_key", "access_key_id": "R2_KEY_ID", "secret_access_key": "R2_SECRET"},
>   "endpoint_url": "https://ACCOUNT_ID.r2.cloudflarestorage.com",
>   "region": "auto"
> }
> ```
>
> A key scoped to one bucket usually cannot call `ListBuckets`, so send `"test_before_save": false`.

> [accordion] Google Cloud Storage
>
> Create a service account with **Storage Object Viewer** and **Storage Legacy Bucket Reader** on the bucket, download a JSON key, and pass the whole key object. Mixpeek uses the native GCS API, so you do not need HMAC interoperability keys.
>
> ```json title="provider_config" theme={null}
> {
>   "bucket": "YOUR_BUCKET",
>   "prefix": "media/",
>   "credentials": {"type": "service_account", "service_account_json": {"type": "service_account", "project_id": "my-project"}}
> }
> ```
>
> `bucket` takes the name without `gs://`. The sync's `source_path` is a prefix under the connection's `prefix`; `/` syncs the whole connection scope.

> [accordion] Azure Blob Storage
>
> The provider type is `azure_blob`; a bare `azure` returns `422`.
>
> ```json title="provider_config" theme={null}
> {
>   "account_name": "YOUR_STORAGE_ACCOUNT",
>   "container": "YOUR_CONTAINER",
>   "prefix": "media/",
>   "credentials": {"type": "account_key", "account_name": "YOUR_STORAGE_ACCOUNT", "account_key": "YOUR_ACCESS_KEY"}
> }
> ```
>
> `managed_identity` credentials authenticate as the Azure identity the Mixpeek workload runs under, so they apply when Mixpeek runs inside your Azure tenant ([customer-hosted](https://docs.mixpeek.com/docs/production/customer-hosted.md)). Grant that identity **Storage Blob Data Reader**, and set `client_id` only to pick one of several user-assigned identities.

> [accordion] Google Drive
>
> With a service account, share the Drive folder or shared drive with the account's `client_email` (Viewer is enough). That share is what grants access. For one user's Drive, use OAuth with `client_id`, `client_secret` and a long-lived `refresh_token`.
>
> ```json title="provider_config" theme={null}
> {
>   "credentials": {
>     "type": "service_account",
>     "project_id": "my-project",
>     "private_key_id": "KEY_ID",
>     "private_key": "-----BEGIN PRIVATE KEY-----\nKEY\n-----END PRIVATE KEY-----\n",
>     "client_email": "sync@my-project.iam.gserviceaccount.com",
>     "client_id": "CLIENT_ID"
>   },
>   "shared_drive_id": "0AH-Xabc123"
> }
> ```
>
> * Set `shared_drive_id` only for a shared drive.
> * `impersonate_user` reads files as a Workspace user and needs domain-wide delegation.
> * `source_path` is the folder ID, the last segment of the folder's URL. List what the connection can see with `GET /v1/organizations/connections/{id}/folders` and `/files`.
> * Mixpeek only reads from Drive.

> [accordion] SharePoint and OneDrive for Business
>
> Register an Azure AD app with Microsoft Graph `Sites.Read.All` and `Files.Read.All` and grant admin consent. `client_credentials` (app-only, for production) takes `tenant_id`, `client_id` and `client_secret`. `delegated` acts as one user and adds `refresh_token`; `tenant_id` can be `common` for a multi-tenant app.
>
> ```json title="provider_config" theme={null}
> {
>   "credentials": {"type": "client_credentials", "tenant_id": "TENANT_ID", "client_id": "CLIENT_ID", "client_secret": "CLIENT_SECRET"},
>   "site_id": "contoso.sharepoint.com,guid1,guid2",
>   "drive_id": "b!DRIVE_ID",
>   "folder_path": "/Shared Documents/Marketing"
> }
> ```
>
> Omit `site_id` for personal OneDrive, `drive_id` for the site's default library, and `folder_path` for the library root. Find the IDs with Graph: `GET /v1.0/sites/contoso.sharepoint.com:/sites/Marketing`, then `GET /v1.0/sites/SITE_ID/drives`.

> [accordion] Box
>
> Create a Custom App at developer.box.com. For production use Client Credentials Grant (`ccg`: `client_id`, `client_secret`, `enterprise_id`), and authorize the app in **Admin Console > Apps > Custom Apps Manager**. `jwt` takes `client_id`, `client_secret`, `enterprise_id`, `jwt_key_id` and `private_key`. `oauth` with a developer token expires after 60 minutes and cannot refresh, so use it only for testing.
>
> ```json title="provider_config" theme={null}
> {
>   "credentials": {"type": "ccg", "client_id": "CLIENT_ID", "client_secret": "CLIENT_SECRET", "enterprise_id": "ENTERPRISE_ID"},
>   "folder_id": "0"
> }
> ```
>
> `folder_id` is the number at the end of the folder URL (`app.box.com/folder/123456789`); `0` is the root. A CCG app acts as a service account, so grant it access to the folders you sync.

> [accordion] Backblaze B2
>
> Create an application key with `listBuckets`, `listFiles` and `readFiles`, ideally scoped to one bucket. Mixpeek discovers the regional endpoint from the B2 authorization API.
>
> ```json title="provider_config" theme={null}
> {"credentials": {"type": "application_key", "key_id": "KEY_ID", "application_key": "APPLICATION_KEY"}}
> ```
>
> `source_path` accepts `b2://bucket/prefix`, `s3://bucket/prefix`, `bucket/prefix` or `bucket`. A connection test can pass with `listBuckets` while the sync gets Access Denied; the key also needs `listFiles` and `readFiles` on that bucket.

> [accordion] Tigris
>
> ```json title="provider_config" theme={null}
> {
>   "credentials": {"type": "access_key", "access_key_id": "tid_KEY", "secret_access_key": "tsec_SECRET"},
>   "region": "auto",
>   "endpoint_url": "https://t3.storage.dev"
> }
> ```
>
> `endpoint_url` defaults to `https://fly.storage.tigris.dev` and `region` to `auto`.

> [accordion] Supabase Storage
>
> Generate S3 access keys in **Project Settings > Storage > S3 Access Keys**. Mixpeek derives the endpoint from `project_ref`, the short hash in `https://<ref>.supabase.co`.
>
> ```json title="provider_config" theme={null}
> {
>   "project_ref": "abcdefghijklmnopqrst",
>   "region": "us-east-2",
>   "credentials": {"type": "access_key", "access_key_id": "KEY_ID", "secret_access_key": "SECRET"}
> }
> ```
>
> `session_token` credentials (`anon_key` and `service_role_key` from **Project Settings > API**) work when you cannot mint S3 keys, but `service_role` has full access to Storage. A `403` or `SignatureDoesNotMatch` usually means general API keys were used instead of S3 keys, or `region` does not match the project.

> [accordion] Mux
>
> Create an access token with **Mux Video** read permission and pass `access_token_id` and `access_token_secret` (`type: "access_token"`).
>
> * Mixpeek downloads MP4 static renditions. Assets with only HLS are skipped, so enable `static_renditions` on the asset.
> * Only assets in `ready` status with a playback ID sync.
> * Each object carries `source_metadata` with `asset_id`, `playback_id`, `playback_url`, `thumbnail_url`, `duration`, `resolution_tier` and `aspect_ratio`. It passes through to documents, so search results can render in a Mux player directly.
> * Filter on asset fields such as `passthrough` with `file_filters.metadata_filters`.
> * For instant deletes and updates, see [Source webhooks](#source-webhooks-for-mux-and-iconik).

> [accordion] Iconik
>
> Create an application in **Admin > Integrations > Applications** and pass `app_id` and `auth_token` (`type: "app_token"`). Set `base_url` for an on-premise Iconik.
>
> * Mixpeek downloads the proxy file, or the original when there is no proxy.
> * `provider_filters` takes `collection_ids` (traversed up to 10 levels), `status`, `media_type` and `path_patterns` (case-insensitive globs on the collection path). The collection path lands in `source_metadata.directory_path`.
> * Custom metadata from every metadata view is flattened into `source_metadata`. Limit it to one view with `metadata_view_id`, or set it to `none` to skip view calls.
> * `NLE_PROJECT` assets (Premiere `.prproj`, `.fcpxml`, xmeml) get `uses_footage` and `uses_media` edges to the footage they use, with clip order and timeline ticks when the project file parses. Follow them with the `traverse_edge` [stage](https://docs.mixpeek.com/docs/retrieve/stages.md).
> * `reconcile.on_update: true` (the default) repeats every per-asset call on every walk. For libraries over 10,000 assets, set it to `false` unless you need edits that leave `date_modified` unchanged.

## Sync options

| Field | Default | What it does |
| - | - | - |
| `sync_mode` | `continuous` | `continuous` polls on a schedule. `initial_only` runs once over existing files, for a backfill |
| `polling_interval_seconds` | `300` | 30 to 86,400. A new file arrives within one interval |
| `batch_size` | `50` | Files per processing batch, 1 to 100 |
| `skip_duplicates` | `true` | Skip files whose source ID is already in the bucket. `false` replaces them on each run |
| `batch_collection_ids` | All collections on the bucket | Process only these collections |
| `skip_batch_submission` | `false` | Create objects without processing them |
| `sync_from` | None | Ingest only files modified after this time and skip the backlog |
| `max_objects_per_run` | `100000` | Cap on objects per run |
| `provider_filters` | None | Filters pushed down to the provider's API, such as Iconik `collection_ids` |

`file_filters` narrows files on Mixpeek's side; all filters must match. `include_patterns` and `exclude_patterns` are globs: without a `/` they match the file name at any depth (`*.mp4`), with a `/` they match the path from the sync root (`videos/*.mp4`). The other filters are `min_size_bytes`, `max_size_bytes`, `modified_after`, `modified_before`, `mime_types`, and `metadata_filters`, which compare provider metadata with `equals`, `not_equals`, `contains`, `not_contains`, `gt`, `lt`, `gte`, `lte` or `exists`.

### Map file metadata to bucket fields

`schema_mapping` fills bucket fields from each file. Keys are bucket schema fields. A `blob` entry takes the file itself; a `field` entry reads a value from a source such as `metadata`, `tag`, `filename_regex`, `folder_path` or `constant`.

```json title="schema_mapping for S3 user metadata" theme={null}
{
  "schema_mapping": {
    "mappings": {
      "video": {"target_type": "blob", "source": {"type": "file"}, "blob_type": "video"},
      "video_id": {"target_type": "field", "source": {"type": "metadata", "key": "video_id"}},
      "region": {"target_type": "field", "source": {"type": "tag", "key": "region"}}
    }
  }
}
```

On S3 and S3-compatible stores, `metadata` reads the `x-amz-meta-*` headers, keyed in lowercase without the prefix, with one `HeadObject` per file. `tag` reads object tags with one `GetObjectTagging` per file; other providers leave tag mappings empty. Each read happens only when a mapping uses that source.

### How changes in the source arrive

The `reconcile` object decides how the bucket follows the source. All four switches default to `true`.

| Field | Effect |
| - | - |
| `on_delete` | A deleted source file deletes its object and documents |
| `on_update` | Changed metadata updates the object and reprocesses it |
| `re_extract_on_update` | With `on_update`, re-runs extraction. Set `false` to update fields only, or list trigger fields in `re_extract_fields` |
| `on_filter_drift` | An object whose source no longer matches `metadata_filters` is removed |

On S3, a poll picks up anything that moves `LastModified`:

| Change in S3 | Next poll |
| - | - |
| New object | Creates and processes an object |
| Overwritten with new content | Deletes the old object and its documents, then creates a new object with a new `object_id` |
| Metadata changed by copying the object onto itself | Updates mapped fields and reprocesses |
| Deleted | Deletes the object and its documents |
| Tags edited | Nothing until the object next changes, because a tag edit leaves `LastModified` unchanged |

S3 user metadata cannot change in place. Copy the object onto itself with `--metadata-directive REPLACE` and every key, not only the changed one.

## Run a sync on upload instead of polling

On S3, send bucket events to EventBridge and point an API destination at the sync's trigger with `queue_follow_up=true`. A trigger during a run queues one follow-up run, however many uploads arrive.

> [accordion] EventBridge setup
>
> 1. `aws s3api put-bucket-notification-configuration --bucket YOUR_BUCKET --notification-configuration '{"EventBridgeConfiguration": {}}'`
> 2. Create an EventBridge connection of type `API_KEY` with header `Authorization: Bearer MIXPEEK_KEY` and an `X-Namespace` invocation header. Use a dedicated key with `write` on the namespace.
> 3. Create an API destination for `https://api.mixpeek.com/v1/buckets/BUCKET_ID/syncs/SYNC_ID/trigger?queue_follow_up=true`, method `POST`. Keep `--invocation-rate-limit-per-second` at or under your plan's `data` rate limit divided by 60, for example 2 on Build.
> 4. Add a rule matching `"source": ["aws.s3"]`, `"detail-type": ["Object Created"]` and your bucket and prefix, targeting the destination with a retry policy and a dead-letter queue. The target's role needs `events:InvokeApiDestination`.
> 5. Keep the sync `continuous` with `polling_interval_seconds: 3600`, so an hourly pass catches dropped events and deletes.
>
> Each triggered run still lists the prefix, about 4 seconds for 20,000 objects, so events suit prefixes up to about that size. A `429` is retried by EventBridge. A sync sharded across several `bucket_prefixes` cannot queue a follow-up and answers `400`. Job `metadata.triggered_by` reads `manual_api_trigger` or `queued_follow_up`.

To push files from your own code instead, create objects through the API with a presigned `GetObject` URL valid for at least an hour; see [Objects and blobs](https://docs.mixpeek.com/docs/ingest/buckets.md#objects-and-blobs). For a large existing library, run an `initial_only` sync and then [bulk-submit](https://docs.mixpeek.com/docs/ingest/buckets.md#batches).

### Source webhooks for Mux and Iconik

Mux and Iconik can push deletes and updates so the bucket does not wait for the next poll. Store a random string of 32 or more characters as `credentials.webhook_secret` on the connection, then register the endpoint in the provider with the same secret.

| Provider | Endpoint | Signature header | Events |
| - | - | - | - |
| Mux | `https://api.mixpeek.com/v1/webhooks/mux/{connection_id}` | `Mux-Signature: t=<ts>,v1=<hmac>` over `t.body` | `video.asset.deleted`, `video.asset.updated` |
| Iconik | `https://api.mixpeek.com/v1/webhooks/iconik/{connection_id}` | `X-Iconik-Signature: <hmac>` over the body | `assets.asset_deleted`, `assets.asset_updated`, `assets.asset_created` |

A delete removes every object synced from the asset and its documents. An update re-checks the asset against `metadata_filters` and removes it if `on_filter_drift` is on. The endpoint answers `400` when the connection has no `webhook_secret` and `401` when the signature does not match.

## Pause, resume and recover

| Call | Effect |
| - | - |
| `POST .../syncs/{sync_config_id}/pause` | Stops polling and keeps the resume cursor |
| `POST .../syncs/{sync_config_id}/resume` | Starts polling again from the cursor |
| `POST .../syncs/{sync_config_id}/trigger` | Runs now, outside the schedule |
| `POST .../syncs/{sync_config_id}/unlock` | Releases the run lock after a worker crashed mid-run |
| `POST .../syncs/{sync_config_id}/dlq` | Lists files that failed 3 retries; `/dlq/requeue` retries them |

A lock stops two runs of one sync at once, and a resume cursor lets an interrupted run continue where it stopped. Source tracking means a retried run never creates a duplicate object.

To restore a namespace snapshot to the exact files it saw, turn on object versioning in your bucket and keep old versions at least as long as your snapshots (30 days by default). Without it, a restored document points at the current file, or at nothing. See [Storage, tiering and backups](https://docs.mixpeek.com/docs/manage/storage.md).

## What goes wrong

| Symptom | Cause and fix |
| - | - |
| `UnauthorizedError` with `required_permissions: ["admin"]` on connection create | The key lacks `admin`. Edit the key in Studio and tick **Admin** |
| `AccessDenied` on the S3 connection test | The trust policy's principal or external ID does not match, or the role lacks `s3:ListAllMyBuckets`. Fix the policy or send `test_before_save: false` |
| `422` on sync create | An unknown top-level field, such as `include_patterns` outside `file_filters`, or `provider_type: "azure"` on a connection |
| Run finishes with 0 files | `include_patterns` exclude everything (check `files_excluded_by_filter`), or `source_path` sits outside the prefix the credentials can list |
| A mapped field is empty | S3 metadata keys are lowercase and drop `x-amz-meta-` |
| Box run finds 0 files | The OAuth developer token expired after 60 minutes. Switch to `ccg` |
| Mux assets skipped | The asset has no MP4 static rendition, or is not `ready` |
| A stored `object_id` stops resolving | The source file was overwritten, which creates a new object |
| Sync stays locked after a crash | Call `/unlock` |

## Related

* [Buckets and objects](https://docs.mixpeek.com/docs/ingest/buckets.md): schemas, object states, duplicates and batch sizing
* [Streams, databases and the web](https://docs.mixpeek.com/docs/ingest/other-sources.md): Postgres, Snowflake, RTSP, RSS, social and email sources
* [Create storage connection API](https://docs.mixpeek.com/docs/api-reference/organization-connections/create-storage-connection.md) and [Create sync API](https://docs.mixpeek.com/docs/api-reference/bucket-syncs/create-sync-configuration.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.