Skip to main content
POST
/
context
/
world
/
{game_id}
Create a new world
curl --request POST \
  --url https://app.npcbuilder.com/api/context/world/{game_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "lore": "A world where magic and technology coexist.",
  "name": "Eldoria",
  "creatures": "Dragons, Elves",
  "similarWorlds": [
    "Middle Earth"
  ]
}'
{
  "message": "World: world456 has been created with the following context.",
  "world_id": "world456",
  "world_context": {
    "lore": "A world where magic and technology coexist.",
    "name": "Eldoria",
    "creatures": "Dragons, Elves",
    "similarWorlds": [
      "Middle Earth"
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

game_id
string
required

The unique identifier for the game.

Example:

"game123"

Query Parameters

session_id
string

(Optional) The player's session ID.

Example:

"60Z5aZjIuFlyYbjbZZKe"

Body

application/json

The world data required to create a new world.

lore
string

Background lore or story of the world.

Example:

"A world where magic and technology coexist."

name
string

The name of the world.

Example:

"Eldoria"

creatures
string

A comma-separated list of creatures found in the world.

Example:

"Dragons, Elves"

similarWorlds
string[]

A list of worlds that are similar in theme or style.

Response

World created successfully.

message
string

Confirmation message for world creation.

Example:

"World: world456 has been created with the following context."

world_id
string

UID of the world.

Example:

"world456"

world_context
object

The context details of the created world.

Example:
{
"lore": "A world where magic and technology coexist.",
"name": "Eldoria",
"creatures": "Dragons, Elves",
"similarWorlds": ["Middle Earth"]
}
I