Skip to content

Generate story options

POST
/instances/{instanceId}/story-options
curl --request POST \
--url https://api.hiddendoor.co/experience/v1/instances/da1cc53b-9d9e-4edb-83e4-d5a9ee713130/story-options \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "setup": { "playerCharacterId": "79a3af39-c171-4dfb-b51b-5a684f61525d", "entityIds": [], "modifierNames": [], "startTemplateId": "oz_trouble_at_home" }, "playerIdea": "example" }'

Generate three story options from the supplied lead, cast and modifiers. You can also provide an idea or context from a previous story or storyline. Each new set replaces the previous options for this instance. To start one, submit its id and the same setup to the story-creation operation.

instanceId
required
string format: uuid

Example

da1cc53b-9d9e-4edb-83e4-d5a9ee713130

POST /instances/:instanceId/story-options Parameter

POST /instances/:instanceId/story-options Request body

Media type application/json
object
setup
required
object
playerCharacterId
required

The entity identifier of the character taking the lead in this story.

string format: uuid

Example

79a3af39-c171-4dfb-b51b-5a684f61525d
entityIds
required

Supporting cast selected from this instance. Supply an empty array for no supporting cast.

Array<string>
modifierNames
Array<string>
default:
contextStoryId

A previous story in this instance to use as context.

string format: uuid

Example

b79d72ef-92fb-4bcd-917a-9886e62d41d8
startTemplateId

A storyline offer identifier to start. Mutually exclusive with storylineId.

string
>= 1 characters
storylineId

An existing storyline to continue. Mutually exclusive with startTemplateId.

string format: uuid
targetBeatId

A chapter in the selected existing storyline. Requires storylineId.

string
>= 1 characters

Example

{
"playerCharacterId": "79a3af39-c171-4dfb-b51b-5a684f61525d",
"entityIds": [],
"modifierNames": [],
"startTemplateId": "oz_trouble_at_home"
}
playerIdea
string
>= 1 characters <= 500 characters

POST /instances/:instanceId/story-options Positive response

Media type application/json
object
instanceId
required
string format: uuid
options
required
Array<object>
>= 3 items <= 3 items
object
id
required
string format: uuid
title
required
string
logline
required
string
sequelTo
string format: uuid
isCanonStory
required
boolean
displayTropeTags
required
Array<string>
canonEntitiesUnlocked
required
Array<object>
object
canonId
required
string
name
required
string
type
required
string
Allowed values: character item location
playerIdeaSeeded
boolean
storylineBeatLabel
string
storylineId
string | null format: uuid
targetedBeatId
string | null
expiresAt
required

When this option set expires. Requesting another set replaces it before this time.

string format: date-time

Example

{
"instanceId": "da1cc53b-9d9e-4edb-83e4-d5a9ee713130",
"options": [
{
"title": "Trouble at the Wayside Workshop",
"logline": "Mallow follows a trail of misplaced shoes along the Yellow Brick Road.",
"sequelTo": "b79d72ef-92fb-4bcd-917a-9886e62d41d8",
"canonEntitiesUnlocked": [
{
"type": "character"
}
]
}
]
}

Request parameters or the JSON body do not conform to this operation’s input schema. Correct the request before retrying.

Media type application/json
object
error
required

The HTTP error category. Use the status code to handle failures.

string
Allowed value: Bad Request
message
required

A human-readable explanation. Do not parse this text for program logic.

string

Example

{
"error": "Bad Request",
"message": "Request parameters or the JSON body do not conform to this operation’s input schema. Correct the request before retrying."
}

Authentication is missing or invalid. Supply a valid API key in the Authorization: Bearer header.

Media type application/json
object
error
required

The HTTP error category. Use the status code to handle failures.

string
Allowed value: Unauthorized
message
required

A human-readable explanation. Do not parse this text for program logic.

string

Example

{
"error": "Unauthorized",
"message": "Authentication is missing or invalid. Supply a valid API key in the Authorization: Bearer header."
}

The authenticated account does not have access to the Experience API.

Media type application/json
object
error
required

The HTTP error category. Use the status code to handle failures.

string
Allowed value: Forbidden
message
required

A human-readable explanation. Do not parse this text for program logic.

string

Example

{
"error": "Forbidden",
"message": "The authenticated account does not have access to the Experience API."
}

The resource does not exist or is not accessible to your application.

Media type application/json
object
error
required

The HTTP error category. Use the status code to handle failures.

string
Allowed value: Not Found
message
required

A human-readable explanation. Do not parse this text for program logic.

string

Example

{
"error": "Not Found",
"message": "The resource does not exist or is not accessible to your application."
}

The operation conflicts with the current instance or story state. Read the current state before choosing the next action.

Media type application/json
object
error
required

The HTTP error category. Use the status code to handle failures.

string
Allowed value: Conflict
message
required

A human-readable explanation. Do not parse this text for program logic.

string

Example

{
"error": "Conflict",
"message": "The operation conflicts with the current instance or story state. Read the current state before choosing the next action."
}

The JSON request body exceeds 100 KB. Reduce its size before retrying.

Media type application/json
object
error
required

The HTTP error category. Use the status code to handle failures.

string
Allowed value: Payload Too Large
message
required

A human-readable explanation. Do not parse this text for program logic.

string

Example

{
"error": "Payload Too Large",
"message": "The JSON request body exceeds 100 KB. Reduce its size before retrying."
}

The server could not complete the request. Internal error details are not exposed.

Media type application/json
object
error
required

The HTTP error category. Use the status code to handle failures.

string
Allowed value: Internal Server Error
message
required

A human-readable explanation. Do not parse this text for program logic.

string

Example

{
"error": "Internal Server Error",
"message": "Internal server error"
}