Upload a document to a project (REST multipart)
Uploads a document via REST multipart/form-data, no MCP connection required. Streams the file bytes in the request body; the route validates type, size, and magic bytes, stores the file in Supabase Storage, and registers a documents row, returning a durable documentId.
Does NOT trigger analysis. Call POST /api/agent/projects/{id}/audit-analysis/async (or the MCP audity_enqueue_document_analysis tool) once documents are uploaded.
Cost: 0 credits, this is a free write.
Feature gates: both the agent-api and agent-document-upload flags must be enabled for the caller, otherwise 403 FEATURE_NOT_AVAILABLE.
Requires: the write scope on PATs.
Size limits: 10MB per file, 25MB for .pptx presentations.
Authorizations
A Personal Access Token issued from https://app.auditynow.com/dashboard/settings/api-tokens. Format: aky_<32 random chars>.
Headers
Byte length of the multipart body. Validated before the body is parsed: missing or non-positive returns 411; a value over the absolute body cap (25MB + multipart overhead) returns 413.
x >= 1Optional client-supplied key for safe retries. A random UUID is generated server-side if omitted.
Path Parameters
The project's UUID.
Body
multipart/form-data parts for POST /api/agent/projects/{id}/documents.
The file to upload. Allowed types: PDF, Word (.doc/.docx), plain text, Markdown, audio (.mp3/.wav/.m4a), images (.png/.jpg/.jpeg/.webp), spreadsheets (.csv/.xlsx/.xls), presentations (.pptx), XML, and email (.eml). Max 10MB per file, 25MB for .pptx.
Document category. Defaults to audit if omitted.
audit, supporting Optional free-text department label.

