/v1/site/{id}/file and require the
scopes siteFile:read (reads) or siteFile:write (uploads and deletes).
A key with site:read also has siteFile:read, and site:write also has
siteFile:write.
Listing files
uploadedBy is null for files uploaded through this API — an API key is not a user, so
there is nobody to attribute the upload to.
Downloading a file
GET /v1/site/{id}/file/{fileId} returns the same metadata plus a downloadUrl:
Uploading a file
Uploads take three calls. The bytes go straight to storage rather than through this API, which is what lets them exceed the API’s 10 MB request limit. There is no single-call upload endpoint, for files of any size.1
Ask for an upload URL
fileKey — step 3 needs it.2
PUT the bytes to that URL
Content-Type header must match the contentType you sent in step 1, or the
upload is rejected. Do not send your API key to this URL. uploadUrl expires after 5
minutes; if it lapses, start again from step 1.3
Register the file
201 with the file, which now appears in the portal. Pass "pinned": true to
pin it to the top of the site’s file list.size and contentType are read back from storage, not taken from this request, so
you cannot register a file that misreports either. If the upload in step 2 did not
complete, this call returns 422 UPLOAD_NOT_FOUND — retry step 2 with the same
uploadUrl (or start over from step 1 if it has expired), then call this again.Extracted text
Text extracted from a file has its own endpoint, so that list and get responses stay small even when a document runs to megabytes:Expect
content to be null most of the time. Text is extracted lazily — the first time
someone auto-fills site documentation for that site — and only from plain-text and PDF
files. Images and other formats always return null.Deleting a file
204 with no body.
Errors
A site or file belonging to another organization returns
404, not 403 — the API never
confirms that a record you cannot access exists.