Integrations
Sync S3 & R2 Bucket
Start a sync for a connected bucket. After the first import, syncs only run when you start one, here or from the dashboard.
Request
Replace {id} in the path with the sync ID, shown on the bucket's Settings tab in the dashboard. No request body is needed.
Query ·optional
mode string
full or changes. Defaults to changesModes
| Mode | What it does |
|---|---|
| changes | Imports new and modified images and removes deleted ones. After a failed sync, it picks up where that one stopped. |
| full | Starts over, downloads every image again and retries skipped ones. |
Note: the API key needs write permission. If it's limited to certain databases, they must include the one this bucket syncs into.
Response
Returns 202 with an empty body. The sync runs in the background, and you can follow its progress on the bucket's page in the dashboard.
Errors
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key. |
| 403 | The key can't write, or can't access this bucket's database. |
| 404 | No sync with this ID. |
| 429 | A sync is running, or one started less than a minute ago. |
When to Sync
- From a cron job, for example every hour.
- At the end of a script that uploads images.
- After a deploy or a bulk import.
Starting a sync while one is running, or less than a minute after the last one, returns 429, so you don't need to guard against calling it too often.