What this call does
Attaches one or more files to a business document that already exists, the signed delivery note as a PDF, a photo of damaged goods, the scanned invoice.
Last updated: 15.05.2026
What you need first
- A valid API key in the
API-Keyheader, and yourcompanyAccountId. - The
businessDocumentId, theidfield from Search business documents. - Per file either an address CATHAGO can fetch (
documentUrl) or the file itself (fileInBytes).
Parameters
Parameter | Required | Default | Meaning |
|---|---|---|---|
| Yes | none | In the path after |
| Yes | none | Your company ID, in the address line. |
The fields
The data packet is a list; each entry is one file. The example shows both ways: once through an address, once with the file itself.
Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
| text | One of the two | (none) | An address CATHAGO can fetch without logging in. A link inside your own network will not work. |
| text | One of the two | (none) | The file itself, as a Base64 string. |
| text | No | (none) | File name with extension. |
| choice | No | (none) |
|
| text | No | (none) | Your own number for this file, handed straight back. |
fileInBytes wins. Send neither and the entry is dropped in silence: the call returns 200 and the file never appears. There is no attachmentType field to send.What you get back
200 OK with the document's whole file list, not just the files you added, pick out your new ones by externalId. Each entry carries id, externalId, documentId, url, fileName, attachmentType, createdAt and lastModifiedAt. Anything empty is left out.
id is the attachment's CATHAGO ID and the only value Remove files from a business document accepts, not externalId (your own number), not documentId (the file's ID in the file store). url is where the file now lives; attachmentType is set by CATHAGO, with values such as PDF, INVOICE and ORDER_DELIVERY_NOTE.Common mistakes
What you see | Why | What to do |
|---|---|---|
| The | Fetch the ID with Search business documents. |
| Key missing, wrong, or not entitled to that | Check the key and the company. |
| The entry had neither | Send one of the two. |
The file never arrives from | The address needs a login, or is only reachable inside your network | Open it in a private browser window with no session. If it does not open there, CATHAGO cannot fetch it either. |
The delete call does not find the attachment | The | Only |
The same file is attached twice | Nothing checks | Check |
What we could not confirm
- The largest file
fileInByteswill carry. Nothing here caps it, so a very large file can still be refused for its size. Serving big files throughdocumentUrlavoids the question.
Adresse
POST https://api.cathago.de/v3/api/gateways/integration/documents/:documentId/attachments?companyAccountId=<companyAccountId>Beispielaufruf
curl -X POST '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 '[
{
"externalId": "ANH-2026-018223-3",
"documentUrl": "https://erp.weber-bau.de/belege/lieferschein-LS-2026-009914.pdf",
"documentName": "lieferschein-LS-2026-009914.pdf",
"documentFormat": "PDF"
},
{
"externalId": "ANH-2026-018223-4",
"fileInBytes": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQ==",
"documentName": "schadensfoto-matte-01.jpg",
"documentFormat": "JPG"
}
]'Beispiel für den Body
[
{
"externalId": "ANH-2026-018223-3", // Optional. Your own number for the file, handed straight back
"documentUrl": "https://erp.weber-bau.de/belege/lieferschein-LS-2026-009914.pdf", // Send this OR fileInBytes. Must be reachable without logging in
"documentName": "lieferschein-LS-2026-009914.pdf", // Optional. File name with extension
"documentFormat": "PDF" // Optional. PDF, DOC, DOCX, JPEG, JPG, PNG, CSV, XLSX, XLS, XML, JSON, DAT, WDA
},
{ // Second entry - the file itself instead of an address
"externalId": "ANH-2026-018223-4",
"fileInBytes": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQ==", // Send this OR documentUrl. The file as Base64, shortened here
"documentName": "schadensfoto-matte-01.jpg",
"documentFormat": "JPG"
}
]Beispielantworten
Add files in document
Status: 200 OK
[
{
"externalId": "<string>",
"documentId": "<string>",
"url": "<string>",
"fileName": "<string>",
"attachmentType": "<string>",
"id": "<string>",
"createdAt": "<2025-12-02T04:56:10.270Z>",
"lastModifiedAt": "<2025-12-02T04:56:10.270Z>"
}
]