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 |
|---|---|---|---|
| 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
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 |
|---|---|---|---|
| text | one source | The file is already at CATHAGO. |
| text | one source | CATHAGO fetches the file itself. The address must be reachable without a login and without VPN. |
| text | one source | The file as base64 text. |
| text | No | The file name CATHAGO stores and shows. Ignored with a |
| choice | with a URL or bytes |
|
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.
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 |
|---|---|---|
| All three source fields were empty | Fill in exactly one of them. |
| Two sources were filled in and the later one won; or a | Send one source. Use |
| The contract id does not exist; there is no | Use the CATHAGO |
|
| Send |
| Key missing, unknown, disabled or expired; or the | Check the |
Adresse
POST https://api.cathago.de/v3/api/gateways/integration/contracts//contract-file?companyAccountId=<companyAccountId>Beispielaufruf
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
{
"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
{
"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
{
"id": "C12260512895327",
"contractFileDocumentId": "C0626051233311343",
"contractFilePublicUrl": "https://docs.cathago.de/contract-pdfs/C0626051233311343",
"contractFileName": "Steel-2026-Q2_Master.pdf"
}Example 3, link by documentId from prior /upload-file (200)
Status: 200 OK
{
"id": "C12260512895327",
"contractFileDocumentId": "C0626051233311343"
}Example 4, 400 missing all three source fields
Status: 400 Bad Request
{
"timestamp": "2026-05-15T11:42:00Z",
"status": 400,
"error": "Bad Request",
"message": "One of documentId, documentUrl, or fileInBytes is required"
}