Skip to main content

Files

Host: https://file-service.<domain>. Allowed: users, tenant apps and backend services.

Upload​

POST/{folder}file-service

multipart/form-data with the file in the field file.

curl -s https://file-service.scenid.cloud/documents \
-H "Authorization: Bearer $TOKEN" \
-F "file=@./contract.pdf"

Response 201 with the file document, its url and, for images, variants.

  • folder is one path segment. Private files are stored under files/<tenant>/<folder>.
  • The tenant always comes from the token. You cannot upload into another tenant.
  • Images over 2 MB are rejected with 413 and an empty body. Other types have no size limit in multipart mode.
  • Same content (contentHash) in the same folder returns the existing file with 201, and a new file token. The earlier token stops working.
  • Any other failure returns 500 with an empty body. A missing or invalid Bearer token returns 401 with an empty body.

Areas​

The area is chosen by the upload path. Read the concept page for when to use which.

AreaUploadReadDelete
PrivatePOST /{folder}GET /{tenantId}/{folder}/{name}DELETE /{tenantId}/{folder}/{name}
ProtectedPOST /protected/{folder}GET /protected/{tenantId}/{folder}/{name}none
PublicPOST /public/{folder}GET /public/{tenantId}/{folder}/{name}none

Response​

201:

{
"_id": "…",
"name": "contract-aB3xYz.pdf",
"originalName": "contract.pdf",
"mimeType": "application/pdf",
"size": 48213,
"encoding": "7bit",
"folder": "documents",
"path": "documents/contract-aB3xYz.pdf",
"contentHash": "<sha256>",
"createdAt": "2026-09-30T08:12:44.000Z",
"createdBy": { "uid": "…", "displayName": "…" },
"url": "https://file-service.scenid.cloud/<tenant>/documents/contract-aB3xYz.pdf?token=<file token>",
"variants": {}
}
  • url is the address to read the file, including its file token (?token=). Public and protected uploads answer with the matching /public/… or /protected/… URL.
  • For images variants contains a URL per variant: original, x2048, x1024, x512 and the square avatar-x512, avatar-x256, avatar-x128, avatar-x32. All are WebP files, each with its own token.
  • File names are generated: <slugified original name>-<6 characters><extension>.

Raw upload (large files)​

POST /{folder}?mode=raw (private area only) takes the file as the request body, up to 500 MB.

HeaderDescription
x-filenameRequired. The file name. Without it the call fails with 500
Content-TypeThe file's type
curl -s "https://file-service.scenid.cloud/imports?mode=raw" \
-H "Authorization: Bearer $TOKEN" \
-H "x-filename: data.jsonl" \
-H "Content-Type: application/x-ndjson" \
--data-binary @data.jsonl

Raw uploads are not size-limited for images, and no variants are created. Response 201 as above with variants: {}.

Read​

GET/{tenantId}/{folder}/{name}file-service

Query: token (file token, required).

AreaAlso required
PrivateAuthorization: Bearer <token> of the same tenant
ProtectedQuery ufaToken=<user session token>. See the ufaToken
PublicNothing
curl -s -o contract.pdf \
-H "Authorization: Bearer $TOKEN" \
"https://file-service.scenid.cloud/$TENANT_ID/documents/contract-aB3xYz.pdf?token=$FILE_TOKEN"

Answers 200 with the file. The Content-Type follows the file extension. No cache headers are set.

StatusCause
401 permission-deniedWrong tenant, or missing or wrong file token (private)
401 emptyMissing or invalid Bearer token (private)
404Unknown file (private)

Delete​

DELETE/{tenantId}/{folder}/{name}file-service

Private area only. Requires the Bearer token of the same tenant and ?token=<file token>. Answers 204.

Deletes only that file. Image variants are separate files and stay.

curl -s -X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://file-service.scenid.cloud/$TENANT_ID/documents/contract-aB3xYz.pdf?token=$FILE_TOKEN"