Delete an attachment
DELETE/attachments/:id
Deletes the attachment row and its stored bytes. Requires scope finance.attachments.write. Returns 409 (CONFLICT, with per-entity link counts in details) when the file is still linked to any payable / receivable / transaction — unlink it first via DELETE /attachments/{id}/links. Also 409 (details.receipts) when the file is a payment receipt's document: there is no unlink for that, delete the receipt instead and the file goes with it. Calling DELETE twice returns 200 then 404.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 429
- 500
Attachment deleted.
Missing / invalid / expired / revoked token.
Token lacks the finance.attachments.write scope.
Attachment not found within the tenant.
The attachment is still linked to one or more records, or is a payment receipt's document (details carries the counts).
Rate limit exceeded for this token. Reads and writes have separate budgets, both on a 1-hour sliding window. The response carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and Retry-After — wait out Retry-After rather than retrying immediately.
Unhandled server error.