DELETE
Remove files from a directory (folder)
Request · Response · Guide: Folders
To delete a file, use DELETE /v1/files.Path Parameters:
  • directoryId (required): The directory to detach the files from
Request Body:
  • fileIds (string[], required): Ids of files to detach. At least 1, at most 100. Repeated ids are collapsed.
Response: Every id you send is returned in exactly one of two arrays:
  • removed: detached by this request
  • notAttached: not attached to this directory when the request ran
Notes:
  • The endpoint is safe to retry. Detaching a file that is already detached reports it as notAttached and is not an error.
  • Directories that have a workflow are rejected with a 422, and so are their immediate subfolders. Advancing a workflow on detach is not supported yet.
  • A file that is a workflow result in this directory is rejected with a 422 naming the file ids; nothing in the request is detached.
  • directoryId is echoed back in canonical lowercase form regardless of the case you send.

Authorizations

x-api-key
string
header
required

API key for authentication

Headers

Idempotency-Key
string

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

directoryId
string
required

Body

application/json
fileIds
string[]
required

Ids of files to detach from the directory, at most 100 per request. Repeated ids are collapsed. An id that is not attached is reported in notAttached rather than failing the request.

Required array length: 1 - 100 elements
Example:

Response

The detach request was processed. Check removed and notAttached for the per-file outcome.

directoryId
string
required

The directory the documents were detached from.

Example:

"649e2d2d2d2d2d2d2d2d2d2d"

removed
string[]
required

Ids detached from the directory by this request.

Example:
notAttached
string[]
required

Ids that were not attached to this directory when the request ran — unknown, deleted, in another workspace, or simply never attached. Not an error, which makes the endpoint safe to retry.

Example: