Skip to main content
POST
/
context
/
characters
/
{game_id}
/
{world_id}
Create a new character
curl --request POST \
  --url https://app.npcbuilder.com/api/context/characters/{game_id}/{world_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "age": "adult",
  "description": "A brave warrior with a mysterious past.",
  "gender": "Male",
  "model": "standard",
  "filters": {
    "active": true,
    "violence": false,
    "sexual": false,
    "drugs": true
  },
  "items": [
    {
      "type": "trade",
      "itemName": "sword",
      "description": "A sharp sword.",
      "unit": "Piece",
      "value": 100
    }
  ],
  "events": [
    {
      "type": "item",
      "eventName": "Attack",
      "description": "Act of violence against another person."
    }
  ],
  "name": "Aragorn",
  "quests": [
    {
      "description": "Retrieve the lost artifact.",
      "objective": "Find and return the artifact.",
      "reward": "500 gold coins"
    }
  ],
  "role": "protagonist",
  "tone": "mysterious",
  "traits": [
    "brave"
  ]
}'
{
  "message": "Character: character789 has been created with the following context.",
  "character_id": "character789",
  "character_context": {
    "age": "adult",
    "description": "A brave warrior with a mysterious past.",
    "gender": "Male",
    "items": [
      {
        "itemName": "sword",
        "unit": "Piece",
        "value": 100
      }
    ],
    "name": "Aragorn",
    "quests": [
      {
        "description": "Retrieve the lost artifact.",
        "objective": "Find and return the artifact.",
        "reward": "500 gold coins"
      }
    ],
    "role": "protagonist",
    "tone": "mysterious",
    "traits": [
      "brave"
    ]
  }
}

Authorizations

Authorization
string
header
required

Path Parameters

game_id
string
required
Example:
world_id
string
required
Example:

Query Parameters

region_id
string
Example:
location_id
string
Example:
session_id
string
Example:

Body

application/json
age
enum<string>
Available options:
infant,
child,
teenager,
youngAdult,
adult,
middleAged,
elderly
Example:
description
string
Example:
gender
string
Example:
model
enum<string>
Available options:
standard,
premium
Example:
filters
object
Example:
items
object[]
  • Option 1
  • Option 2
events
object[]
  • Option 1
  • Option 2
name
string
Example:
quests
object[]
role
enum<string>
Available options:
noRole,
protagonist,
antagonist,
secondaryCharacter,
tertiaryCharacter,
mentor,
enemy,
villain,
rival,
shopkeeper,
healer,
questGiver,
innkeeper,
guard,
familyMember,
loveInterest,
scientist,
politician,
criminal,
explorer,
wizard,
ghost,
animalCompanion,
artificialIntelligence
Example:
tone
enum<string>
Available options:
formal,
casual,
sarcastic,
mysterious,
emotive
Example:
traits
string[]

Response

message
string
Example:
character_id
string
Example:
character_context
object
Example: