curl --request POST \
--url https://app.npcbuilder.com/api/context/region/{game_id}/{world_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lore": "A dense forest with hidden secrets.",
"name": "Mystic Forest",
"weather": "Rainy",
"culture": "Druidic traditions",
"politicalStability": "stable"
}
'import requests
url = "https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}"
payload = {
"lore": "A dense forest with hidden secrets.",
"name": "Mystic Forest",
"weather": "Rainy",
"culture": "Druidic traditions",
"politicalStability": "stable"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lore: 'A dense forest with hidden secrets.',
name: 'Mystic Forest',
weather: 'Rainy',
culture: 'Druidic traditions',
politicalStability: 'stable'
})
};
fetch('https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lore' => 'A dense forest with hidden secrets.',
'name' => 'Mystic Forest',
'weather' => 'Rainy',
'culture' => 'Druidic traditions',
'politicalStability' => 'stable'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}"
payload := strings.NewReader("{\n \"lore\": \"A dense forest with hidden secrets.\",\n \"name\": \"Mystic Forest\",\n \"weather\": \"Rainy\",\n \"culture\": \"Druidic traditions\",\n \"politicalStability\": \"stable\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lore\": \"A dense forest with hidden secrets.\",\n \"name\": \"Mystic Forest\",\n \"weather\": \"Rainy\",\n \"culture\": \"Druidic traditions\",\n \"politicalStability\": \"stable\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lore\": \"A dense forest with hidden secrets.\",\n \"name\": \"Mystic Forest\",\n \"weather\": \"Rainy\",\n \"culture\": \"Druidic traditions\",\n \"politicalStability\": \"stable\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Region: region789 has been created with the following context.",
"region_id": "region789",
"region_context": {
"lore": "A dense forest with hidden secrets.",
"name": "Mystic Forest",
"weather": "Rainy",
"culture": "Druidic traditions",
"politicalStability": "stable"
}
}{
"message": "An error occurred"
}{
"message": "Possible reasons:\n- Region with ID [...] not found\n"
}{
"message": "An error occurred"
}Create a new region
Create a new region within the specified world. Provide details such as lore, name, weather, culture, and political stability.
curl --request POST \
--url https://app.npcbuilder.com/api/context/region/{game_id}/{world_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lore": "A dense forest with hidden secrets.",
"name": "Mystic Forest",
"weather": "Rainy",
"culture": "Druidic traditions",
"politicalStability": "stable"
}
'import requests
url = "https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}"
payload = {
"lore": "A dense forest with hidden secrets.",
"name": "Mystic Forest",
"weather": "Rainy",
"culture": "Druidic traditions",
"politicalStability": "stable"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lore: 'A dense forest with hidden secrets.',
name: 'Mystic Forest',
weather: 'Rainy',
culture: 'Druidic traditions',
politicalStability: 'stable'
})
};
fetch('https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lore' => 'A dense forest with hidden secrets.',
'name' => 'Mystic Forest',
'weather' => 'Rainy',
'culture' => 'Druidic traditions',
'politicalStability' => 'stable'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}"
payload := strings.NewReader("{\n \"lore\": \"A dense forest with hidden secrets.\",\n \"name\": \"Mystic Forest\",\n \"weather\": \"Rainy\",\n \"culture\": \"Druidic traditions\",\n \"politicalStability\": \"stable\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lore\": \"A dense forest with hidden secrets.\",\n \"name\": \"Mystic Forest\",\n \"weather\": \"Rainy\",\n \"culture\": \"Druidic traditions\",\n \"politicalStability\": \"stable\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lore\": \"A dense forest with hidden secrets.\",\n \"name\": \"Mystic Forest\",\n \"weather\": \"Rainy\",\n \"culture\": \"Druidic traditions\",\n \"politicalStability\": \"stable\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Region: region789 has been created with the following context.",
"region_id": "region789",
"region_context": {
"lore": "A dense forest with hidden secrets.",
"name": "Mystic Forest",
"weather": "Rainy",
"culture": "Druidic traditions",
"politicalStability": "stable"
}
}{
"message": "An error occurred"
}{
"message": "Possible reasons:\n- Region with ID [...] not found\n"
}{
"message": "An error occurred"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier for the game.
"game123"
The unique identifier for the world.
"world456"
Query Parameters
(Optional) The player's session ID.
"60Z5aZjIuFlyYbjbZZKe"
Body
The region data required for creating a new region.
Background lore of the region.
"A dense forest with hidden secrets."
The name of the region.
"Mystic Forest"
Typical weather conditions in the region.
"Rainy"
Cultural aspects or traditions of the region.
"Druidic traditions"
The political stability status of the region.
none, highlyStable, stable, moderatelyStable, unstable, highlyUnstable, anarchy "stable"
Response
Region created successfully.
Confirmation message for region creation.
"Region: region789 has been created with the following context."
UID of the region.
"region789"
The context details of the created region.
{
"lore": "A dense forest with hidden secrets.",
"name": "Mystic Forest",
"weather": "Rainy",
"culture": "Druidic traditions",
"politicalStability": "stable"
}