What this call does

Removes one or more files from a business document, an order, delivery note or invoice. The document itself stays.

Last updated: 15.05.2026

Careful, the file is deleted, not just unlinked. It is taken off the document and removed from CATHAGO's file store. There is no restore. Download anything you might still need first.

What you need first

  • A valid API key in the API-Key header, and your companyAccountId.
  • The businessDocumentId, from Search business documents.
  • The attachment id values, the id of each entry under attachedFiles in Search business documents, or the id in the answer of Attach files to a business document.

Parameters

Parameter

Required

Default

Meaning

businessDocumentId

Yes

none

In the path after /documents/. The CATHAGO ID of the document.

companyAccountId

Yes

none

Your company ID, in the address line.

The fields

Field

Type

Required

Default

Meaning

attachmentIds

list of text

Yes

none

The id values of the attachments to remove. One or more.

It must be id, not the externalId (your own number) and not the documentId (the file's ID in the file store). An ID that does not belong to this document is skipped without a word. Leaving attachmentIds out on a document that has attachments fails with 500 Internal Server Error.

What you get back

204 No Content, an empty answer with no text at all. If you see nothing, the call went through. It does not say how many attachments were removed; to check, call Search business documents with this document's ID in ids and read attachedFiles.

Common mistakes

What you see

Why

What to do

404 Not Found

The businessDocumentId does not exist

Fetch the ID with Search business documents.

401 Unauthorized

Key missing, wrong, or not entitled to that companyAccountId

Check the key and the company.

500 Internal Server Error

attachmentIds missing on a document that has files

The field is required. Send at least one ID.

204 but the attachment is still there

The IDs were externalId or documentId values, or belong to another document

Read the id values out of attachedFiles for this document.

The file is gone from your own links too

The file is deleted from storage, not only unlinked

Expected. Download first if you need a copy.

Adresse

HTTP
DELETE https://api.cathago.de/v3/api/gateways/integration/documents/:documentId/attachments?companyAccountId=<companyAccountId>

Beispielaufruf

Terminal
curl -X DELETE 'https://api.cathago.de/v3/api/gateways/integration/documents/:documentId/attachments?companyAccountId=<companyAccountId>' \
  -H 'API-Key: <Ihr API-Schlüssel>' \
  -H 'Content-Type: application/json' \
  -d '{
  "attachmentIds": [
    "C0625051306220422",
    "C0625051306691163"
  ]
}'

Beispiel für den Body

JSON
{
    "attachmentIds": [                              // Required. The id values from attachedFiles. Not externalId, not documentId
        "C0625051306220422",                        // The id of the first attachment to remove
        "C0625051306691163"                         // As many more as you like. An id not on this document is skipped without a word
    ]
}

Beispielantworten

Delete files from document

Status: 204 No Content