Update an existing version

POST /v2/versions/{versionId}

Updates the data in an existing version. Use the force parameter to override versions that have been manually edited.

Path parameters

  • versionId string Required

    The ID of the version to update

application/json

Body Required

  • senderEmail string(email) Required

    Email of the sender (must exist in organization)

  • force boolean

    Force update even if version has been manually edited

    Default value is false.

  • data object Required

    Additional properties are allowed.

    Hide data attributes Show data attributes object
    • 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 array[object]

      Array of product objects

      Hide products attributes Show products attributes object
      • name string
      • price number
    • gatedContent object

      Gated content configuration for access control

      Hide gatedContent attributes Show gatedContent attributes object
      • gatedContent boolean

        Enable/disable content gating

      • name boolean

        Show name field in the gate form

      • nameRequired boolean

        Make name field required

      • logoSRC string(uri)

        URL of the logo to display on the gate form

      • title string

        Custom message shown on the gate form

    • password string

      Password required to view the version

Responses

  • 200 application/json

    Version updated successfully

    Hide response attributes Show response attributes object
    • 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)

  • 400 application/json

    Invalid request or version not editable

    Hide response attribute Show response attribute object
    • error string
  • 403 application/json

    Authentication failed or token outdated

    Hide response attribute Show response attribute object
    • error string
  • 404 application/json

    Version not found

    Hide response attribute Show response attribute object
    • error string
  • 429 application/json

    Rate limit exceeded

    Hide headers attributes Show headers attributes
    • x-rate-limit-counter integer

      Current request count

    • x-rate-limit-maximum integer

      Maximum allowed requests

    Hide response attribute Show response attribute object
    • error string
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • error string
    • errorId string
POST /v2/versions/{versionId}
curl \
 --request POST 'https://api.storydoc.com/v2/versions/61b1f40a3a86b7a96d0d8ccc' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"data":{"title":"Updated Sales Presentation","company":"ACME Corporation","last_name":"Doe","first_name":"John"},"senderEmail":"sender@company.com"}'
Request example
{
  "data": {
    "title": "Updated Sales Presentation",
    "company": "ACME Corporation",
    "last_name": "Doe",
    "first_name": "John"
  },
  "senderEmail": "sender@company.com"
}
Response examples (200)
{
  "url": "https://www.storydoc.com/5d7d8922e00d9265/2e91b144-092f-456b-8f2e-0bae9f7f3355",
  "shortUrl": "https://view.storydoc.com/4GdDGt",
  "editorUrl": "https://app.storydoc.com/pages/editor/61b1e50223b713000a41ca74/61b1f40a3a86b7a96d0d8ccc",
  "versionUrl": "https://app.storydoc.com/pages/editor/61b1e50223b713000a41ca74/versions/61b1f40a3a86b7a96d0d8ccc",
  "versionId": "61b1f40a3a86b7a96d0d8ccc"
}
Response examples (400)
The required title field is missing from the data object
{
  "error": "Missing data.title in request body."
}
The sender email is not registered in the organization
{
  "error": "senderEmail email@domain.com not found in this organization"
}
The version has been manually edited and cannot be updated without force flag
{
  "error": "The version has been edited. Use force=true to override the changes."
}
Response examples (403)
{
  "error": "Access denied"
}
Response examples (404)
{
  "error": "Version not found"
}
Response examples (429)
# Headers
x-rate-limit-counter: 42
x-rate-limit-maximum: 42

# Payload
{
  "error": "Too many requests"
}
Response examples (500)
{
  "error": "Error occured",
  "errorId": "550e8400-e29b-41d4-a716-446655440000"
}