Appbricx
Docs
FeaturesPricingStart free

Get started

OverviewWhat Appbricx isQuickstart with a coding agentQuickstart with the builderCore concepts

Guides

Data and tablesAccess and rolesBusiness rulesSign-inCustom screensRealtime and topicsWorkflows, schedules and webhooksServer functionsAI in your appPaymentsFilesMessagesIntegrationsVerifyPublishing, domains and rollbackOperating your appExport and self-hostSelf-host install

Tutorials

Build a booking app with Claude CodeMulti-user todo listClient portalSlack on new sign-upTemplates

Reference

Reference homeFrontend SDKHTTP APIMCP toolsCLIIntegrations catalogContract formatAI key resolutionRun Appbricx locally

Files API

Signed uploads into the project's object store, owner-scoped downloads and soft deletes.

4 endpointsHTTP API referenceGuide: Files

On this page
  1. Authentication
  2. Endpoints
  3. POST /files/sign
  4. POST /files/direct
  5. GET /files/:id
  6. DELETE /files/:id

Base URL: your app's origin ($APP_ORIGIN): the published host, a custom domain, or the platform origin for the builder preview. Errors answer { ok: false, error: { code, message } } unless noted. Add x-appbricx-env: dev or prod to pick the database explicitly; otherwise the host decides (preview means dev, a published host means prod).

Authentication

App key + signed-in user
A project key or preview token and a signed-in app session (header or cookie). Signed-out callers get 401. Authorization: Bearer $APP_KEYx-appbricx-app-session: $APP_SESSION

Endpoints

Sign an upload

POST/__appbricx/files/sign

Check type and size and mint a signed file id plus the URL to post the file to.

Auth
App key + signed-in user: Authorization: Bearer $APP_KEYx-appbricx-app-session: $APP_SESSION

Body

NameTypeDescription
mimerequiredstringimage/*, application/pdf, text/*, audio/*, video/*, JSON, ZIP, XML or Office types.
sizerequirednumberBytes (25 MB max by default).

Response

Response
{
  "ok": true,
  "fileId": "0e6f…",
  "uploadUrl": "/__appbricx/files/direct?fileId=0e6f…&sig=…&mime=image%2Fpng",
  "method": "POST"
}

Errors

StatusCodeWhen
401UNAUTHORIZEDMissing or invalid Authorization bearer ("Missing Authorization: Bearer <token>", "Invalid API key").
401noneNot signed in.
415MIME_NOT_ALLOWEDType not allowed.
400INVALID_SIZEsize missing or zero.
413TOO_LARGEOver the limit.
429(rate limit)Too many uploads.
curl
curl -X POST "$APP_ORIGIN/__appbricx/files/sign" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-app-session: $APP_SESSION" \
  -H "content-type: application/json" \
  -d '{"mime":"image/png","size":182044}'
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/files/sign`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-app-session": APP_SESSION,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "mime": "image/png",
    "size": 182044
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? data.error ?? res.statusText);

Relatedapp.upload

Source: services/api/src/routes/app-files.ts:157

Upload a file

POST/__appbricx/files/direct

multipart/form-data with a file field, to the uploadUrl from /files/sign (a direct post without the signature gets a fresh id).

Auth
App key + signed-in user: Authorization: Bearer $APP_KEYx-appbricx-app-session: $APP_SESSION

Query parameters

NameTypeDescription
fileIdoptionalstringFrom /files/sign.
sigoptionalstringFrom /files/sign.
mimeoptionalstringFallback type.

Body

NameTypeDescription
filerequiredFileThe file.

Response

Response
{
  "ok": true,
  "fileId": "0e6f…",
  "size": 182044,
  "mime": "image/png",
  "originalName": "avatar.png"
}

Errors

StatusCodeWhen
401UNAUTHORIZEDMissing or invalid Authorization bearer ("Missing Authorization: Bearer <token>", "Invalid API key").
400INVALID_MULTIPARTNot multipart.
400MISSING_FILENo file field.
415MIME_NOT_ALLOWEDType not allowed.
413TOO_LARGEOver the limit.
500STORAGE_ERRORObject store write failed.
500META_INSERT_FAILEDMetadata write failed (the object is removed).
curl
curl -X POST "$APP_ORIGIN/__appbricx/files/direct?fileId=0e6f%E2%80%A6&sig=%E2%80%A6" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-app-session: $APP_SESSION" \
  -F "file=@avatar.png"
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/files/direct?fileId=0e6f%E2%80%A6&sig=%E2%80%A6`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-app-session": APP_SESSION,
  },
  body: form, // const form = new FormData(); form.append("file", file);
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? data.error ?? res.statusText);

Relatedapp.upload

Source: services/api/src/routes/app-files.ts:192

Download a file

GET/__appbricx/files/:id

The file's bytes, if the session can see its metadata row. Images and PDF are served inline; anything else as an attachment, always with nosniff and a sandboxing CSP.

Auth
App key + signed-in user: Authorization: Bearer $APP_KEYx-appbricx-app-session: $APP_SESSION

Path parameters

NameTypeDescription
:idrequiredstringThe file id.

Query parameters

NameTypeDescription
envoptional"dev" | "prod"The environment the file was uploaded to (app.upload puts it in the URL).

Response

Response
<bytes> (content-type: image/png)

Errors

StatusCodeWhen
400INVALID_IDNot a uuid.
404NOT_FOUNDMissing, deleted, or not visible to this user.
curl
curl "$APP_ORIGIN/__appbricx/files/0e6f…?env=prod" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-app-session: $APP_SESSION"
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/files/0e6f…?env=prod`, {
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-app-session": APP_SESSION,
  },
});
const text = await res.text();

Source: services/api/src/routes/app-files.ts:248

Delete a file

DELETE/__appbricx/files/:id

Soft-delete a file the user owns.

Auth
App key + signed-in user: Authorization: Bearer $APP_KEYx-appbricx-app-session: $APP_SESSION

Path parameters

NameTypeDescription
:idrequiredstringThe file id.

Response

Response
{
  "ok": true
}

Errors

StatusCodeWhen
400INVALID_IDNot a uuid.
500DB_ERRORThe metadata update failed.
curl
curl -X DELETE "$APP_ORIGIN/__appbricx/files/0e6f…" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-app-session: $APP_SESSION"
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/files/0e6f…`, {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-app-session": APP_SESSION,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? data.error ?? res.statusText);

Source: services/api/src/routes/app-files.ts:304

On this page

  1. Authentication
  2. Endpoints
  3. POST /files/sign
  4. POST /files/direct
  5. GET /files/:id
  6. DELETE /files/:id
Appbricx

The backend, runtime and hosting for apps your coding agent builds. On our cloud, in yours, or on your own servers.

Features

Coding agents and MCPVerify testingBuilder consolePostgres databaseData APIRealtimeRow-level securitySign-in and authPaymentsWorkflows and jobsAI in your appIntegrationsBackups and rollbackHosting and domainsSelf-host and exportAll features

Product

ShowcasePricingFor coding agentsTemplatesPrivate cloudBring your own AI keyFAQ

Compare

Appbricx vs SupabaseLovable alternativeBolt alternativeFor freelancersFor agencies

Resources

DocumentationReferenceBlogSupportContact

© 2026 Appbricx. All rights reserved.

TermsPrivacyCookiesAcceptable Use