curl --request PATCH \
--url https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}/{region_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}/{region_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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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}/{region_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}/{region_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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}/{region_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("PATCH", 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.patch("https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}/{region_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}/{region_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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 updated 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"
}Update region details
Update the details of an existing region. Modify fields such as lore, name, weather, culture, and political stability.
curl --request PATCH \
--url https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}/{region_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}/{region_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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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}/{region_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}/{region_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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}/{region_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("PATCH", 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.patch("https://app.npcbuilder.com/api/context/region/{game_id}/{world_id}/{region_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}/{region_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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 updated 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"
The unique identifier for the region.
"region789"
Query Parameters
(Optional) The player's session ID.
"60Z5aZjIuFlyYbjbZZKe"
Body
The region data fields to update.
Updated lore of the region.
"A dense forest with hidden secrets."
Updated name of the region.
"Mystic Forest"
Updated weather conditions.
"Rainy"
Updated cultural aspects.
"Druidic traditions"
Updated political stability status.
none, highlyStable, stable, moderatelyStable, unstable, highlyUnstable, anarchy "stable"
Response
Region updated successfully.
Confirmation message after updating the region.
"Region: region789 has been updated 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"
}