What this call does

Stores or replaces the signed contract file on one existing framework contract.

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 for the 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

No field has a default. Fill in exactly one source; fill in more and the later one in the order documentId → documentUrl → fileInBytes wins.

Field

Type

Required

Meaning

documentId

text

one source

The file is already at CATHAGO.

documentUrl

text

one source

CATHAGO fetches the file itself. The address must be reachable without a login and without VPN.

fileInBytes

text

one source

The file as base64 text.

documentName

text

No

The file name CATHAGO stores and shows. Ignored with a documentId, the stored file keeps its own name.

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. Ignored with a documentId.

What you get back

200 OK with the whole contract, now carrying contractFileDocumentId, contractFilePublicUrl and contractFileName. Calling this again replaces the pointer on the contract; the file it used to point at is not deleted.

With none of the three source fields filled in you get 200 OK and an empty body. The contract is untouched. There is no 400 here, so check that the answer really contains a contractFileDocumentId.

Common mistakes

What you see

Why

What to do

200 OK with an empty body

All three source fields were empty

Fill in exactly one of them.

200 OK but the wrong file arrived, or documentName was ignored

Two sources were filled in and the later one won; or a documentId was passed, and that file keeps its own name

Send one source. Use documentUrl or fileInBytes to control the name.

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//contract-file?companyAccountId=<companyAccountId>

Beispielaufruf

Terminal
curl -X POST 'https://api.cathago.de/v3/api/gateways/integration/contracts//contract-file?companyAccountId=<companyAccountId>' \
  -H 'API-Key: <Ihr API-Schlüssel>' \
  -H 'Content-Type: application/json' \
  -d '{
  "documentId": "C0626051233311343",
  "documentUrl": null,
  "fileInBytes": null,
  "documentName": "Rahmenvertrag-Betonstahl-2026.pdf",
  "documentFormat": "PDF"
}'

Beispiel für den Body

JSON
{
    "documentId": "C0626051233311343",              // One source per file. This file is already at Cathago, so only its id is given
    "documentUrl": null,                            // Left empty on purpose: documentId is used here. Filling it in would silently win
    "fileInBytes": null,                            // Left empty on purpose: documentId is used here. Filling it in would beat both other sources
    "documentName": "Rahmenvertrag-Betonstahl-2026.pdf", // Optional. Only takes effect with documentUrl or fileInBytes
    "documentFormat": "PDF"                         // Required with documentUrl or fileInBytes. PDF, DOC, JPEG, JPG, PNG, DOCX, CSV, XLSX, XLS, XML, JSON, DAT, WDA
}

Beispielantworten

Example 1, set master PDF by inline bytes (200)

Status: 200 OK

JSON
{
    "id": "C12260512895327",
    "externalId": "ERP-PO-77831",
    "name": "Logistic contract",
    "status": "DRAFT",
    "contractFileDocumentId": "C0626051233311343",
    "contractFilePublicUrl": "https://docs.cathago.de/contract-pdfs/C0626051233311343",
    "contractFileName": "Steel-2026-Q2_Master.pdf"
}

Example 2, set master PDF by remote URL (200)

Status: 200 OK

JSON
{
    "id": "C12260512895327",
    "contractFileDocumentId": "C0626051233311343",
    "contractFilePublicUrl": "https://docs.cathago.de/contract-pdfs/C0626051233311343",
    "contractFileName": "Steel-2026-Q2_Master.pdf"
}

Status: 200 OK

JSON
{
    "id": "C12260512895327",
    "contractFileDocumentId": "C0626051233311343"
}

Example 4, 400 missing all three source fields

Status: 400 Bad Request

JSON
{
    "timestamp": "2026-05-15T11:42:00Z",
    "status": 400,
    "error": "Bad Request",
    "message": "One of documentId, documentUrl, or fileInBytes is required"
}