Skip to content
WrongNotebook
ProductsPersonal BaaSDocumentationQuickstart
Sign inCreate workspace
Browse documentation

Start here

  • Quickstart
  • API keys and scopes

Working with data

  • Collections
  • Records
  • Filtering, sorting and paging
  • Schemas and validation
  • Files

Integrate

  • Webhooks
  • Recipes

Reference

  • Errors
  • Limits and rate limits

Start here

  • Quickstart
  • API keys and scopes

Working with data

  • Collections
  • Records
  • Filtering, sorting and paging
  • Schemas and validation
  • Files

Integrate

  • Webhooks
  • Recipes

Reference

  • Errors
  • Limits and rate limits
  1. WrongNotebook
  2. /
  3. Docs
  4. /
  5. Files

Files

Upload files to a collection, attach them to records, and hand out short-lived download links.

Records hold JSON. For images, PDFs and other binaries, upload a file and attach it to a record.

Needs files:write to upload and files:read to download.

Upload

Send multipart/form-data with a field named file:

Terminal
curl -s -X POST "$BAAS_URL/workspaces/$BAAS_WS/collections/todos/files" \
  -H "Authorization: Bearer $BAAS_KEY" \
  -F "file=@./receipt.pdf"
JavaScript
const form = new FormData();
form.append('file', fileFromInput); // a File or Blob

const res = await fetch(`${BASE}/workspaces/${WS}/collections/todos/files`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${KEY}` }, // do not set Content-Type yourself
  body: form,
});
const { data: uploaded } = await res.json();

Let fetch set the Content-Type for a FormData body. If you set it by hand the multipart boundary is lost and the upload fails.

Download

Files are private. You ask for a link and get one that expires shortly after:

Terminal
# metadata plus a short-lived signed URL
curl -s "$BAAS_URL/files/FILE_ID" -H "Authorization: Bearer $BAAS_KEY"

# or be redirected straight to the file
curl -sL "$BAAS_URL/files/FILE_ID/download" -H "Authorization: Bearer $BAAS_KEY" -o receipt.pdf

Because the link expires, generate it when someone asks rather than storing it in your database.

Attach a file to a record

A file belongs to a collection; attaching links it to one record in that collection.

Terminal
curl -s -X POST "$BAAS_URL/files/FILE_ID/attach" \
  -H "Authorization: Bearer $BAAS_KEY" -H "Content-Type: application/json" \
  -d '{"recordId":"01a12621-…"}'

curl -s -X POST "$BAAS_URL/files/FILE_ID/detach" -H "Authorization: Bearer $BAAS_KEY"

List a collection's files with GET …/collections/todos/files, and delete one with DELETE /v1/files/FILE_ID.

Erasing a record for good also removes the files attached to it.

Limits

One file10 MB

Storage is part of your deployment's setup, so the exact available space depends on how the backend was deployed.

Next steps

  • Records — the JSON side.
  • API keys — the files:read and files:write scopes.

View this page as Markdown — handy for copying into an editor or an AI assistant.

PreviousSchemas and validationNextWebhooks

On this page

  • Upload
  • Download
  • Attach a file to a record
  • Limits
  • Next steps
WrongNotebook

Personal BaaS is one focused product from WrongNotebook.

Documentation

  • All pages
  • Quickstart
  • Recipes
  • Errors

Product

  • Personal BaaS
  • All products
  • View the demo

Get started

  • Sign in
  • Create workspace

© 2026 WrongNotebook. All rights reserved.