FOLIO REST API

Upload. Read. Serve.

Create a workspace and an API key in the dashboard. Call this API from your server with Authorization: Bearer $FOLIO_KEY. Send your customer ID in X-Folio-Tenant; omitting it uses the default tenant.

An API key grants access to every tenant in its workspace. Authorize your end user in your app before choosing their tenant. Give browsers signed links instead of secret keys.

Upload from your server
curl "https://folio.atef.dev/api/v1/files" \
  -H "Authorization: Bearer $FOLIO_KEY" \
  -H "X-Folio-Tenant: customer_123" \
  -F "[email protected]" \
  -F "purpose=invoice" \
  -F 'metadata={"orderId":"order_456"}'

The response contains file.id, status, and derivatives. Read the file until the rendition you need says ready. Originals are available immediately; preview failures leave the original intact.

Get a signed browser preview
curl "https://folio.atef.dev/api/v1/files/$FILE_ID/links" \
  -H "Authorization: Bearer $FOLIO_KEY" \
  -H "X-Folio-Tenant: customer_123" \
  -H "Content-Type: application/json" \
  -d '{"variant":"preview"}'

Resolve the returned relative url against https://folio.atef.dev, then use it in your app. A link grants access to one file rendition and expires after five minutes. Choose content, thumbnail, preview, or optimized.

Endpoints

MethodPathWhat it does
POST/filesUpload multipart field file. Optional purpose, profile, and metadata (JSON object).
GET/filesList tenant files with limit=1–100 and cursor; response includes nextCursor.
GET/files/:idRead metadata, processing status, and available renditions.
GET/files/:id/contentDownload the original.
GET/files/:id/thumbnailGet an image thumbnail or PDF first-page preview.
GET/files/:id/previewGet a visual preview.
GET/files/:id/optimizedGet the compressed WebP image rendition.
POST/files/:id/linksCreate a five-minute signed link for one rendition.
POST/files/:id/retryRetry failed preview processing.
DELETE/files/:idDelete the logical file and release its allowance.
GET/usageRead workspace and tenant storage usage and limits.
GET/tenantsList tenants in your workspace.
PUT/tenants/:idSet a limit with {"limitBytes":100000000}; null removes the limit.

Limits and errors

Free storage is 3,000,000,000 bytes of originals. Automatic renditions are included. Uploads are limited to 25 MiB. Tenant limits apply inside the workspace allowance, including concurrent uploads.

Errors use {"error":{"code":"…","message":"…","requestId":"…"}}. Invalid keys return 401; unknown or other-tenant files return 404; pending previews return 409; unsupported renditions return 415; upload size or storage quotas return 413 with a specific error code. Respect Retry-After on 429, and include the request ID when asking for support.

This release uses one-file HTTP uploads and polling. Uploads do not yet support idempotency keys; avoid blindly retrying a request whose result is unknown. Resumable uploads, browser upload tokens, webhooks, AI jobs, and paid storage are later work.

Get an AI summary of Folio