Skip to content

Open a character or narrator conversation

POST
/instances/{instanceId}/stories/{storyId}/conversations
curl --request POST \
--url https://api.hiddendoor.co/experience/v1/instances/da1cc53b-9d9e-4edb-83e4-d5a9ee713130/stories/b79d72ef-92fb-4bcd-917a-9886e62d41d8/conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "target": { "mode": "character", "entityId": "79a3af39-c171-4dfb-b51b-5a684f61525d", "openingIntent": "example" } }'

Open one conversation in this active story and generate its opening dialogue. Character mode targets a present, eligible NPC; narrator mode is an out-of-character aside. Existing story rules still govern eligibility, including once-per-turn limits. The server retains the transcript until expiresAt. Expiry discards it without applying pending effects; explicit end or submitting the next story action applies those effects. Another open conversation or incompatible story input returns 409.

instanceId
required
string format: uuid

Example

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

POST /instances/:instanceId/stories/:storyId/conversations Parameter

storyId
required
string format: uuid

Example

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

POST /instances/:instanceId/stories/:storyId/conversations Parameter

POST /instances/:instanceId/stories/:storyId/conversations Request body

Media type application/json
object
target
required
One of: discriminator: mode
object
mode
required
string
Allowed value: character
entityId
required
string format: uuid

Example

79a3af39-c171-4dfb-b51b-5a684f61525d
openingIntent
string
>= 1 characters <= 350 characters

POST /instances/:instanceId/stories/:storyId/conversations Positive response

Media type application/json
object
conversationId
required
string format: uuid
instanceId
required
string format: uuid
storyId
required
string format: uuid
mode
required
string
Allowed values: character narrator
entityId
required
string | null format: uuid
transcript
required
Array<object>
object
speaker
required

Player marks dialogue supplied by your application; entity marks the character or narrator’s reply.

string
Allowed values: player entity
text
required
string
declined
string | null
counterOffer
boolean
accepted
Array<string>
exchangeCount
required
integer
<= 9007199254740991
windingDown
required
boolean
resolved
required
boolean
suggestions
required
Array<string>
narratorPersonality
string
expiresAt
required

The current expiry time. Expiry discards the conversation without applying its pending effects.

string format: date-time

Example

{
"conversationId": "d0bc5bda-9876-4086-8b2c-39119a811f7e",
"instanceId": "da1cc53b-9d9e-4edb-83e4-d5a9ee713130",
"storyId": "b79d72ef-92fb-4bcd-917a-9886e62d41d8",
"mode": "character",
"transcript": [
{
"speaker": "player"
}
]
}

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