## Update a document `PUT https://getkollek.com/api/documents/{document}` Update a document's details. The stored file or the external link itself does not change here; to replace what is stored, delete the document and add a fresh one. Every field is replaced, so send the ones you want to keep along with the ones you are changing. **Permissions:** Owners and editors. Viewers get a 404 response. ### Path parameters - `document` (integer, required): The ID of the document. ### Body parameters - `type` (string, required): What the document is. One of receipt, invoice, certificate, appraisal, insurance, photograph, condition_report, restoration_report, catalogue, correspondence, ownership_record, authenticity_record or other. - `name` (string, required): The display name of the document. - `description` (string, optional): A free note about the document. - `issued_at` (string, optional): The date the document was issued, in YYYY-MM-DD format. - `reference_number` (string, optional): An external reference such as an invoice or certificate number. **Returns:** The updated document object. ### Example request ```bash curl https://getkollek.com/api/documents/1 \ -X PUT \ -H "Authorization: Bearer $API_KEY" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "type": "appraisal", "name": "Appraisal report", "description": "Signed and dated by the appraiser.", "issued_at": "2024-01-01", "reference_number": "INV-2024-0117" }' ``` ### Example response `Status: 200` ```json { "data": { "type": "document", "id": "1", "attributes": { "documentable_type": "valuation", "documentable_id": "5", "document_type": "receipt", "name": "Appraisal report", "external_url": null, "download_url": "https://getkollek.com/api/documents/1", "mime_type": "application/pdf", "size": 248000, "description": "Signed and dated by the appraiser.", "issued_at": 1704067200, "reference_number": "INV-2024-0117", "created_at": 1752537600, "updated_at": 1752537600 }, "links": { "self": "https://getkollek.com/api/documents/1" } } } ```