> For the complete documentation index, see [llms.txt](https://selenium-4.gitbook.io/nexus-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://selenium-4.gitbook.io/nexus-docs/documentation/document-services/operations/main-2.md).

# Update Document

## Update Document

> Updates the status, metadata, security or workflow state of a document directory entry, recording an audit trail of the change.

```json
{"openapi":"3.0.3","info":{"title":"NEXUS Banking Services API","version":"1.0.0"},"tags":[{"name":"document-services"}],"servers":[{"url":"https://sandbox.nexus.selenium.ao","description":"Sandbox"},{"url":"https://api-mock.selenium.ao","description":"Mock"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer Token (OAuth2 / OIDC or JWT) passed in the `Authorization` header."}},"schemas":{"DocumentSecurity":{"type":"object","description":"Security configuration and state of a document.","properties":{"encryptionMethod":{"type":"string","description":"Encryption method applied."},"encryptionStatus":{"type":"string","description":"Encryption status."},"accessLevel":{"type":"string","description":"Access level required for the document."},"accessPermissions":{"type":"array","description":"Access permissions granted.","items":{"type":"string"}},"digitalSignatureRequired":{"type":"boolean","description":"Whether a digital signature is required."},"digitalSignature":{"type":"boolean","description":"Whether the document is digitally signed."},"checksumMD5":{"type":"string","description":"MD5 checksum of the document."},"checksumSHA256":{"type":"string","description":"SHA-256 checksum of the document."}}},"DocumentCompliance":{"type":"object","description":"Regulatory compliance requirements and status of a document.","properties":{"regulatoryRequirements":{"type":"array","description":"Applicable regulatory requirements.","items":{"type":"string"}},"complianceChecksRequired":{"type":"boolean","description":"Whether compliance checks are required."},"privacyConsent":{"type":"boolean","description":"Whether privacy consent was given."},"retentionConsentGiven":{"type":"boolean","description":"Whether retention consent was given."},"complianceStatus":{"type":"string","description":"Current compliance status."},"lastComplianceCheck":{"type":"string","format":"date-time","description":"Date/time of the last compliance check."},"nextComplianceReview":{"type":"string","format":"date-time","description":"Date/time of the next compliance review."},"retentionCompliance":{"type":"string","description":"Retention compliance status."},"privacyCompliance":{"type":"string","description":"Privacy compliance status."}}},"DocumentEntryDetails":{"type":"object","description":"Core document metadata shared and extended (via `allOf`) across the Initiate, Retrieve, Update and Grant document-services operations.","properties":{"documentType":{"type":"string","description":"Type of the document."},"documentSubType":{"type":"string","description":"Subtype of the document."},"documentName":{"type":"string","description":"Name of the document."},"documentDescription":{"type":"string","description":"Description of the document."},"documentFormat":{"type":"string","description":"File format."},"documentMimeType":{"type":"string","description":"MIME type of the file."},"documentLanguage":{"type":"string","description":"Language of the document."},"documentClassification":{"type":"string","description":"Confidentiality classification."},"documentRetentionPeriod":{"type":"string","description":"ISO 8601 duration, e.g. `P10Y`."},"documentOwnership":{"$ref":"#/components/schemas/DocumentOwnership"},"documentSecurity":{"$ref":"#/components/schemas/DocumentSecurity"},"documentContent":{"$ref":"#/components/schemas/DocumentContent"},"documentCompliance":{"$ref":"#/components/schemas/DocumentCompliance"},"documentWorkflow":{"$ref":"#/components/schemas/DocumentWorkflow"},"businessContext":{"$ref":"#/components/schemas/BusinessContext"}}},"DocumentOwnership":{"type":"object","description":"Owner of a document.","properties":{"documentOwnerReference":{"type":"string","description":"Reference of the document owner."},"documentOwnerType":{"type":"string","description":"Type of the document owner."},"documentOwnerName":{"type":"string","description":"Name of the document owner."}}},"DocumentContent":{"type":"object","description":"Content and metadata of a document file.","properties":{"documentData":{"type":"string","format":"byte","nullable":true,"description":"Base64-encoded document content."},"documentMetadata":{"type":"object","description":"Shape varies by document type (e.g. identification, contract, employment declaration).","additionalProperties":true},"documentExtractedData":{"type":"object","description":"Shape varies by document type.","additionalProperties":true}}},"DocumentWorkflow":{"type":"object","description":"Workflow state of a document.","properties":{"initialWorkflowState":{"type":"string","description":"Initial workflow state."},"currentWorkflowState":{"type":"string","description":"Current workflow state."},"workflowOwner":{"type":"string","description":"Team/system responsible for the workflow."},"processingPriority":{"type":"string","description":"Priority of processing."},"expectedProcessingTime":{"type":"string","description":"ISO 8601 duration."},"notificationRequired":{"type":"boolean","description":"Whether a notification is required."},"nextAction":{"type":"string","description":"Next action planned in the workflow."},"estimatedCompletionTime":{"type":"string","description":"Estimated time of completion."},"workflowHistory":{"type":"array","description":"History of workflow transitions.","items":{"$ref":"#/components/schemas/WorkflowHistoryEntry"}}}},"WorkflowHistoryEntry":{"type":"object","description":"Single entry in a document's workflow history.","properties":{"state":{"type":"string","description":"Workflow state at this entry."},"timestamp":{"type":"string","format":"date-time","description":"Date/time of the entry."},"actor":{"type":"string","description":"Actor who performed the action."},"actorReference":{"type":"string","description":"Reference of the actor."},"comment":{"type":"string","description":"Free-text comment on the entry."},"systemGenerated":{"type":"boolean","description":"Whether the entry was generated automatically by the system."}}},"BusinessContext":{"type":"object","description":"Business context associated with a document.","properties":{"relatedAccountId":{"type":"string","nullable":true,"description":"Related account identifier, when applicable."},"relatedApplicationId":{"type":"string","description":"Related application identifier."},"businessProcess":{"type":"string","description":"Business process associated with the document."},"documentPurpose":{"type":"string","description":"Purpose of the document."},"externalReferences":{"type":"object","properties":{"applicationReference":{"type":"string","description":"Reference of the related application."},"caseReference":{"type":"string","description":"Reference of the related case."}}}}},"ErrorEnvelope":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}}},"Error":{"type":"object","required":["status","reason","message","path"],"properties":{"status":{"type":"integer","description":"HTTP status code of the error."},"reason":{"type":"string","description":"High-level error category code."},"message":{"type":"string","description":"Human-readable description of the problem."},"path":{"type":"string","description":"HTTP method and endpoint path that originated the error."},"errordetail":{"type":"array","description":"Detailed error list. May be absent for generic errors (e.g. 500).","items":{"$ref":"#/components/schemas/ErrorDetail"}}}},"ErrorDetail":{"type":"object","properties":{"code":{"type":"string","description":"Domain-specific error code."},"reason":{"type":"string","description":"Textual identifier of the specific cause."},"message":{"type":"string","description":"Detailed message, with concrete values where applicable."}}}},"responses":{"BadRequest":{"description":"The request payload is invalid — inconsistent dates, an amount ≤ 0, an invalid currency, or missing required fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unauthorized":{"description":"Missing, expired or invalid Bearer Token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"NotFound":{"description":"The requested resource could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"InternalServerError":{"description":"Unexpected internal error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"paths":{"/v1/document-services/document-directory/{document-directory-id}":{"put":{"summary":"Update Document","description":"Updates the status, metadata, security or workflow state of a document directory entry, recording an audit trail of the change.","tags":["document-services"],"operationId":"updateDocument","parameters":[{"name":"document-directory-id","in":"path","required":true,"description":"Identifier of the document directory instance containing the document to update.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"documentDirectoryUpdateInputRecord":{"type":"object","description":"Root object of the document update request.","properties":{"documentDirectoryUpdateActionRequest":{"type":"string","description":"Business action requested."},"documentDirectoryUpdateActionTaskRecord":{"type":"object","description":"Task record for the update.","properties":{"documentDirectoryUpdateActionRequest":{"type":"string","description":"Business action requested (repeated at task level)."},"documentDirectoryUpdateActionTaskReference":{"type":"string","description":"Unique reference of the update task."},"documentDirectoryInstanceReference":{"type":"string","description":"Identifier of the document directory instance."},"documentDirectoryEntryReference":{"type":"string","description":"Identifier of the document to update."},"documentDirectoryUpdateRecord":{"type":"object","description":"Data of the update.","properties":{"updateType":{"type":"string","description":"Type of update to apply."},"updateReason":{"type":"string","description":"Reason for the update."},"updatedBy":{"type":"string","description":"Identifier of the author of the update."},"updateComments":{"type":"string","description":"Free-text comment on the update."},"documentEntryDetails":{"type":"object","description":"Partial update payload — only the fields being changed need to be supplied.","properties":{"documentStatus":{"type":"string","description":"New status of the document."},"documentVersion":{"type":"string","description":"New version of the document."},"documentLastModifiedDate":{"type":"string","format":"date-time","description":"Date/time of the last modification."},"documentSecurity":{"allOf":[{"$ref":"#/components/schemas/DocumentSecurity"},{"type":"object","properties":{"verificationCertificate":{"type":"string","description":"Verification certificate reference."},"verifiedBy":{"type":"string","description":"Identifier of who verified the document."},"verificationDate":{"type":"string","format":"date-time","description":"Date/time of verification."}}}]},"documentCompliance":{"allOf":[{"$ref":"#/components/schemas/DocumentCompliance"},{"type":"object","properties":{"complianceNotes":{"type":"string","description":"Free-text notes on compliance."}}}]},"documentWorkflow":{"type":"object","description":"Workflow state to apply.","properties":{"currentWorkflowState":{"type":"string","description":"Current workflow state after the update."},"workflowTransition":{"type":"object","description":"Detail of the workflow state transition.","properties":{"fromState":{"type":"string","description":"Workflow state before the transition."},"toState":{"type":"string","description":"Workflow state after the transition."},"transitionDate":{"type":"string","format":"date-time","description":"Date/time of the transition."},"transitionActor":{"type":"string","description":"Actor who performed the transition."},"transitionReason":{"type":"string","description":"Reason for the transition."},"transitionComments":{"type":"string","description":"Free-text comment on the transition."}}},"nextAction":{"type":"string","description":"Next action planned in the workflow."},"workflowOwner":{"type":"string","description":"Team/system responsible for the workflow."}}}}}}}}},"auditTrail":{"type":"object","description":"Audit trail record of the update.","properties":{"updateAction":{"type":"string","description":"Type of action recorded in the audit."},"updateTimestamp":{"type":"string","format":"date-time","description":"Date/time of the audit record."},"updateSource":{"type":"string","description":"Source system of the update."},"updateAuthorization":{"type":"string","description":"Reference of the authorization that allowed the update."},"dataIntegrityCheck":{"type":"string","description":"Result of the data integrity check."},"backupCreated":{"type":"boolean","description":"Whether a backup was created before the update."},"changeLog":{"type":"array","description":"List of changes made.","items":{"type":"object","properties":{"field":{"type":"string","description":"Field that was changed."},"oldValue":{"type":"string","description":"Value before the change."},"newValue":{"type":"string","description":"Value after the change."},"changeReason":{"type":"string","description":"Reason for the change."}}}}}}}}}}}}},"responses":{"200":{"description":"Document updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"documentDirectoryUpdateOutputRecord":{"type":"object","description":"Root object of the document update response.","properties":{"documentEntryDetails":{"$ref":"#/components/schemas/DocumentEntryDetails"}}},"documentDirectoryUpdateActionResponse":{"type":"object","description":"Outcome of the update.","properties":{"documentDirectoryUpdateActionResponseCode":{"type":"string","description":"Result code of the operation."},"documentDirectoryUpdateActionResponseMessage":{"type":"string","description":"Human-readable message describing the result."},"documentDirectoryUpdateActionResponseDetails":{"type":"object","description":"Additional details of the update result.","properties":{"documentId":{"type":"string","description":"Identifier of the updated document."},"previousStatus":{"type":"string","description":"Status before the update."},"currentStatus":{"type":"string","description":"Status after the update."},"updateTimestamp":{"type":"string","format":"date-time","description":"Date/time the update was applied."},"updatedBy":{"type":"string","description":"Identifier of the author of the update."},"versionIncremented":{"type":"boolean","description":"Whether the document version was incremented."},"newVersion":{"type":"string","description":"New version of the document."},"complianceValidated":{"type":"boolean","description":"Whether compliance was validated after the update."},"nextActions":{"type":"array","items":{"type":"string"},"description":"Next actions planned."},"notificationsSent":{"type":"array","items":{"type":"string"},"description":"Notifications sent as a result of the update."}}}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://selenium-4.gitbook.io/nexus-docs/documentation/document-services/operations/main-2.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
