Add a document to an offer
POST/v1/offers/:id/documents
Stores a file on the offer, as an upload in the planner's documents tab does. Send a form (multipart/form-data) with the file in file; name, description and type are optional. The offer can be in any state. 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.
An offer holds a file once. When it has the very same file already, the call answers 409 document_already_in_offer and names the document in documentId, so a call whose answer you did not get can simply be repeated. Requires the read:documents and write:offers scopes.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 413
- 415
- 429
- 500
The new document.
validation_error: the body is no form, the file is missing or empty, or a field is not valid. 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 record in your company.
document_already_in_offer: the offer has this very file already, as documentId.
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.