Skip to content

Read the evolving world

Read an instance’s current contents and history to build a view of the world.

A world seed describes the starting setting. An instance’s game state describes the world as it develops: its characters, items, locations, stories and storyline progress. Use that state to answer questions such as “Where is Mallow now?” or “Which stories have changed this world?”

If you already have the instance identifier, use it directly. Otherwise, list your instances, optionally filtering by their world seed:

Terminal window
curl 'https://api.hiddendoor.co/experience/v1/instances?worldSeedName=oz&offset=0&limit=20' \
-H "Authorization: Bearer $HD_API_KEY"

An illustrative response:

{
"instances": [
{
"instanceId": "da1cc53b-9d9e-4edb-83e4-d5a9ee713130",
"worldSeedName": "oz",
"createdAt": "2026-11-11T12:00:00Z"
}
],
"nextOffset": null
}

Instances are listed newest first. Continue with nextOffset until it is null. The list contains identity and creation metadata, not the world’s characters or story history. You can associate these instances with games and users in your own system.

For the remaining examples:

Terminal window
INSTANCE_ID=da1cc53b-9d9e-4edb-83e4-d5a9ee713130
Terminal window
curl "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/state" \
-H "Authorization: Bearer $HD_API_KEY"

Get current game state returns a game-state object. Its world contains the instance’s characters, items and locations; stories contains public story histories; and storylines, when present, maps storyline identifiers to their progress.

Every story includes its complete persisted public event history in turns[].events, including earlier completed and cancelled stories. Events remain in stored order within each turn. History is not limited to recent stories and is not paginated, so response size grows with the instance’s history. Internal events (DEBUG and UPDATE_CHAPTER_ROLE) and private fields are excluded.

An END_STORY event identifies the ended story through data.storyId. Its data.text and data.endReason are optional; recognize the ending by the event type, not by the presence of text.

A selected excerpt from a populated Oz instance might be:

{
"instanceId": "da1cc53b-9d9e-4edb-83e4-d5a9ee713130",
"world": {
"worldSeed": "oz",
"characters": [
{
"id": "79a3af39-c171-4dfb-b51b-5a684f61525d",
"name": "Mallow",
"locationId": "631d0fe8-2808-48b3-9b7e-6a0ab778c2a0"
}
]
},
"updatedAt": "2026-11-12T12:10:00Z"
}

This excerpt shows Mallow from the character guide. Their locationId refers to a location entity in the same instance.

Hidden Door maintains the instance’s state. To change it, submit actions and identifiers through the API. Each operation loads the current state and returns its result.

Read a particular character, item or location

Section titled “Read a particular character, item or location”

To inspect a particular character, item or location, read the entity by its identifier:

Terminal window
curl "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/entities/79a3af39-c171-4dfb-b51b-5a684f61525d" \
-H "Authorization: Bearer $HD_API_KEY"

An entity includes descriptive and gameplay detail: its identity, aspects, conditions, objectives and location or container references. Relationships use source and target entity identifiers. Use those references to connect a cast browser, an inventory view or a scene representation.

You can also list a particular entity type:

Terminal window
curl "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/entities?type=item&offset=0&limit=20" \
-H "Authorization: Bearer $HD_API_KEY"

The response contains entities and nextOffset. To find items in a character’s inventory, check each item’s containerId.

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

Get world rules returns rules, grouped into categories such as setting, magic, technology and physics. Rules reflect the current story’s modifiers; categories without authored rules are omitted.

State and history can include upcoming story details. Choose what to reveal in your interface.

Story-changing operations return gameState, ordered events and outstanding inputRequests. Entity creation returns the created entity alongside gameState. These snapshots already contain the operation’s results, so you can use them without fetching state again.

If a write’s response is lost, inspect the relevant story or entity before retrying: the write may have succeeded. See Errors for guidance on retries.

Next, add items and locations, or choose a storyline and start a story.