documents

Create Document

Start a document's history with a file as its first version; an edit of a file is kept as a version only once the file is one. Send the file's bytes as multipart/form-data in the file field, or name a file you uploaded (or an edit's files.clean) by file_id, as a form field or a JSON body: the first version is that file as it is, so its listing and paragraph ids stay the ones you read. Each upload starts a new document; a file named by file_id becomes a version once, and naming it again is 409 CONFLICT. An edit's files.clean can be named while the edit is still being applied; one whose edit failed is refused.

post/v1/documents

Request

  • Base URL
    https://api.versionstory.com (the document declares no server; this is the origin it was published from)
  • URL
    https://api.versionstory.com/v1/documents
  • Auth
    HTTP bearer

Headers

X-Customer-Idstring nullable

Id of one of your customers (created in the developer dashboard) to attribute this request's credit usage to. Billing and limits stay organization-wide.

Request body

file_idstring required

A file you uploaded (POST /v1/files) or an edit's files.clean: the version is that file as it is, not a copy, so the paragraph ids read from it carry over.

namestring nullable

The Document's name; the file's by default.

Response

Successful Response

document_idstring required

The Document's id.

namestring nullable

The Document's name: the name it was given, else its first file's.

version_countinteger required

How many versions it has.

created_atstring nullable

When the Document was made: ISO 8601 in UTC, to the second: 2026-10-21T18:22:31Z.

updated_atstring nullable

When the Document last changed: ISO 8601 in UTC, to the second: 2026-10-21T18:22:31Z.

metadataobject

Your own string values by key, stored and returned as they were sent.

Changes

No recorded changes to this operation across all 1 revision of this API.