What this call does
Removes attached files from a framework contract, and deletes the stored files behind them.
Last updated: 15.05.2026
What you need first
A valid API key in the API-Key header, your companyAccountId, the CATHAGO id of the contract, and the attachment ids, the id of each entry in the contract's attachments, read from Show one contract or from the answer of Add extra files to a contract. They are not the documentId.
Parameters
Parameter | Required | Default | Meaning |
|---|---|---|---|
| Yes | none | In the address line. The CATHAGO id of the contract. |
| Yes | none | In the address line. Required, but not checked against the contract. |
The fields
The request is a plain list of text ids, not a list of objects.
Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
(each entry) | text | Yes | none | One attachment |
contractFileDocumentId and CATHAGO also clears the main contract file: contractFileDocumentId, contractFilePublicUrl and contractFileName are emptied and the file is deleted. It is easy to trigger by accident when a list of document ids is pasted in by mistake.What you get back
204 No Content with an empty body. You get 204 whether ids were removed or none of them matched, so the status code alone does not tell you anything happened.
The stored file behind each removed attachment is deleted too, unless another attachment on the same contract still points at the same documentId, in which case the file is kept. To confirm what happened, call Show one contract afterwards and look at attachments.
Common mistakes
What you see | Why | What to do |
|---|---|---|
| The ids sent were | Read |
The main contract file disappeared too | The contract's | Send only attachment ids. Re-attach the file with Set the main contract file. |
| The contract id does not exist; there is no | Use the CATHAGO |
| The body is not a plain list of quoted ids, or the | Send quoted ids only, without comments. Check the |
The file is still reachable at its old address | Deleting the stored file failed, and that failure is swallowed, so you still got | Retry, and raise it with your CATHAGO contact if it persists. |
Adresse
DELETE https://api.cathago.de/v3/api/gateways/integration/contracts//attachments?companyAccountId=<companyAccountId>Beispielaufruf
curl -X DELETE 'https://api.cathago.de/v3/api/gateways/integration/contracts//attachments?companyAccountId=<companyAccountId>' \
-H 'API-Key: <Ihr API-Schlüssel>' \
-H 'Content-Type: application/json' \
-d '[
"CqB2605151902334471",
"CqB2605151902334472"
]'Beispiel für den Body
[
"CqB2605151902334471", // An attachment id, NOT a documentId. Read it from attachments[].id on Show one contract
"CqB2605151902334472" // Second attachment - list as many as you like. Ids that match nothing are ignored
]Beispielantworten
Example 1, remove 2 attachments (204)
Status: 204 No Content
Example 2, remove 1 attachment (204)
Status: 204 No Content
Example 3, 404 contract not found
Status: 404 Not Found
{
"timestamp": "2026-05-15T09:26:00Z",
"status": 404,
"error": "Not Found",
"message": "Contract not found for ID: does-not-exist"
}