Update region details
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"
}Regions
Update region details
Update the details of an existing region. Modify fields such as lore, name, weather, culture, and political stability.
PATCH
/
context
/
region
/
{game_id}
/
{world_id}
/
{region_id}
Update region details
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
Path Parameters
Body
application/json
The region data fields to update.
Response
Region updated successfully.