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.
Body
Required
-
Email of the sender (must exist in organization)
-
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.
Default value is
false. -
Additional properties are allowed.
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 '{
"senderEmail": "sender@company.com",
"data": {
"title": "Updated Sales Presentation",
"company": "ACME Corporation",
"first_name": "John",
"last_name": "Doe"
}
}'
Request example
{
"senderEmail": "sender@company.com",
"data": {
"title": "Updated Sales Presentation",
"company": "ACME Corporation",
"first_name": "John",
"last_name": "Doe"
}
}
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)
Missing data.title
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 API key is limited to one story and the version belongs to another
{
"error": "Token is scoped to storyId 61b1f40a3a86b7a96d0d8ccc, but version 61b1f40a3a86b7a96d0d8ddd belongs to storyId 61b1f40a3a86b7a96d0d8eee"
}
Response examples (403)
{
"error": "Access denied",
"code": "VARIABLES_PLAN_REQUIRED",
"requiredPlan": "pro",
"variables": [
{
"name": "deal_value",
"requiredPlan": "pro"
}
]
}
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"
}