Create characters in a world instance
Create a character to follow across stories. This guide introduces Mallow, a talking field mouse, in the Land of Oz instance from Start a world instance.
1. Choose the instance
Section titled “1. Choose the instance”Use da1cc53b-9d9e-4edb-83e4-d5a9ee713130, the instance from the preceding guide. Mallow will belong to this instance and share its history.
2. Describe a character who belongs in that world
Section titled “2. Describe a character who belongs in that world”Character generation develops an idea in the context of the instance’s setting. Start with who the character is, what they want, and what could complicate their efforts.
For Mallow, supply:
| Field | Example | Meaning |
|---|---|---|
name |
Mallow |
A suggested name. |
pronoun |
they |
One of he, she, or they. Omit to let generation choose. |
highConcept |
A talking field mouse who repairs travelers' shoes |
A short concept for the character. |
brief |
Find a missing mentor along the Yellow Brick Road. Promises help before considering the danger. |
Guidance for developing the character’s background and motives. |
All four fields are optional. Send {} to generate a character from the world’s context. Supplied text fields must contain at least one character; unknown fields are rejected.
Generation develops these suggestions into a character who fits the world. It may adapt wording and add detail, so use the character returned in the response.
Mallow’s missing mentor gives them a reason to travel, while their readiness to help offers opportunities for trouble.
3. Submit the character idea
Section titled “3. Submit the character idea”Address the instance in the URL and put the character inputs in the JSON body:
curl --dump-header - --output character.json --request POST "https://api.hiddendoor.co/experience/v1/instances/da1cc53b-9d9e-4edb-83e4-d5a9ee713130/characters" \ -H "Authorization: Bearer $HD_API_KEY" \ -H 'Content-Type: application/json' \ --data '{ "name": "Mallow", "pronoun": "they", "highConcept": "A talking field mouse who repairs travelers\u0027 shoes", "brief": "Find a missing mentor along the Yellow Brick Road. Promises help before considering the danger." }'Invalid inputs return 400: for example, pronoun: "they/them" is not one of the accepted pronoun values.
4. Use the generated character
Section titled “4. Use the generated character”The 201 Created response contains entity, the saved character, and gameState, the updated world snapshot. The command above saves the response body to character.json and prints the HTTP headers.
Extract a compact summary from that response:
jq '{ instanceId: .gameState.instanceId, characterId: .entity.id, name: .entity.name, pronoun: .entity.pronoun, description: .entity.description}' character.jsonFor example, this summary could be:
{ "instanceId": "da1cc53b-9d9e-4edb-83e4-d5a9ee713130", "characterId": "79a3af39-c171-4dfb-b51b-5a684f61525d", "name": "Mallow", "pronoun": "they", "description": "A talking field mouse with a traveling cobbler's kit, searching the Yellow Brick Road for their missing mentor."}Keep entity.id and gameState.instanceId for subsequent calls. Use Get an entity to read Mallow’s current circumstances, or Get current game state for the whole world.
5. Choose a story for the character
Section titled “5. Choose a story for the character”Some storylines require a particular kind of lead. Read the storyline offers to find suitable stories for Mallow.
If you choose a storyline before creating its lead, include the offer’s identifier as storylineTemplateId in the creation request. This guides generation toward the required archetype. For offers with an authored lead, use Create a playable canon character with the offer’s canonLead details.
With Mallow saved in the instance, continue to story setup to choose their role and begin an episode. You can use the same character across later stories.
See the creation reference for all request fields and response schemas.