Quick start

Upload your first file and serve it back from your delivery host in a few minutes.

This walks through the shortest path: authenticate, upload one file, and open it from the delivery host. 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 your console. 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 directly from your delivery host. The path is the tenant, the folder, then the file name:

text
https://storage.revenexx.com/<TENANT_SLUG>/<folder>/sunset.jpg

Open that URL in a browser, or drop it straight into an <img> tag. The first request is served from origin and cached at the edge; later requests come from the nearest EU point of presence.

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://storage.revenexx.com/<TENANT_SLUG>/<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?