Advance a story and supply requested input
Submit actions for a story’s lead, consume the resulting events, and answer the requests that pause narrative progress.
You choose how to select and present actions: offer generated suggestions, accept free text or generate actions programmatically. Hidden Door evaluates each action against the instance’s current state and returns the narrative and gameplay consequences.
The examples continue Mallow’s active Oz story. Use its instance and story identifiers:
INSTANCE_ID=da1cc53b-9d9e-4edb-83e4-d5a9ee713130STORY_ID=b79d72ef-92fb-4bcd-917a-9886e62d41d8Check whether the story is waiting for input
Section titled “Check whether the story is waiting for input”Starting a story, submitting an action and answering input all return storyId, gameState, events and inputRequests. The inputRequests array contains every request still awaiting an answer after the operation.
To inspect them independently, get outstanding story input:
curl \ "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/stories/$STORY_ID/inputs" \ -H "Authorization: Bearer $HD_API_KEY"An empty list means no input is outstanding:
{ "inputRequests": [] }Before submitting an action, also check that the story’s isActive is true. A cancelled story has false; a completed story has null.
Get suggestions or supply your own action
Section titled “Get suggestions or supply your own action”When the story is ready for an action, you can ask for suggestions without advancing it:
curl --request POST \ "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/stories/$STORY_ID/action-suggestions" \ -H "Authorization: Bearer $HD_API_KEY" \ -H 'Content-Type: application/json' \ --data '{"playerText":"Find out what has happened to the road"}'An illustrative response:
{ "phrases": [ { "phrase": "Follow the displaced yellow bricks to the edge of the village", "difficulty": "easy", "scope": "ok" } ]}Each suggestion includes an estimated difficulty and scope. The server evaluates the action when you submit it. If a suggestion has talkToEntityId, open a conversation with that character.
Submit the chosen action text:
curl --request POST \ "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/stories/$STORY_ID/turns" \ -H "Authorization: Bearer $HD_API_KEY" \ -H 'Content-Type: application/json' \ --data '{ "intentPhrase": { "phrase": "Follow the displaced yellow bricks to the edge of the village" } }'The 200 response contains the updated gameState, ordered events and any outstanding inputRequests.
Read events as the result of the action
Section titled “Read events as the result of the action”The server resolves challenges by roll. For example, the events array might include this challenge result:
[ { "eventId": "ac07ca65-c5b3-437f-b31f-5f3d95184fe4", "event": "CHALLENGE_RESULT", "data": { "text": "success", "meta": { "difficulty": "easy", "sourceStat": "mind" } } }, { "eventId": "ac07ca65-c5b3-437f-b31f-5f3d95184fe5", "event": "MICROBEAT", "data": { "text": "Mallow finds a trail of fresh mortar leading away from the village." } }]Present events in order, and use gameState to read the resulting world and story state.
API actions resolve challenges on the server. Minigame events may appear in older history; no client-side minigame interaction is required.
Answer the specific request that blocks progress
Section titled “Answer the specific request that blocks progress”A turn can pause for an entity, text, a choice or a scene selection. For example:
{ "inputRequests": [ { "eventId": "81563a95-1576-49c2-af93-9e7c9cb4709e", "storyId": "b79d72ef-92fb-4bcd-917a-9886e62d41d8", "type": "multipleChoice", "prompt": "Which trail does Mallow follow?", "options": [ { "id": "road", "value": "Follow the yellow bricks" }, { "id": "mortar", "value": "Follow the fresh mortar" } ] } ]}The request’s eventId is the identifier of its persisted begin event. Send the answer to that request, using an offered option’s identifier rather than its display text:
curl --request POST \ "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/stories/$STORY_ID/inputs/81563a95-1576-49c2-af93-9e7c9cb4709e" \ -H "Authorization: Bearer $HD_API_KEY" \ -H 'Content-Type: application/json' \ --data '{"answer":{"type":"multipleChoice","optionId":"mortar"}}'Answer shapes depend on the request’s type:
| Request type | What to supply inside answer |
|---|---|
entity |
type: "entity" and an eligible entityId from this instance. |
text |
type: "text" and a non-empty value. |
multipleChoice |
type: "multipleChoice" and one of the offered optionId values. |
scene |
type: "scene" and one of the offered sceneName values. |
For an entity request, choose from eligibleEntityIds or use the creation guidance to generate a suitable entity. Then submit its identifier as the answer. This applies the required role and location changes and resumes the turn.
Continue from the returned result
Section titled “Continue from the returned result”An answer returns the same story-result envelope and can produce another input request. Continue answering the outstanding requests before submitting an unrelated action. Requests remain tied to durable events; they do not share the expiry of story options or conversations.
A stale, superseded or already-answered request returns 409 Conflict. Read current state and outstanding inputs before retrying, so you avoid trying to resume the same turn twice after an uncertain response.
For public history, read the story or page through its turns. When an END_STORY event arrives, move to story completion rather than submitting another action.
See Submit a story action and Answer a story input request for the complete request and response schemas. To exchange dialogue without submitting a new action for each line, open a conversation.