Add locations and items
Add a roadside workshop and a small repair kit to your Oz instance. These give Mallow places to visit and objects to use in later stories.
Begin with an existing instance:
INSTANCE_ID=da1cc53b-9d9e-4edb-83e4-d5a9ee713130Create a location in the world
Section titled “Create a location in the world”Create a location by supplying a name, a short concept, free-text guidance, or a combination of them. These inputs guide generation in the context of the instance’s world; they are not a complete location object to store verbatim.
curl --request POST \ "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/locations" \ -H "Authorization: Bearer $HD_API_KEY" \ -H 'Content-Type: application/json' \ --data '{ "name": "The Wayside Workshop", "highConcept": "A tiny repair shop beside the Yellow Brick Road", "brief": "A field mouse repairs shoes for travelers here. The workbench sits inside a hollow stump." }'A successful creation returns 201 Created with entity and gameState. Selected fields might be:
{ "entity": { "id": "631d0fe8-2808-48b3-9b7e-6a0ab778c2a0", "type": "location", "name": "The Wayside Workshop", "description": "A hollow stump beside the yellow bricks shelters a mouse-sized workbench and neat rows of repaired shoes." }, "gameState": { "instanceId": "da1cc53b-9d9e-4edb-83e4-d5a9ee713130" }}The full response includes the rest of the entity and the complete game state. Save entity.id to refer to the workshop in later calls.
Create an item
Section titled “Create an item”Create an item using the same generation fields:
curl --request POST \ "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/items" \ -H "Authorization: Bearer $HD_API_KEY" \ -H 'Content-Type: application/json' \ --data '{ "name": "Roadside repair kit", "highConcept": "A toolkit for a cobbler, small enough for a field mouse", "brief": "Needles, thread and scraps of leather packed in a walnut shell." }'This also returns 201 Created with entity and gameState. Use the returned entity.id in later calls. The following examples use 212a7ed4-7e91-49a8-8e01-1562468b5ec2.
The kit is saved in the instance. Placement and ownership are determined during play; mentioning Mallow or the workshop in the brief does not place it there.
All generation fields are optional. Send {} to generate an item from the world context. Each successful call creates a new entity, even if you reuse the same name.
Read or refine the entity you created
Section titled “Read or refine the entity you created”Read the item by its identifier:
curl \ "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/entities/212a7ed4-7e91-49a8-8e01-1562468b5ec2" \ -H "Authorization: Bearer $HD_API_KEY"To change descriptive fields, edit the existing entity:
curl --request PATCH \ "https://api.hiddendoor.co/experience/v1/instances/$INSTANCE_ID/entities/212a7ed4-7e91-49a8-8e01-1562468b5ec2" \ -H "Authorization: Bearer $HD_API_KEY" \ -H 'Content-Type: application/json' \ --data '{"changes":{"name":"Roadside repair kit for Mallow"}}'The 200 result contains entity and gameState. Only supplied descriptive fields change; identity and history remain. Story or canon constraints can reject an edit with 409 Conflict. This operation cannot directly change inventory, gameplay properties or story roles.
Use the entity in a story
Section titled “Use the entity in a story”Story setup and actions determine how entities take part in a story. If a story requests an entity, select or create an eligible one, then answer the request with its identifier. Submitting the answer applies any required role or location changes and resumes the story.
Keep entities across stories
Section titled “Keep entities across stories”Entities you add to an instance remain there across stories. The workshop and repair kit become part of this Oz instance, available for later stories alongside Mallow.
Stories can also introduce new characters, items and locations as they unfold. At story completion, you choose which of those new entities to keep in the instance. Entities that were already in the instance are preserved.
To remove an entity from the instance yourself, use Delete an entity. A story or storyline may still depend on it, for example as a lead or in an outstanding request. Deletion returns 409 Conflict while those references require the entity.