standards
Files and documentsConcepts

Files and documents

Upload a file, attach it to a record as a document, and know which tool does each step.


A file is an uploaded blob: bytes plus a name, a MIME type and a size. A document is a title over an ordered pack of files, always attached to one record. There are no slots: a document attribute on an object only says what the pack accepts.

Upload a file

POST /files/upload takes multipart/form-data with the bytes in the files field, up to 10 files per request and 50 MiB per file. The MIME type, the extension and the file signature are checked before anything is stored; a mismatch is a 400.

curl https://api.standards.new/v1/files/upload \
  -H "Authorization: Bearer $STANDARDS_API_KEY" \
  -F "[email protected]"

The answer is an array of file objects with id, name, mimeType and size. Files are private. GET /files/:id/url returns a signed URL that expires after one hour; request a fresh one each time you need it.

Group files into a document

A document attribute on an object constrains its pack with accepts (MIME globs, exact types or extensions) and maxFileSize. A file the attribute refuses is DOCUMENT_MIME_NOT_ACCEPTED. See SDK / Relations and documents.

POST /records/:object/:id/documents/attach uploads one file and creates the document in one multipart call. It checks update on the object, not a file permission. Pass attributeName to choose the attribute (default attachments), title for the document, or documentId to append to an existing pack.

curl https://api.standards.new/v1/records/contacts/$RECORD_ID/documents/attach \
  -H "Authorization: Bearer $STANDARDS_API_KEY" \
  -F "[email protected]" \
  -F "attributeName=identityDocument" \
  -F "title=Passport"

GET /records/:object/:id/documents lists a record's documents grouped by attribute. GET /documents/:id/content returns the extracted text of the whole pack, ready for an LLM.

Drives

A drive is the folder tree a record's documents live in. Drives are records of the native drives object, so POST /records/drives creates one and every record route works on it: filters, search, permissions. A drive is shared or private through record visibility, exactly like any record; a private drive you cannot see answers the same 404 as a missing id.

Which tool uploads

The SDK has no file API. Upload with one of these:

  • CLI: standards records attach-document <object> <id> --file ./contract.pdf --attribute contracts. See CLI / Documents and files.
  • MCP: the attach_file tool. See MCP / Tools.
  • REST: POST /files/upload then POST /documents/attach with the fileId, or the one-call record attach above.

Next steps