# Process video in your R2 bucket

Rendobar reads job inputs from your Cloudflare R2 bucket and writes outputs back next to them. One API token scoped to that bucket connects it, and Rendobar discards the token after exchanging it once for a key pair.

Storage connection · One API token · Job input and destination · EU and FedRAMP jurisdictions

Page: https://rendobar.com/integrations/cloudflare-r2/ · Connect Cloudflare R2: https://app.rendobar.com/storage?connect=1&provider=r2 · Read the docs: https://rendobar.com/docs/storage/cloudflare-r2

- Type: Storage connection
- Built by: Rendobar
- Auth: One Account API token scoped to the bucket, or an S3 key pair
- Used as: Job input and output destination
- Works with: Default, EU and FedRAMP jurisdictions
- Pricing: Free
- Category: Storage

## Overview

Jobs read objects in the bucket as `storage://` paths and write outputs back beside them. R2 charges no egress, so serving those outputs costs storage and operations only. The dashboard connects the bucket with one scoped API token, and the [R2 docs](https://rendobar.com/docs/storage/cloudflare-r2) cover access keys and jurisdictions.

## Reference

### Cloudflare R2 setup

- API token: R2 Object Storage > Manage API tokens > Create Account API token, Object Read & Write, Apply to specific buckets only
- The token is exchanged once for an S3 key pair and discarded. Pasting the whole token page works, Rendobar finds the token in the text
- Or: Key type Access key and secret, with the Account ID (32 hex characters), Access Key ID and Secret Access Key
- Endpoint: https://<account-id>.r2.cloudflarestorage.com
- EU and FedRAMP jurisdictions: set the jurisdiction under More options
- Public URL: the bucket's r2.dev domain or a custom domain
- If the bucket doesn't exist, the dialog offers Create the bucket and connect
- Revoke: delete the token in Manage API tokens. Deleting a bucket does not revoke its token

### Addressing

- Inputs: storage://<connection-id>/<path>, anywhere a job accepts a file URL
- Outputs: destinations: ["storage://<connection-id>[/<folder or path template>]"]
- Connection ids match [a-z0-9-]{2,40}
- In a path, write % ? # as %25 %3F %23

### Output path

- Default template (By date): rendobar/{date}/{source_name}.{ext}. Also Flat: rendobar/{source_name}.{ext}, or a custom template
- Tokens: {job_id} {ext} {source_name} {date}
- storage://<id> uses the template, storage://<id>/<folder> uses the folder plus the template's file name, a path with a token or a file name is used as written
- Name conflicts: Keep both (default, adds the job id's last 6 characters) or Replace

### Connecting

- Dashboard: Storage > Connect Storage, or client.storage.create(params)
- Rendobar writes, reads, lists and deletes a test object before saving the connection
- Stored keys are encrypted with AES-256-GCM and no endpoint returns them
- Rotate: Replace Keys, or client.storage.update(id, { credentials }). The connection id stays the same

### Delivery results

- deliveries[] on GET /jobs/{id}: storageId, status (pending, delivered, failed), path, url, reason, renamed
- Webhooks: job.delivery_succeeded, job.delivery_failed, job.deliveries_settled
- Retry: POST /jobs/{id}/deliveries/retry or client.jobs.retryDeliveries(id)

## Questions

### Does Rendobar keep my R2 API token?

No. Rendobar exchanges the token once for the S3 key pair it stands for, then discards it. The key pair is encrypted with AES-256-GCM, and no endpoint returns it.

### Why scope the R2 token to one bucket?

Deleting a bucket doesn't revoke its token, so a token for all buckets keeps reaching every other bucket in the account. Rendobar never creates or deletes buckets, so Admin Read & Write grants more than it uses.

### Does Rendobar work with R2 buckets in the EU jurisdiction?

Yes. EU and FedRAMP buckets use their own endpoint. Set the jurisdiction under More options when you connect.

### Can R2 outputs have public links?

Yes. Set the bucket's `r2.dev` address or a custom domain as the connection's public URL, and each delivery comes back with a link on that host.

## Resources

- [Docs](https://rendobar.com/docs/storage/cloudflare-r2): Token scope, the access key path, jurisdictions and revoking access.
- [Run FFmpeg on R2](https://rendobar.com/ffmpeg/r2/): The job above, with what storing and serving the output costs on R2.
- [R2 API tokens](https://developers.cloudflare.com/r2/api/tokens/): Where to create the token, and what each permission covers.
- [R2 pricing](https://developers.cloudflare.com/r2/pricing/): Storage and operations prices, and the zero egress fee.

## More

- [Run FFmpeg from a Cloudflare Worker](https://rendobar.com/ffmpeg/cloudflare/)
- [Connected storage docs](https://rendobar.com/docs/storage)