Skip to main content

Add a version from an upload.

POST/api/v1/documents/{document_id}/versionsdocuments:write

upload_id is a completed upload session with purpose document. Its file becomes the document's current file; the file that was current is kept as an earlier version, and the new one is processed as a Portal upload. Needs an edit grant on the unlocked document.

Scopedocuments:write
AsynchronousNo
MCP toolcreate_document_version
Portal permissionsupload_document_versions

Parameters​

NameInTypeRequiredDescription
document_idpathstringRequired
Docwize-Versionheaderstring (date)Optional
Idempotency-KeyheaderstringOptionalmax 255

Request body​

Content typeType
application/jsonVersionCreateInput

Responses​

StatusDescriptionBody
201Success.application/json Version 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, idempotency_in_progress, lockedapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422idempotency_key_reused, validation_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​

BlankFileInput​

FieldTypeRequiredDescription
extensionstringRequiredThe Office type of the empty file: docx, xlsx or pptx.
file_namestring or nullOptionalThe file's name, ending with the extension. Default: the document's description (or Document) and the extension.

UserRef​

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

Version​

FieldTypeRequiredDescription
content_typestring or nullRequired
created_atstring (date-time) or nullRequired
created_byUserRef or nullRequiredWho stored the file; null when not recorded (archived files).
file_hashstring or nullRequiredThe hash the Portal stored for the file's content; null when none was recorded.
file_namestring or nullRequired
has_pdfbooleanRequiredWhether a PDF rendition of this file is ready (an Office file converts on demand, so false only means not yet).
is_currentbooleanRequired
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.
reasonstring or nullRequiredThe description recorded when the file was replaced; null for the current file.
size_bytesstring or nullRequired
version_idstringRequired

VersionCreateInput​

FieldTypeRequiredDescription
blank_fileBlankFileInput or nullOptionalAn empty .docx, .xlsx or .pptx as the new current file, to open in Office Online. Not with upload_id.
extract_archiveboolean or nullOptionaltrue expands the new file, a .zip, .pst or .ost, into documents once it is stored. Default false.
immediate_processingboolean or nullOptionaltrue runs the text extraction and AI processing at once instead of in the background queue's turn. Default false.
upload_idstringOptionalA completed upload session with purpose document. Give this or blank_file.