Uploading files

First steps

Every upload needs a scoped Bearer token. Choose the right endpoint for the file type and size, then store the returned public URL.

Choose an endpoint

  • POST /api/v1/upload — images, video, or audio with the matching key. Images may be compressed automatically. Best for smaller direct multipart bodies.
  • POST /api/v1/file — any file kept as-is (PNG, WebP, zip, configs).
  • Chunked upload — /api/v1/upload/chunked/* or /api/v1/file/chunked/* for large media and packs. See large files & chunked.
  • Presigned upload — safest when the client must PUT without seeing your long-lived key.

Size limits

  • Maximum supported size: 100 MB on every upload path.
  • Direct multipart: allowed up to 100 MB by the API, but many hosts (including Vercel serverless) cannot accept bodies near that size. Stay under ~3.5 MB for reliable direct uploads, or use chunked/presigned.
  • Chunk part size: 4 MB (partSize from init).

Blocked file types

The API rejects dangerous types (for example HTML, SVG, JavaScript, XML, and common executable extensions) with HTTP 415. Prefer image/video/audio media or neutral pack formats such as zip when uploading through the file endpoints.

Minimal example

curl
curl -X POST https://app.back2rp.org/api/v1/upload \
  -H "Authorization: Bearer cnf_img_your_key" \
  -F file=@screenshot.png \
  -F folder=Screenshots

Response shape

json
{
  "id": "fil_...",
  "url": "https://cdn.back2rp.org/u/abc123.png",
  "publicId": "abc123.png",
  "size": 184320,
  "mimeType": "image/jpeg",
  "originalName": "screenshot.png"
}

Authorization header

Always send Authorization: Bearer cnf_.... Do not put the key in the URL query string.

Guides