Skip to main content
POST
/
interactions
Obtain a response from an NPC character
curl --request POST \
  --url https://app.npcbuilder.com/api/interactions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "character_id": "a96c6161-59f5-40f7-955e-459cd11",
  "game_id": "tx65BrETVN2vMrrUIrlV",
  "world_id": "PtUYW5bLMZNnXPN8qAUJ",
  "messages": [
    {
      "role": "user",
      "content": "Hello Jakinen, my name is Juan, I'\''ll take my sword and dance!"
    }
  ],
  "user_context": {
    "name": "Juan",
    "age": "Adult",
    "gender": "Male",
    "race": "Human",
    "class": "Warrior",
    "level": 5,
    "status": "Healthy",
    "description": "Smelly with a big sword and a wound in the chest"
  }
}'
{
  "response": "Hello Juan, my name is Jakinen",
  "user_events": [
    {
      "name": "take",
      "item": "sword"
    },
    {
      "name": "dance",
      "item": null
    }
  ],
  "character_events": [
    {
      "name": "give",
      "item": "shield"
    },
    {
      "name": "attack",
      "item": null
    }
  ]
}

Authorizations

Authorization
string
header
required

Query Parameters

language
enum<string>
required
Available options:
en-US,
es-ES
Example:
session_id
string
Example:

Body

character_id
string
Example:
game_id
string
Example:
world_id
string
Example:
messages
object[]
user_context
object

Response

response
string
Example:
user_events
object[]
character_events
object[]