---
title: "Replace a document with a new version"
method: POST
path: "/documents/{document_id}/versions"
tags: ["document"]
---

# Replace a document with a new version

`POST /documents/{document_id}/versions`

## Request

- Base URL: `https://localhost:4410/api/v1`
- URL: `https://localhost:4410/api/v1/documents/{document_id}/versions`
- Auth: HTTP bearer

Every link to the document shows the new version from now on.

## Path parameters

- `document_id` string, required

## Request body

- object
  - `file_name` string: The file's name, such as "Seed deck.pdf".
  - `content_base64` string: The PDF or Word file, base64. Up to 2 MB from you; larger: document_upload_start.
  - `file` object: A file the person attached in the chat.
    - `download_url` string, uri, required
    - `file_id` string

## Response `200`

The result.

- object
  - `id` string, required
  - `title` string, required
  - `version` integer, required
  - `pages` integer, required
  - `page_sizes` object[], required
    - `width` number, required
    - `height` number, required
  - `file_name` string, required
  - `sha256` string, required
  - `links` integer, required
  - `views` integer, required
  - `last_viewed_at` string, date-time, nullable, required
  - `envelopes` integer, required
  - `templates` object[], required
    - `id` string, required
    - `name` string, required
    - `roles` string[], required
  - `created_at` string, date-time, required

## Other responses

- `default`: An RFC 9457 problem.

---

[API](https://skmtc.dev/binderwork/apis/binderwork-api.md) · [All operations](https://skmtc.dev/binderwork/apis/binderwork-api/llms.txt) · [OpenAPI document](https://skmtc.dev/binderwork/apis/binderwork-api/revisions/f8fab0ebee53?raw)
