Replace the file of a document
PUT/v1/offers/:id/documents/:documentId/file
Puts another file in the document's place. Send a form (multipart/form-data) with the file in file. The document keeps its id, name, description and type, so links to it stay valid. On a published or accepted offer the customer sees the change at once, and the offer's history names the API key. No mail is sent.
Sending the file it has already changes nothing. A file another document of the offer has is refused (409 document_already_in_offer), and so is the Kommissionsliste (409 document_read_only). Requires the read:documents and write:offers scopes.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 413
- 415
- 429
- 500
The document with the new file.
validation_error: the body is no form, or the file is missing or empty. message names the problem.
missing_api_key or invalid_api_key: no API key was sent, or it is wrong, expired or revoked.
insufficient_scope: the API key does not have the scope this endpoint needs. required names it.
not_found: there is no such offer in your company, or no such document on it.
document_already_in_offer: another document of the offer has this very file, as documentId. document_read_only: the document is the Kommissionsliste.
file_too_large: the file has more than 20 MiB.
file_type_not_allowed: the file is no PDF, JPEG, PNG, WebP or HEIC.
rate_limited: the API key has stored 1000 files within the hour. Try again after the seconds in the Retry-After header.
Response Headers
db_error: the database refused or failed the request. storage_error: the file could not be stored. message has the details.