Get all variables of a story

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.storydoc.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Storydoc API MCP server": {
    "url": "https://docs.storydoc.com/mcp"
  }
}

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

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

    The ID of the story

Responses

  • 200 application/json

    Variables retrieved successfully

    Hide response attributes Show response attributes object
    • storyId string
    • title string
    • dynamicVariables array[object]

      The story's variables manifest (same shape as dynamicVariables on GET /v2/stories/{storyId})

    • repeatables array[object]

      Root repeatable-content groups; each group's rows are sent as data[key] = [row, …]

      Hide repeatables attributes Show repeatables attributes object

      A repeatable-content group. Send its rows as data[key] = [row, …]; a nested group's rows go inside the parent row under the child's key.

      • key string
      • name string
      • fields array[object]
        Hide fields attributes Show fields attributes object
        • key string
        • name string
        • type string
        • generated boolean

          Produced by Storydoc (AI per row, calculations) — do not send

      • children array[object]

        Nested groups (same shape)

      • exampleRow object

        Additional properties are allowed.

    • payloadExample object

      A complete example data object for POST /v2/versions: variable defaults plus two example rows per group

      Additional properties are allowed.

  • 400 application/json

    Missing storyId, or the API token is invalid, revoked or inactive

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

    Authentication failed, missing token, or token scoped to another story

    Hide response attributes Show response attributes object
    • error string
    • code string

      VARIABLES_PLAN_REQUIRED when the story uses variables above the account's plan; absent for authentication failures.

    • requiredPlan string

      With VARIABLES_PLAN_REQUIRED: the lowest plan that covers every blocked variable.

      Values are pro or team.

    • variables array[object]

      With VARIABLES_PLAN_REQUIRED: the blocked variables and the plan each needs.

      Hide variables attributes Show variables attributes object
      • name string
      • requiredPlan string
  • 404 application/json

    Story not found

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

    Rate limit exceeded

    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
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"
}