Attach existing files to a directory (folder)
Attach files that already exist in the workspace to a directory, without re-uploading them.
More details
More details
directoryId(required): The directory to attach the files to
fileIds(string[], required): Ids of existing files to attach. At least 1, at most 100. Repeated ids are collapsed.
created: newly attached by this requestconflicted: already attached before this requestrejected: not resolvable by this API key
- The endpoint is safe to retry. Re-attaching a file reports it as
conflictedand creates no duplicate. - An id in
rejectedmay be unknown, deleted, or owned by another workspace. The cases are not distinguished. - Attaching to several directories is one call per directory, each authorised on its own.
- Directories that have a workflow are rejected with a 422, and so are their immediate subfolders — a file added to a subfolder drives the parent folder’s workflow. Deeper descendants are unaffected, since a workflow further up is not driven by the attach. Advancing a workflow on attach is not supported yet, and attaching without it would leave the folder in a half-applied state.
directoryIdis echoed back in canonical lowercase form regardless of the case you send.
Authorizations
API key for authentication
Headers
Optional opaque key (max 255 chars, UUIDv4 recommended) making this request idempotent for 24h: a retry with the same key and body replays the original response with Idempotent-Replayed: true.
Path Parameters
Body
Ids of existing files to attach, at most 100 per request. Repeated ids are collapsed. An id this key cannot see is reported in rejected rather than failing the request.
1 - 100 elementsResponse
The attach request was processed. Check created, conflicted and rejected for the per-file outcome — a response where every id is rejected is still a 201.
The directory the documents were attached to.
"649e2d2d2d2d2d2d2d2d2d2d"
Ids newly attached to the directory by this request.
Ids already attached before this request. Re-attaching is not an error and creates no duplicate row, which makes the endpoint safe to retry.
Ids this API key cannot resolve — unknown, deleted, or belonging to another workspace. The three cases are deliberately not distinguished: telling a caller that an id exists but is not theirs would leak another tenant's data.