Skip to content

Choose a storyline and start a story

Choose a lead and supporting cast, generate three story options, and start one of them in your world instance.

A story is one episode of play. A storyline connects episodes through an ordered set of chapters. You can discover a new storyline through an offer, or continue a storyline already started in the instance. Generating options previews possible stories; selecting an option creates the story itself.

This example follows Mallow, an original talking field mouse in your Oz instance. Mallow was born in Oz, making a native-of-Oz opening more appropriate than a story about arriving from another world.

Terminal window
INSTANCE_ID=da1cc53b-9d9e-4edb-83e4-d5a9ee713130

Discover a storyline and check its lead requirements

Section titled “Discover a storyline and check its lead requirements”

List storyline offers to discover the available openings and their requirements.

Terminal window
curl "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/storyline-offers" \
-H "Authorization: Bearer $HD_API_KEY"

The response contains offers. Selected fields from an Oz offer might be:

{
"offers": [
{
"id": "oz_trouble_at_home",
"name": "The Trouble at Home",
"leadArchetypeName": "Native of Oz",
"eligibleLeadIds": ["79a3af39-c171-4dfb-b51b-5a684f61525d"],
"isOrigin": true,
"locked": false,
"unlockHints": []
}
]
}

The offer’s id, oz_trouble_at_home, identifies an authored storyline template. This storyline opens with the chapter “Trouble Comes up the Road.” Starting it will create a storyline in your instance with its own UUID.

Check locked and the lead requirements before generating options. eligibleLeadIds lists suitable characters already in the instance. To create a new lead, supply storylineTemplateId when generating an original character, or use canon-character creation when the offer supplies a canonLead.

The setup identifies the lead in playerCharacterId, the supporting cast in entityIds and any selected modifiers in modifierNames.

For this example, use Mallow without additional supporting cast or selected modifiers:

{
"playerCharacterId": "79a3af39-c171-4dfb-b51b-5a684f61525d",
"entityIds": [],
"modifierNames": [],
"startTemplateId": "oz_trouble_at_home"
}

Include this setup in both the generation and start requests.

Modifiers change the tone, rules and story possibilities. Browse them with List available modifiers and use their names in modifierNames. An empty array keeps the world’s default modifiers.

Terminal window
curl --request POST \
"https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/story-options" \
-H "Authorization: Bearer $HD_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"setup": {
"playerCharacterId": "79a3af39-c171-4dfb-b51b-5a684f61525d",
"entityIds": [],
"modifierNames": [],
"startTemplateId": "oz_trouble_at_home"
},
"playerIdea": "Trouble reaches the little workshop beside the Yellow Brick Road."
}'

A 200 response contains instanceId, exactly three options, and expiresAt. Each option includes its id, title, logline and other information described in the reference. Selected fields from one generated set could be:

{
"instanceId": "da1cc53b-9d9e-4edb-83e4-d5a9ee713130",
"options": [
{
"id": "259c47ec-cd0d-4e07-8052-cdc1df87b111",
"title": "The Road That Would Not Stay Put",
"logline": "Mallow's customers arrive from roads that were not there yesterday."
},
{
"id": "259c47ec-cd0d-4e07-8052-cdc1df87b112",
"title": "A Very Unwelcome Delivery",
"logline": "A parcel at the workshop contains a demand the village cannot meet."
},
{
"id": "259c47ec-cd0d-4e07-8052-cdc1df87b113",
"title": "The Morning Without Footprints",
"logline": "Every visitor has forgotten where they came from, and the road offers no clues."
}
],
"expiresAt": "2026-11-12T12:20:00Z"
}

playerIdea guides the generated plots. You can select an option until expiresAt, or generate a new set to replace all three. Get current story options retrieves the latest set.

Start the selected option with the same setup

Section titled “Start the selected option with the same setup”
Terminal window
curl --request POST \
"https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/stories" \
-H "Authorization: Bearer $HD_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"optionId": "259c47ec-cd0d-4e07-8052-cdc1df87b111",
"setup": {
"playerCharacterId": "79a3af39-c171-4dfb-b51b-5a684f61525d",
"entityIds": [],
"modifierNames": [],
"startTemplateId": "oz_trouble_at_home"
}
}'

A successful 201 Created response contains storyId, gameState, ordered events and outstanding inputRequests. Retain storyId. Inspect the input requests before submitting an action: opening a story can require further input before play advances.

Starting consumes the option set. Changed setup or an expired, replaced or consumed option returns 409 Conflict. Generate another set when you need different setup; do not submit modified pitch contents. If the start response is lost, read current state before retrying, because the story may already exist.

Starting the first chapter also creates the persistent storyline. Later chapters use its UUID in setup.storylineId, not the template identifier in startTemplateId. Finish a story and continue the world follows that transition while keeping the same world and characters.

For the setup calls, see Generate story options, Get current options and Start a story. List modifiers describes the available setup modifiers; Create a playable canon character covers offered canon leads.

With a story started, submit actions and supply requested input.