What this call does

Attaches one or more further files to an existing framework contract, works certificates, price appendices, specifications.

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 one source per file.

Parameters

Parameter

Required

Default

Meaning

contractId

Yes

none

In the address line. The CATHAGO id of the contract.

companyAccountId

Yes

none

In the address line. Required, but not checked against the contract.

The fields

The request is a list. Each entry is one file, processed in the order you sent them. No field has a default.

Field

Type

Required

Meaning

externalId

text

No

Your own document number. Recommended: it is handed back in the answer, so you can reconcile.

documentId

text

one source

The file is already at CATHAGO. Loses to the two below.

documentUrl

text

one source

CATHAGO fetches the file itself, without a login and without VPN. Loses to fileInBytes. Best for very large files.

fileInBytes

text

one source

The file as base64 text. Wins over the other two.

documentName

text

No

File name CATHAGO stores and shows. Ignored with a documentId.

documentFormat

choice

with a URL or bytes

PDF, DOC, JPEG, JPG, PNG, DOCX, CSV, XLSX, XLS, XML, JSON, DAT, WDA. Without it the call fails with 500.

attachmentType

text

No

Free text, e.g. CERTIFICATE, APPENDIX, SPEC, SUPPORTING_DOC. Stored and shown exactly as sent, it is not a fixed list.

What you get back

200 OK with a list, in the order you sent them. Each entry has id (the attachment id: this is what Remove extra files from a contract wants, not documentId), your externalId, documentId, fileName, url (where the file can be fetched), attachmentType, createdAt and lastModifiedAt (2026-05-15T10:22:41.883Z). Attachments are added on top of whatever the contract already had; nothing is replaced.

An entry whose three source fields are all empty is dropped silently. No 400, no error entry, the answer simply has fewer rows than you sent, so 200 does not mean every file arrived. Count the rows and match them by externalId.

Common mistakes

What you see

Why

What to do

Fewer entries came back, or the answer is []

Those entries had all three sources empty and were dropped

Fill in exactly one source per entry, and reconcile by externalId.

The wrong file was attached

Two sources were filled in; the later one won

Send only one source per entry.

500, Contract not found for ID: …

The contract id does not exist; there is no 404 here

Use the CATHAGO id, not your externalId.

500 while storing, or a 0-byte file

documentFormat was missing, or the documentUrl could not be fetched and that failure is swallowed

Send documentFormat, and make the address reachable without a login or VPN.

401 Unauthorized, or 400 Bad Request

Key missing, unknown, disabled or expired; or the // comments are still in the body

Check the API-Key header. Remove the comments, see the start page.

Adresse

HTTP
POST https://api.cathago.de/v3/api/gateways/integration/contracts//attachments?companyAccountId=<companyAccountId>

Beispielaufruf

Terminal
curl -X POST '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 '[
  {
    "externalId": "ATT-DIN488-ZEUGNIS",
    "documentUrl": "https://erp.weber-bau.de/dokumente/din488-zeugnis.pdf",
    "documentName": "DIN-488-Werkszeugnis.pdf",
    "documentFormat": "PDF",
    "attachmentType": "CERTIFICATE"
  },
  {
    "externalId": "ATT-PREISANLAGE",
    "documentId": "C0626051233311345",
    "attachmentType": "APPENDIX"
  }
]'

Beispiel für den Body

JSON
[
    {
        "externalId": "ATT-DIN488-ZEUGNIS",         // Optional. Your own document number, handed back in the answer
        "documentUrl": "https://erp.weber-bau.de/dokumente/din488-zeugnis.pdf", // One source per file. Must be reachable without a login or VPN
        "documentName": "DIN-488-Werkszeugnis.pdf", // Optional. File name Cathago stores and shows
        "documentFormat": "PDF",                    // Required with documentUrl or fileInBytes. PDF, DOC, JPEG, JPG, PNG, DOCX, CSV, XLSX, XLS, XML, JSON, DAT, WDA
        "attachmentType": "CERTIFICATE"             // Optional. Free text, stored and shown exactly as sent
    },
    {                                               // Second entry - same fields as above
        "externalId": "ATT-PREISANLAGE",
        "documentId": "C0626051233311345",          // File already at Cathago, so only the id is given
        "attachmentType": "APPENDIX"
    }
]

Beispielantworten

Example 1, add 2 attachments (200 streamed)

Status: 200 OK

JSON
[
    {
        "id": "A-77731-1",
        "externalId": "ATT-INSPECTION-CERT",
        "documentId": "C0626051233311344",
        "fileName": "DIN-488-Cert.pdf",
        "url": "https://docs.cathago.de/contract-pdfs/C0626051233311344",
        "attachmentType": "CERTIFICATE",
        "createdAt": "2026-05-15T09:23:01Z"
    },
    {
        "id": "A-77731-2",
        "externalId": "ATT-PRICE-APPENDIX",
        "documentId": "C0626051233311345",
        "fileName": "Price-Appendix.pdf",
        "url": "https://docs.cathago.de/contract-pdfs/C0626051233311345",
        "attachmentType": "APPENDIX",
        "createdAt": "2026-05-15T09:23:02Z"
    }
]

Example 2, add 1 attachment by existing documentId (200)

Status: 200 OK

JSON
[
    {
        "id": "A-77731-9",
        "documentId": "C0626051233311349",
        "attachmentType": "SUPPORTING_DOC",
        "createdAt": "2026-05-15T09:25:00Z"
    }
]

Example 3, 404 contract not found

Status: 404 Not Found

JSON
{
    "timestamp": "2026-05-15T09:25:00Z",
    "status": 404,
    "error": "Not Found",
    "message": "Contract not found for ID: does-not-exist"
}