---
title: "Update an existing version"
method: POST
path: "/v2/versions/{versionId}"
tags: ["versions"]
---

# Update an existing version

`POST /v2/versions/{versionId}`

## Request

- Base URL: `https://api.storydoc.com`
- URL: `https://api.storydoc.com/v2/versions/{versionId}`
- Auth: HTTP bearer

Updates the data in an existing version, keeping the same version and the same link. By default the version's own content is preserved - including any manual edits made to it in the editor - and only the fields you send in `data` are changed. Pass `force: true` only to DISCARD those edits and re-render the version from the master story template.

## Path parameters

- `versionId` string, required

## Request body

- UpdateVersionRequest
  - `senderEmail` string, email, required: Email of the sender (must exist in organization)
  - `force` boolean: DESTRUCTIVE. Re-renders the version from the master story template and discards any manual edits made to it in the editor. Leave unset to update the version in place, preserving its content.
  - `data` VersionData, required
    - `title` string, required: Title of the version (required)
    - `first_name` string
    - `last_name` string
    - `company` string
    - `email` string, email
    - `phone` string
    - `date` string: Date in any format
    - `products` object[]: Array of product objects
      - `name` string
      - `price` number
    - `gatedContent` GatedContent: Gated content configuration for access control
      - `gatedContent` boolean: Enable/disable content gating
      - `name` boolean: Show name field in the gate form
      - `nameRequired` boolean: Make name field required
      - `logo` boolean: Show logo on the gate form
      - `logoSRC` string, uri: URL of the logo to display on the gate form
      - `title` string: Custom message shown on the gate form
    - `_optionalContent` object: Show or hide content the author marked optional in the editor, by entity id: `false` hides it, `true` shows it, ids left out show. Only entities listed with `toggleable: true` in `optionalContent` are accepted (400 otherwise): the story's (GET /v2/stories/{storyId}?include=optionalContent) when creating, the version's own (GET /v2/versions/{versionId}?include=optionalContent) when updating. On POST /v2/versions/{versionId} only the ids sent change, the version's other choices are kept, and ids sent back with their current value are not checked. Hidden content is not shown to viewers but is still in the page's source, so do not rely on it to keep confidential content from a recipient.
    - `password` string: Password required to view the version
    - `ogImage` string, uri: Open Graph preview image URL for the version
    - `logo` LogoVariable: Logo configuration object
      - `domain` string, required: Domain to fetch logo from
      - `theme` 'dark' | 'light': Logo theme preference

## Response `200`

Version updated successfully

- VersionResponse
  - `url` string, uri: Public URL for the version
  - `shortUrl` string, uri: Shortened URL for the version
  - `editorUrl` string, uri: URL to edit the version in Storydoc editor
  - `versionUrl` string, uri: URL to view version details in Storydoc platform
  - `versionId` string: Unique identifier for the version (only in create response)

## Other responses

- `400`: Invalid request
- `403`: Authentication failed or token outdated, or the story uses variables above the account's plan (`code: VARIABLES_PLAN_REQUIRED`)
- `404`: Version not found
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/storydoc/apis/storydoc-api-v2.md) - [All operations](https://skmtc.dev/storydoc/apis/storydoc-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/storydoc/apis/storydoc-api-v2/revisions/366e7d124e9e?raw)
