Quick start

Upload your first file and serve it back from your tenant's domain in a few minutes.

This walks through the shortest path: authenticate, upload one file, and open it from your tenant's delivery path. You need a tenant slug and credentials that can call the platform API. See API keys if you don't have one yet.

Before you start

Every Storage request goes through the gateway and identifies a tenant. Send these headers on management calls:

HeaderPurpose
Authorization: Bearer <token>Your access token from ID, or a personal access token.
X-Revenexx-Api-Key: <key>A machine-to-machine key, created in Cockpit. Use this or a Bearer token.
X-Revenexx-Tenant: <slug>Which tenant the request applies to.

Throughout this section, <TENANT_SLUG> is your tenant's slug and <API_KEY> is your key.

1. Upload a file

Upload is a single multipart/form-data request to the assets endpoint. The file part is required; everything else is optional metadata.

curl -X POST https://api.revenexx.com/v1/storage/assets \
  -H "X-Revenexx-Api-Key: <API_KEY>" \
  -H "X-Revenexx-Tenant: <TENANT_SLUG>" \
  -F "file=@./sunset.jpg" \
  -F "visibility=public" \
  -F "alt_text=Sunset over the harbour"

The response includes the asset's id, its folder, and its delivery URL. Keep the id; you use it for every later operation on the file.

2. Serve the file

Public assets are served under the /cdn/ path of your tenant's domain. What follows /cdn/ is the folder, then the file name:

text
https://<TENANT_SLUG>.revenexx.cloud/cdn/<folder>/sunset.jpg

Every tenant gets <tenant>.revenexx.cloud when it is created, wired up for you — so this URL works immediately, with no DNS to configure. Open it in a browser, or drop it straight into an <img> tag. The first request is built at the origin and cached at a point of presence; later requests come from the one nearest the reader.

Connecting your own domain later changes nothing about the path — the same file is then also served at https://shop.example.com/cdn/<folder>/sunset.jpg. See Domains.

3. Transform it on the way out

For images, add transform parameters to the delivery URL and the edge returns a derivative built on the fly. Resize to 800 px wide and convert to WebP:

text
https://<TENANT_SLUG>.revenexx.cloud/cdn/<folder>/sunset.jpg?w=800&fm=webp

You store one original and serve whatever size and format each page needs. See Serve & transform images for the full parameter list.

What's next

Was this page helpful?