Skip to main content

Update a document (JSON Merge Patch).

PATCH/api/v1/documents/{document_id}documents:write

Accepts the document's representation: the writable members are description, document_type, document_sub_type, document_status, post_review_status, project, from_organisation, to_organisation, from_contact, to_contact, reference_number, revision_number, document_date, actual_submission_date, response_date, response_due_date, additional_fields, responded_with, duplicate_of, page_start, page_end, relevance and is_privileged. Other members are read-only. A project you can see moves the document and its client. Needs an edit grant on the unlocked document.

Scopedocuments:write
AsynchronousNo
MCP toolupdate_document
Portal permissionsedit_document_details

Parameters​

NameInTypeRequiredDescription
document_idpathstringRequired
Docwize-Versionheaderstring (date)Optional
If-MatchheaderstringOptional

Request body​

Content typeType
application/jsonDocumentPatchInput
application/merge-patch+jsonDocumentPatchInput

Responses​

StatusDescriptionBody
200Success.application/json Document or object
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
404not_foundapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
409conflict, lockedapplication/problem+json Problem
412precondition_failedapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

AdditionalField​

FieldTypeRequiredDescription
labelstring or nullRequired
valuestring or nullRequired

AdditionalFieldInput​

FieldTypeRequiredDescription
labelstring or nullOptional
valuestring or nullOptional

AdditionalFields​

FieldTypeRequiredDescription
additional_field_3AdditionalFieldRequired
additional_field_4AdditionalFieldRequired
additional_field_5AdditionalFieldRequired
additional_field_6AdditionalFieldRequired

AdditionalFieldsInput​

FieldTypeRequiredDescription
additional_field_3AdditionalFieldInputOptional
additional_field_4AdditionalFieldInputOptional
additional_field_5AdditionalFieldInputOptional
additional_field_6AdditionalFieldInputOptional

Document​

FieldTypeRequiredDescription
actual_submission_datestring or nullRequired
additional_fieldsAdditionalFieldsRequired
created_atstring (date-time) or nullRequired
created_byUserRef or nullRequired
custom_field_rowsarray of DocumentCustomFieldRowRequiredThe register rows the document is linked to that the caller may read, one entry per row in link order.
descriptionstring or nullRequired
document_datestring or nullRequired
document_idstringRequired
document_numberstring or nullRequired
document_statusobject or nullRequiredThe status shown as Status in the Portal (lookup_actionstatus).
document_sub_typeobject or nullRequired
document_typeobject or nullRequired
duplicate_ofstring or nullRequiredThe number of the document this one duplicates (the Portal's Duplicate Of).
fileDocumentFile or nullRequiredThe current file; null when the document has none.
foldersarray of DocumentFolderRequiredThe folders the document is filed in that the caller can see.
from_contactobject or nullRequired
from_organisationobject or nullRequired
is_latest_revisionbooleanRequired
is_lockedbooleanRequired
is_privilegedbooleanRequired
main_document_datestring or nullRequired
ownerUserRef or nullRequired
page_endnumber or nullRequiredLast page of the range this document covers in its file.
page_startnumber or nullRequiredFirst page of the range this document covers in its file.
post_review_statusobject or nullRequired
projectobject or nullRequiredThe stored project number text, with the project's ID when one matches.
project_organisationobject or nullRequired
reference_numberstring or nullRequired
relevancenumber or nullRequired1 is relevant (the default), 0 is irrelevant (the Portal's Irrelevant switch).
responded_withstring or nullRequiredThe reference of the document that responded to this one (the Portal's Responded With).
response_datestring or nullRequired
response_due_datestring or nullRequired
revision_numberstring or nullRequired
to_contactobject or nullRequired
to_organisationobject or nullRequired

DocumentCustomFieldRow​

FieldTypeRequiredDescription
custom_field_template_idstringRequiredThe register the row belongs to.
row_idstringRequired
valuesobjectRequiredThe row's field values, keyed by field name.

DocumentFile​

FieldTypeRequiredDescription
content_typestring or nullRequired
file_hashstring or nullRequiredThe hash the Portal stored for the file's content; null when none was recorded.
file_namestringRequired
has_pdfbooleanRequiredWhether a PDF rendition of the file is ready (an Office file converts on demand, so false only means not yet).
is_indexedbooleanRequiredWhether the file's text has been indexed for search.
page_countinteger or nullRequiredThe pages the file has, once the Portal has counted them; null before.
size_bytesstring or nullRequired
version_idstringRequired

DocumentFolder​

FieldTypeRequiredDescription
folder_idstringRequired
pathstring or nullRequired

DocumentPatchInput​

FieldTypeRequiredDescription
actual_submission_datestring or nullOptional
additional_fieldsAdditionalFieldsInput or nullOptional
created_atstring (date-time) or nullOptional
created_byUserRefInput or nullOptional
custom_field_rowsarray of object or nullOptional
descriptionstring or nullOptional
document_datestring or nullOptional
document_idstring or nullOptional
document_numberstring or nullOptional
document_statusobject or nullOptional
document_sub_typeobject or nullOptionalA sub type of the document's type; changing the type without naming one clears the old type's sub type.
document_typeobject or nullOptional
duplicate_ofstring or nullOptional
fileobject or nullOptional
foldersarray of object or nullOptional
from_contactobject or nullOptionalA contact; its organisation becomes from_organisation. Null clears the person and keeps the organisation.
from_organisationobject or nullOptional
is_latest_revisionboolean or nullOptional
is_lockedboolean or nullOptional
is_privilegedboolean or nullOptional
main_document_datestring or nullOptional
ownerUserRefInput or nullOptional
page_endnumber or nullOptional
page_startnumber or nullOptional
post_review_statusobject or nullOptional
projectobject or nullOptionalA project you can see; the document moves to it and takes its client as project organisation. Null takes the document out of its project.
project_organisationobject or nullOptional
reference_numberstring or nullOptional
relevancenumber or nullOptional0 to 1: 1 is relevant (the default), 0 is irrelevant.
responded_withstring or nullOptional
response_datestring or nullOptional
response_due_datestring or nullOptional
revision_numberstring or nullOptional
to_contactobject or nullOptionalA contact; its organisation becomes to_organisation. Null clears the person and keeps the organisation.
to_organisationobject or nullOptional

UserRef​

FieldTypeRequiredDescription
display_namestringRequired
kindstring: user, system, integration or stringRequired
user_idstring or nullRequired

UserRefInput​

FieldTypeRequiredDescription
display_namestringOptional
kindstring: user, system, integrationOptional
user_idstring or nullOptional