Files

/api/files

Upload, list, download, and delete files attached to projects. Files are scoped to project revisions.

Endpoints

GET /api/files/projects/:projectId/list

List files uploaded to a project

Required permission: project:download

Optional permissions (unlock additional behaviour): project:download:view, project:download:edit, project:download:admin

Parameters
NameInTypeDescription
revisionIdqueryintegerProject revision ID for historical file list. A past published revision (not the current one) also needs project:revision:view (403 otherwise).
documentTypequerystringFilter to one document type: drawing | submittal | rfi | specification | report | photo | other. Exact match on the stored type, not a keyword — any other value is rejected. This is how you answer "are there drawings on this project?" without pulling the whole file list. Accepts document_type as well.
statusquerystringFilter to one review status: draft | review | approved | obsolete. Exact match; any other value is rejected. Use it before citing a document as current — an obsolete file lists exactly like an approved one otherwise.
tagquerystringReturn only files carrying this tag. Whole-tag match (not a substring), and only one tag per call.
folderIdqueryintegerReturn only files filed directly in this folder. The literal string "null" returns only files at the project root. Accepts folder_id as well. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result.
mimeTypequerystringFilter by stored MIME type (e.g. application/pdf). Accepts mime_type as well. This filters on the RECORDED type, so a mislabelled upload will not match what its extension suggests. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result.
fileNamequerystringMatch on the file NAME only, unlike search, which also matches the description. Accepts file_name as well. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result.
searchquerystringCase-insensitive substring match on the file NAME or DESCRIPTION (it does not read file contents). Use it rather than listing every file and scanning: a project with many files can overrun the context budget, and the truncated list you get back looks exactly like a complete one.

GET /api/files/projects/:projectId/download/:fileId

Download a project file, always as an attachment. RESPONDS WITH A 302 REDIRECT, not the bytes: object storage serves the file directly, so your client MUST follow redirects (curl -L, or fetch with redirect:"follow" — which is its default). A client that does not will receive a short text/plain redirect stub with a 3xx status and no file content. The redirect target is a presigned URL that needs no SynC credentials and expires in 120 seconds (STORAGE_SIGNED_URL_TTL); treat it as a bearer capability for that window — do not log it or pass it on. On a local-disk deployment the bytes are streamed directly with a 200 instead, so handle both. A file id of another project is the same 404 "File not found." unless you could see that file in its own project (its permission level, and a revision you may read there); then 400 "File does not belong to the specified project."

Required permission: project:download

Optional permission (unlock additional behaviour): project:admin

POST /api/files/projects/:projectId/upload

Upload files to a project. Supports multipart form data. Auto-detects current draft revision if project_revision_id is omitted. The new file joins the open draft; with no open draft the upload is refused with 409 "Open a draft of this project to change its files." (code PROJECT_DRAFT_REQUIRED) and nothing is stored. The file TYPE is restricted to a fixed allowlist, and is checked against the file CONTENT, not just the declared Content-Type — see allowedMimeTypes and the notes below.

Required permission: project:upload

Optional permissions (unlock additional behaviour): project:upload:view, project:upload:edit, project:upload:admin

Request body (JSON)

Required
Optional

Each file must be one of allowedMimeTypes, and its CONTENT must match the type it is sent as: the declared Content-Type is only the first gate, and the bytes are then read and compared against it. A text file sent as application/pdf is refused with a 400, as is any file whose type cannot be confirmed. Send the real type. The exceptions are the formats with no detectable signature — text/csv, application/dxf, application/x-dwg and image/svg+xml — which are instead checked for structure: they must NOT carry binary content, a .dwg must carry its AC-version stamp, and an SVG must have an <svg> root and no scripting (a <script> element, an inline event handler, a javascript: URL or an entity declaration is a 400, because an SVG is active content). A zero-byte file is accepted. Multi-file requests are all-or-nothing: if any file fails, none are stored.

DELETE /api/files/projects/:projectId/:fileId

Delete a project file. The project must have an open draft (otherwise 409 "Open a draft of this project to change its files."), and a file a published revision holds is refused with 409 either way. Needs project:file:delete on the project. A file you may not download (an edit-level file needs project:upload, an admin-level one project:admin, on top of project:download; a file only in the draft needs draft rights) is a 404 "File not found.", as a missing one, before any other check. Then the status: an approved file also needs project:upload:edit, an obsolete one project:upload:admin (a 403 naming it in metadata.permission; nothing deleted). If the status changes between the check and the delete, 409 (code FILE_STATUS_CHANGED): read the file again and retry. A file id of another project is the same 404 "File not found." unless you could see that file in its own project (its permission level, and a revision you may read there); then 400 "File does not belong to the specified project."

Required permission: project:file:delete

Optional permissions (unlock additional behaviour): project:download, project:admin, project:upload, project:upload:edit, project:upload:admin

GET /api/files/projects/:projectId/folders

List the project's file folders, with their parent and sort order.

Required permission: project:download

POST /api/files/projects/:projectId/folders

Create a file folder in a project, optionally nested under an existing one. The project must have an open draft: otherwise 409 "Open a draft of this project to change its files." (code PROJECT_DRAFT_REQUIRED), and nothing is written.

Required permission: project:upload

Request body (JSON)

Required
Optional

PATCH /api/files/projects/:projectId/folders/reorder

Set the display order of a project's folders in one call. The project must have an open draft: otherwise 409 "Open a draft of this project to change its files." (code PROJECT_DRAFT_REQUIRED), and nothing is written.

Required permission: project:upload

Request body (JSON)

Required

Anything other than an array is a 400. Send the folders you want to reposition, not necessarily all of them.

PATCH /api/files/projects/:projectId/folders/:folderId

Rename, re-parent, or re-sort one folder. The project must have an open draft: otherwise 409 "Open a draft of this project to change its files." (code PROJECT_DRAFT_REQUIRED), and nothing is written.

Required permission: project:upload

Request body (JSON)

Optional

DELETE /api/files/projects/:projectId/folders/:folderId

Delete a folder. Its FILES ARE NOT DELETED — they are moved to the project root, so this reorganises rather than destroys. It moves every file in the folder and in its child folders, so it needs, beyond project:upload, project:upload:edit when any of them is approved and project:upload:admin when any is obsolete (a 403 naming it in metadata.permission; nothing deleted or moved). The project must have an open draft: otherwise 409 "Open a draft of this project to change its files." (code PROJECT_DRAFT_REQUIRED), and nothing is written.

Required permission: project:upload

Optional permissions (unlock additional behaviour): project:upload:edit, project:upload:admin

PATCH /api/files/projects/:projectId/:fileId/metadata

Update a file's document type, description, or tags. Does not touch the stored bytes. A file you may not download (an edit-level file needs project:upload, an admin-level one project:admin, on top of project:download; a file only in the draft needs draft rights) is a 404 "File not found.", as a missing one, before any other check. A file's status sets what this needs beyond project:upload: an approved file needs project:upload:edit, an obsolete one project:upload:admin (a 403 naming it in metadata.permission; nothing written). If the status changes between the check and the write, 409 (code FILE_STATUS_CHANGED): read the file again and retry. The project must have an open draft: otherwise 409 "Open a draft of this project to change its files." (code PROJECT_DRAFT_REQUIRED), and nothing is written. A file id of another project is the same 404 "File not found." unless you could see that file in its own project (its permission level, and a revision you may read there); then 400 "File does not belong to the specified project."

Required permission: project:upload

Optional permissions (unlock additional behaviour): project:upload:edit, project:upload:admin, project:download, project:admin

Request body (JSON)

Optional

Send only the fields you want to change; omitted fields are left alone. A body key this endpoint does not implement is a 400 naming it, NOT a silent no-op — so a misspelled or mis-cased field fails loudly rather than returning 200 with that field quietly dropped.

PATCH /api/files/projects/:projectId/:fileId/status

Move a file through its review lifecycle: draft → review → approved → obsolete. Any status may be set from any other (draft → approved directly, or back to draft), but each status carries its own permission and a move needs the permission of the status it moves to and of the status it leaves (body notes). A file you may not download (an edit-level file needs project:upload, an admin-level one project:admin, on top of project:download; a file only in the draft needs draft rights) is a 404 "File not found.", as a missing one, before any other check. Setting the status it already has is a 400, not a no-op. The project must have an open draft: otherwise 409 "Open a draft of this project to change its files." (code PROJECT_DRAFT_REQUIRED), and nothing is written. A file id of another project is the same 404 "File not found." unless you could see that file in its own project (its permission level, and a revision you may read there); then 400 "File does not belong to the specified project."

Required permission: project:upload

Optional permissions (unlock additional behaviour): project:upload:edit, project:upload:admin, project:download, project:admin

Request body (JSON)

Required

Permission per status: draft and review need project:upload; approved needs project:upload:edit; obsolete needs project:upload:admin. A move needs both ends: into approved from any status needs project:upload:edit, out of approved (to draft or review) too; into or out of obsolete needs project:upload:admin, and obsolete ↔ approved needs both. A missing one is a 403 naming it (metadata.permission), and the status is unchanged. If the status changes between the check and the write, the answer is 409 (code FILE_STATUS_CHANGED) and nothing is written: read the file again and retry.

PATCH /api/files/projects/:projectId/:fileId/move

Move a file into a folder, or to the project root. A file you may not download (an edit-level file needs project:upload, an admin-level one project:admin, on top of project:download; a file only in the draft needs draft rights) is a 404 "File not found.", as a missing one, before any other check. A file's status sets what this needs beyond project:upload: an approved file needs project:upload:edit, an obsolete one project:upload:admin (a 403 naming it in metadata.permission; nothing written). If the status changes between the check and the write, 409 (code FILE_STATUS_CHANGED): read the file again and retry. The project must have an open draft: otherwise 409 "Open a draft of this project to change its files." (code PROJECT_DRAFT_REQUIRED), and nothing is written. A file id of another project is the same 404 "File not found." unless you could see that file in its own project (its permission level, and a revision you may read there); then 400 "File does not belong to the specified project."

Required permission: project:upload

Optional permissions (unlock additional behaviour): project:upload:edit, project:upload:admin, project:download, project:admin

Request body (JSON)

Optional

GET /api/files/projects/:projectId/preview/:fileId

Stream a file for INLINE viewing rather than download. Same tiered permission ladder as the download route (a file marked edit- or admin-level needs project:upload or project:admin on top of project:download). Only known-safe types render inline; SVG, Office, CAD and archives are forced to download regardless. Like the download route, this RESPONDS WITH A 302 REDIRECT to a presigned object-storage URL that expires in 120 seconds and carries no SynC credentials — follow redirects, and treat the URL as a bearer capability. A local-disk deployment streams the bytes with a 200 instead. A file id of another project is the same 404 "File not found." unless you could see that file in its own project (its permission level, and a revision you may read there); then 400 "File does not belong to the specified project."

Required permission: project:download

Optional permissions (unlock additional behaviour): project:upload, project:admin

DELETE /api/files/projects/:projectId/revision/:revisionId/:fileId

Detach a file from a DRAFT project revision. If the file is attached to no other revision it is deleted outright, which the response reports as deletedFile:true — otherwise the earlier published revisions keep it. This is the revision-aware sibling of DELETE /projects/:projectId/:fileId, which removes the file from the project entirely. It is the one file-removing path that needs only project:draft:edit, not project:file:delete: it removes a file from the unpublished draft and purges it only when no other revision holds it. A file you may not download (an edit-level file needs project:upload, an admin-level one project:admin, on top of project:download) is a 404 "File not found.", as a missing one, before any other check. Then the status: an approved file also needs project:upload:edit, an obsolete one project:upload:admin (a 403 naming it in metadata.permission; nothing removed). If the status changes between the check and the removal, 409 (code FILE_STATUS_CHANGED): read the file again and retry. REQUIRES AN OPEN DRAFT: this change lands in the project's current unpublished draft. If the project has no open draft the call is rejected outright — check GET /api/projects/:id/revisions (a revision with is_draft true) and, if there is none, propose POST /api/projects/:id/draft/create first, then make this call. Opening a draft is its own user-approved change; never publish or revert a project to bring a draft into existence. A file id of another project is the same 404 "File not found." unless you could see that file in its own project (its permission level, and a revision you may read there); then 400 "File does not belong to the specified project."

Required permission: project:draft:edit

Optional permissions (unlock additional behaviour): project:download, project:upload, project:admin, project:upload:edit, project:upload:admin