---
title: "Get all variables of a story"
method: GET
path: "/v2/stories/{storyId}/variables"
tags: ["stories"]
---

# Get all variables of a story

`GET /v2/stories/{storyId}/variables`

## Request

- Base URL: `https://api.storydoc.com`
- URL: `https://api.storydoc.com/v2/stories/{storyId}/variables`
- Auth: HTTP bearer

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.

## Path parameters

- `storyId` string, required

## Response `200`

Variables retrieved successfully

- object
  - `storyId` string
  - `title` string
  - `dynamicVariables` object[]: The story's variables manifest (same shape as `dynamicVariables` on GET /v2/stories/{storyId})
  - `repeatables` RepeatableGroup[]: Root repeatable-content groups; each group's rows are sent as `data[key] = [row, …]`
    - `key` string
    - `name` string
    - `fields` object[]
      - `key` string
      - `name` string
      - `type` string
      - `generated` boolean: Produced by Storydoc (AI per row, calculations) — do not send
    - `children` object[]: Nested groups (same shape)
    - `exampleRow` object
  - `optionalContent` OptionalEntity[], nullable: Content the author marked optional in the story's published version (see OptionalEntity); empty when none, null when the content could not be read
    - `id` string: Entity id, the key in `data._optionalContent`
    - `name` string, nullable: Name the author gave it
    - `type` 'slide' | 'combo' | 'set' | 'element'
    - `slideIndex` integer: 1-based position of the slide it is on
    - `slideTitle` string, nullable
    - `mode` 'simple' | 'conditional': `simple`: shown or hidden per version. `conditional`: follows `rule`, cannot be toggled
    - `toggleable` boolean: True when `data._optionalContent` can show or hide it
    - `rule` object: Conditional entities only: shown or hidden by a variable's value
      - `variable` string
      - `operator` 'equals' | 'not-equals'
      - `value` string
      - `then` 'show' | 'hide'
  - `payloadExample` object: A complete example `data` object for POST /v2/versions: variable defaults, two example rows per group, and `_optionalContent` with every toggleable entity shown

## Other responses

- `400`: Missing storyId, or the API token is invalid, revoked or inactive
- `403`: Authentication failed, missing token, or token scoped to another story
- `404`: Story 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)
