Skip to main content
DELETE
/
v1
/
documents
/
{id}
Delete Document
curl --request DELETE \
  --url https://api.example.com/v1/documents/{id}

Request

Deletion is permanent. The document metadata row is removed, every entity link is detached, and the object-storage bytes are scheduled for deletion within 1 hour. Audit log entries are retained per the workspace’s retention policy.

Path Parameters

id
string
required
Document UUID.

Query Parameters

hard
boolean
default:"false"
When true, the object storage file is deleted immediately rather than scheduled. Requires the admin:documents permission.

Headers

Authorization: Bearer wbk_your_api_key_here
Idempotency-Key
string
Optional UUID. Repeated DELETEs with the same key return the same result without erroring.

Response

On success returns HTTP 204 No Content. Standard rate-limit headers and X-Request-ID are present.
curl -X DELETE \
  https://data.leadlex.com/functions/v1/api-gateway/v1/documents/doc_01HY1 \
  -H "Authorization: Bearer wbk_your_api_key_here" \
  -i

Example Response

HTTP/1.1 204 No Content
X-Request-ID: req_01HY1K0E7V8Q0YXH7DSTX5B3CA

Errors

StatusCodeDescription
401invalid_keyInvalid or expired API key
403insufficient_permissionsMissing write:documents (or admin:documents when hard=true)
404not_foundDocument not found
409in_useDocument is referenced by a workflow or template and cannot be deleted
429rate_limitedRate limit exceeded