Sync API collections to an S3 or R2 bucket

Git sync is great when everyone on the team has a GitHub or GitLab account. It's less great when half the people who use the collection are QA engineers, support or partners who don't, or when the company keeps this kind of data in object storage anyway. For those teams, a collection can sync with a folder in a bucket instead.

Add the bucket once

A workspace admin opens Collection ▸ Overview ▸ Sync with Git ▸ Bucket and picks the storage.

FieldAmazon S3Cloudflare R2MinIO / other S3
Bucketbucket namebucket namebucket name
Regione.g. eu-central-1autoyour region, or empty
Endpointemptyhttps://<account id>.r2.cloudflarestorage.comhttps://minio.example.com
Folder for Requestariumoptional prefix, e.g. requestariumsamesame
KeysIAM access keyR2 API token (S3 credentials)access key

Google Cloud Storage takes an HMAC key of a service account; Azure takes a SAS token for the container; Alibaba OSS takes the AccessKey pair of a RAM user.

Give the key only what it needs

The key needs to read, write and delete objects under the prefix. It doesn't need to list the bucket. For Amazon S3:

JSON
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
    "Resource": "arn:aws:s3:::my-company-api-collections/requestarium/*"
  }]
}

For R2, an API token with Object Read & Write limited to the bucket. For Google Cloud Storage, Storage Object User on the bucket, not the project.

What "Connect bucket" checks

Before saving anything, the server writes a small probe object and checks that the storage refuses a write against the wrong version. That's what keeps two people pushing at the same moment from silently overwriting each other. A service that ignores conditional writes is refused with "this storage does not support conditional writes".

The secret key is stored encrypted, never returned by the API and never logged.

After the bucket is added, anyone who can edit a collection can link it to a folder of the bucket and use Push and Pull as with a repository: the same files, the same field-level merge, the same conflict view. The CLI works too:

Terminal
requestarium sync status "Billing API"
requestarium sync push "Billing API" --message "Add invoice search"

What ends up in the bucket

Output
requestarium/billing-api/requestarium.yaml
requestarium/billing-api/invoices/list-invoices.request.yaml
requestarium/billing-api/.requestarium/HEAD.json
requestarium/billing-api/.requestarium/revisions/…
requestarium/billing-api/.requestarium/objects/…

Every push is a revision: who, when, the message and the files. That's what Restore a version… lists for a bucket link, and what the next merge is computed against.

Scheduled checks instead of webhooks

Buckets don't send webhooks, so turn on a scheduled check for the link (every 15 minutes to once a day). The server looks at the newest revision and marks the collection as behind when someone else pushed. With Pull new commits automatically on, an open app pulls changes that merge cleanly.

Removing a connection

Remove this connection works once no collection uses it. The stored keys are deleted; the files stay in the bucket.

Buckets inside a private network need self-hosted Requestarium: on Requestarium Cloud, the endpoint must be reachable from the internet.