Everything needed to fill a story's variables when creating versions: the dynamic variables manifest, the story's repeatable-content groups (as a tree of fields with example rows), and a ready-to-edit payloadExample for the data object of POST /v2/versions. A repeatable group is sent as an array of row objects under its key; nested groups sit inside their parent row under the child key. Fields flagged generated: true (AI, calculations) are produced by Storydoc and should not be sent.
GET
/v2/stories/{storyId}/variables
curl \
--request GET 'https://api.storydoc.com/v2/stories/61b1e50223b713000a41ca74/variables' \
--header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
"storyId": "61b1e50223b713000a41ca74",
"title": "Sales Presentation Template",
"dynamicVariables": [
{
"type": "input",
"name": "company",
"title": "Company name",
"default": "",
"validation": {
"required": false
}
}
],
"repeatables": [
{
"key": "team",
"name": "Team members",
"fields": [
{
"key": "name",
"name": "Name",
"type": "input"
},
{
"key": "photo",
"name": "Photo",
"type": "image"
},
{
"key": "pitch",
"name": "Pitch",
"type": "ai",
"generated": true
}
],
"children": [],
"exampleRow": {
"name": "Name 1",
"photo": "https://example.com/photo-1.png"
}
}
],
"payloadExample": {
"title": "Version title",
"company": "",
"team": [
{
"name": "Name 1",
"photo": "https://example.com/photo-1.png"
},
{
"name": "Name 2",
"photo": "https://example.com/photo-2.png"
}
]
}
}
Response examples (400)
{
"error": "Missing data.title in request body."
}
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)
{
"error": "Too many requests"
}
Response examples (500)
{
"error": "Error occured",
"errorId": "550e8400-e29b-41d4-a716-446655440000"
}