StrataDocs

Files

Upload a binary document to Strata and download it back by ID. Uploads are ephemeral: each file is stored for 24 hours, then deleted automatically. Files are bound to the organization that issued the API key — a key from another org can never read them.

Note

Uploads are capped at 25 MB per file and expire 24 hours after upload. Re-upload if you need the bytes again after expiry.

Authentication

Both endpoints require a Bearer API key with the files scope. The key format is sk_strata_live_... in production (sk_strata_test_... on non-production). See Authentication for how an admin mints and rotates keys.

Note

Errors follow RFC 7807 and are returned as application/problem+json with type, title, and status fields — not a bare error object.

File types

The upload endpoint does not restrict content types — any file up to 25 MB is accepted. The original MIME type you send is preserved and returned on download via the Content-Type header. If the file is later rebuilt from disk (after a server restart), Strata infers the MIME type from the extension and falls back to application/octet-stream for unknown extensions.

Common types include PDF, DOCX, XLSX, PPTX, CSV, JSON, TXT, PNG, and JPG.

POST /v1/files

Upload a file. Returns a file_id you can pass to the document-generation endpoints or download later.

Headers

HeaderRequiredDescription
AuthorizationYesBearer sk_strata_live_... with the files scope.
Content-TypeYesmultipart/form-data with boundary.

Body

Multipart form data with a single field.

FieldTypeRequiredDescription
filebinaryYesThe file to upload. Max 25 MB.

Example request

curl -X POST https://app.strata.kronisys.com/v1/files \
  -H "Authorization: Bearer sk_strata_live_..." \
  -F "file=@quarterly-report.pdf"

Example response

{
  "file_id": "9f1c2e7a-3b4d-4e5f-8a90-1b2c3d4e5f60",
  "name": "quarterly-report.pdf",
  "size": 482914,
  "mime_type": "application/pdf",
  "expires_at": "2026-06-25T14:22:08.000Z",
  "download_url": "/v1/files/9f1c2e7a-3b4d-4e5f-8a90-1b2c3d4e5f60"
}

Errors

StatusSlugWhen
400invalid_requestThe request was not multipart/form-data with a single file field.
401missing_token / invalid_tokenAPI key is missing, invalid, expired, or revoked.
403insufficient_scopeThe key lacks the files scope.
413payload_too_largeFile exceeds the 25 MB upload limit.

GET /v1/files/:id

Download the original file bytes. The response uses the Content-Type from upload. The id must be a valid UUID.

Headers

HeaderRequiredDescription
AuthorizationYesBearer sk_strata_live_... with the files scope.

Example request

curl -X GET https://app.strata.kronisys.com/v1/files/9f1c2e7a-3b4d-4e5f-8a90-1b2c3d4e5f60 \
  -H "Authorization: Bearer sk_strata_live_..." \
  -o quarterly-report.pdf

Example response

The response body is the raw file. Notable response headers:

Content-Type: application/pdf
Content-Length: 482914
Content-Disposition: attachment; filename="quarterly-report.pdf"

Errors

StatusSlugWhen
404not_foundThe file ID is malformed, does not exist, belongs to a different org, or has expired.
403insufficient_scopeThe key lacks the files scope.

What you can do with an uploaded file

Today the only thing the API does with an uploaded file_id is hand the bytes back on GET /v1/files/:id. Use it as ephemeral, org-scoped storage — for example, stage a file from one process and download it from another within the 24-hour window.

Warning

Uploaded API files are not yet wired into the other /v1 endpoints. POST /v1/chat has no file_ids parameter, and the document generators take a full JSON spec rather than a file_id — to embed an image in a generated file, pass it inline as a data: URI or a public https:// URL in the spec, not as an uploaded file reference. To analyze a document in chat from the web app, upload it directly in the chat composer.

Related