Campaigns & encounters
Create or update an encounter
Creating new encounters requires Patreon tier 1+.
POST
/
create-encounter
Create or update an encounter
curl --request POST \
--url https://api.wanderersguide.app/functions/v1/create-encounter \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"icon": "<string>",
"color": "<string>",
"campaign_id": 123,
"combatants": {
"list": [
{
"_id": "<string>",
"ally": true,
"initiative": 123,
"character": 123,
"hazard_state": {
"hp_current": 1,
"disabled": true
}
}
]
},
"meta_data": {
"description": "<string>",
"party_level": 123,
"party_size": 123
}
}
'import requests
url = "https://api.wanderersguide.app/functions/v1/create-encounter"
payload = {
"name": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"icon": "<string>",
"color": "<string>",
"campaign_id": 123,
"combatants": { "list": [
{
"_id": "<string>",
"ally": True,
"initiative": 123,
"character": 123,
"hazard_state": {
"hp_current": 1,
"disabled": True
}
}
] },
"meta_data": {
"description": "<string>",
"party_level": 123,
"party_size": 123
}
}
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({
name: '<string>',
id: 123,
created_at: '2023-11-07T05:31:56Z',
user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
icon: '<string>',
color: '<string>',
campaign_id: 123,
combatants: {
list: [
{
_id: '<string>',
ally: true,
initiative: 123,
character: 123,
hazard_state: {hp_current: 1, disabled: true}
}
]
},
meta_data: {description: '<string>', party_level: 123, party_size: 123}
})
};
fetch('https://api.wanderersguide.app/functions/v1/create-encounter', 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://api.wanderersguide.app/functions/v1/create-encounter",
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([
'name' => '<string>',
'id' => 123,
'created_at' => '2023-11-07T05:31:56Z',
'user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'icon' => '<string>',
'color' => '<string>',
'campaign_id' => 123,
'combatants' => [
'list' => [
[
'_id' => '<string>',
'ally' => true,
'initiative' => 123,
'character' => 123,
'hazard_state' => [
'hp_current' => 1,
'disabled' => true
]
]
]
],
'meta_data' => [
'description' => '<string>',
'party_level' => 123,
'party_size' => 123
]
]),
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://api.wanderersguide.app/functions/v1/create-encounter"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"id\": 123,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"campaign_id\": 123,\n \"combatants\": {\n \"list\": [\n {\n \"_id\": \"<string>\",\n \"ally\": true,\n \"initiative\": 123,\n \"character\": 123,\n \"hazard_state\": {\n \"hp_current\": 1,\n \"disabled\": true\n }\n }\n ]\n },\n \"meta_data\": {\n \"description\": \"<string>\",\n \"party_level\": 123,\n \"party_size\": 123\n }\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://api.wanderersguide.app/functions/v1/create-encounter")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"id\": 123,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"campaign_id\": 123,\n \"combatants\": {\n \"list\": [\n {\n \"_id\": \"<string>\",\n \"ally\": true,\n \"initiative\": 123,\n \"character\": 123,\n \"hazard_state\": {\n \"hp_current\": 1,\n \"disabled\": true\n }\n }\n ]\n },\n \"meta_data\": {\n \"description\": \"<string>\",\n \"party_level\": 123,\n \"party_size\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wanderersguide.app/functions/v1/create-encounter")
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 \"name\": \"<string>\",\n \"id\": 123,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"campaign_id\": 123,\n \"combatants\": {\n \"list\": [\n {\n \"_id\": \"<string>\",\n \"ally\": true,\n \"initiative\": 123,\n \"character\": 123,\n \"hazard_state\": {\n \"hp_current\": 1,\n \"disabled\": true\n }\n }\n ]\n },\n \"meta_data\": {\n \"description\": \"<string>\",\n \"party_level\": 123,\n \"party_size\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"name": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"icon": "<string>",
"color": "<string>",
"campaign_id": 123,
"combatants": {
"list": [
{
"_id": "<string>",
"type": "CREATURE",
"ally": true,
"initiative": 123,
"creature": {
"name": "<string>",
"level": 123,
"rarity": "COMMON",
"details": {
"image_url": "<string>",
"background_image_url": "<string>",
"description": "<string>",
"adjustment": "ELITE"
},
"content_source_id": 123,
"version": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "creature",
"traits": [
123
],
"operations": [
{}
],
"abilities_base": [
{
"name": "<string>",
"rarity": "COMMON",
"description": "<string>",
"type": "action",
"content_source_id": 123,
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"operations": [
{}
],
"actions": "ONE-ACTION",
"level": 123,
"availability": "STANDARD",
"prerequisites": [
"<string>"
],
"frequency": "<string>",
"cost": "<string>",
"trigger": "<string>",
"requirements": "<string>",
"access": "<string>",
"special": "<string>",
"meta_data": {
"source": {
"book": "<string>",
"page": "<string>",
"url": "<string>"
}
},
"traits": [
123
],
"version": "<string>"
}
],
"abilities_added": [
123
],
"inventory": {
"items": [
{}
],
"coins": {},
"eidolon_weapon_id": "<string>"
},
"spells": {},
"meta_data": {
"source": {
"book": "<string>",
"page": "<string>",
"url": "<string>"
},
"stat_block": {
"perception_note": "<string>",
"listed_senses": [
"<string>"
],
"trait_labels": {},
"languages_note": "<string>",
"skills_note": "<string>",
"listed_skills": [
"<string>"
],
"items_note": "<string>",
"defenses_note": "<string>",
"hp_note": "<string>",
"immunities_note": "<string>",
"resistances_note": "<string>",
"recall_knowledge": "<string>",
"omit_innate_attack": true,
"innate_spell_frequencies": {}
}
},
"deprecated": true
},
"character": 123,
"hazard": {
"id": 123,
"name": "<string>",
"level": 123,
"rarity": "COMMON",
"type": "hazard",
"details": {
"complexity": "SIMPLE",
"trait_labels": [
"<string>"
],
"stealth": "<string>",
"description": "<string>",
"disable": "<string>",
"activation": {
"name": "<string>",
"trigger": "<string>",
"effect": "<string>",
"actions": "ONE-ACTION",
"traits": [
"<string>"
]
},
"trait_ids": [
123
],
"defenses": {
"ac": 123,
"fort": 123,
"ref": 123,
"hardness": 123,
"hp": 123,
"bt": 123,
"immunities": "<string>"
},
"routine": {
"actions": 123,
"text": "<string>"
},
"reset": "<string>"
},
"content_source_id": 123,
"uuid": 123,
"version": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"meta_data": {
"source": {
"book": "<string>",
"page": "<string>",
"url": "<string>"
}
}
},
"hazard_state": {
"hp_current": 1,
"disabled": true
}
}
]
},
"meta_data": {
"description": "<string>",
"party_level": 123,
"party_size": 123
}
}
}Authorizations
API key created in your Wanderer's Guide account settings. Send as Authorization: Bearer <key>. Used for direct API access from external tools and scripts.
Body
application/json
⌘I
Create or update an encounter
curl --request POST \
--url https://api.wanderersguide.app/functions/v1/create-encounter \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"icon": "<string>",
"color": "<string>",
"campaign_id": 123,
"combatants": {
"list": [
{
"_id": "<string>",
"ally": true,
"initiative": 123,
"character": 123,
"hazard_state": {
"hp_current": 1,
"disabled": true
}
}
]
},
"meta_data": {
"description": "<string>",
"party_level": 123,
"party_size": 123
}
}
'import requests
url = "https://api.wanderersguide.app/functions/v1/create-encounter"
payload = {
"name": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"icon": "<string>",
"color": "<string>",
"campaign_id": 123,
"combatants": { "list": [
{
"_id": "<string>",
"ally": True,
"initiative": 123,
"character": 123,
"hazard_state": {
"hp_current": 1,
"disabled": True
}
}
] },
"meta_data": {
"description": "<string>",
"party_level": 123,
"party_size": 123
}
}
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({
name: '<string>',
id: 123,
created_at: '2023-11-07T05:31:56Z',
user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
icon: '<string>',
color: '<string>',
campaign_id: 123,
combatants: {
list: [
{
_id: '<string>',
ally: true,
initiative: 123,
character: 123,
hazard_state: {hp_current: 1, disabled: true}
}
]
},
meta_data: {description: '<string>', party_level: 123, party_size: 123}
})
};
fetch('https://api.wanderersguide.app/functions/v1/create-encounter', 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://api.wanderersguide.app/functions/v1/create-encounter",
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([
'name' => '<string>',
'id' => 123,
'created_at' => '2023-11-07T05:31:56Z',
'user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'icon' => '<string>',
'color' => '<string>',
'campaign_id' => 123,
'combatants' => [
'list' => [
[
'_id' => '<string>',
'ally' => true,
'initiative' => 123,
'character' => 123,
'hazard_state' => [
'hp_current' => 1,
'disabled' => true
]
]
]
],
'meta_data' => [
'description' => '<string>',
'party_level' => 123,
'party_size' => 123
]
]),
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://api.wanderersguide.app/functions/v1/create-encounter"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"id\": 123,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"campaign_id\": 123,\n \"combatants\": {\n \"list\": [\n {\n \"_id\": \"<string>\",\n \"ally\": true,\n \"initiative\": 123,\n \"character\": 123,\n \"hazard_state\": {\n \"hp_current\": 1,\n \"disabled\": true\n }\n }\n ]\n },\n \"meta_data\": {\n \"description\": \"<string>\",\n \"party_level\": 123,\n \"party_size\": 123\n }\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://api.wanderersguide.app/functions/v1/create-encounter")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"id\": 123,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"campaign_id\": 123,\n \"combatants\": {\n \"list\": [\n {\n \"_id\": \"<string>\",\n \"ally\": true,\n \"initiative\": 123,\n \"character\": 123,\n \"hazard_state\": {\n \"hp_current\": 1,\n \"disabled\": true\n }\n }\n ]\n },\n \"meta_data\": {\n \"description\": \"<string>\",\n \"party_level\": 123,\n \"party_size\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wanderersguide.app/functions/v1/create-encounter")
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 \"name\": \"<string>\",\n \"id\": 123,\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"icon\": \"<string>\",\n \"color\": \"<string>\",\n \"campaign_id\": 123,\n \"combatants\": {\n \"list\": [\n {\n \"_id\": \"<string>\",\n \"ally\": true,\n \"initiative\": 123,\n \"character\": 123,\n \"hazard_state\": {\n \"hp_current\": 1,\n \"disabled\": true\n }\n }\n ]\n },\n \"meta_data\": {\n \"description\": \"<string>\",\n \"party_level\": 123,\n \"party_size\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"name": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"icon": "<string>",
"color": "<string>",
"campaign_id": 123,
"combatants": {
"list": [
{
"_id": "<string>",
"type": "CREATURE",
"ally": true,
"initiative": 123,
"creature": {
"name": "<string>",
"level": 123,
"rarity": "COMMON",
"details": {
"image_url": "<string>",
"background_image_url": "<string>",
"description": "<string>",
"adjustment": "ELITE"
},
"content_source_id": 123,
"version": "<string>",
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "creature",
"traits": [
123
],
"operations": [
{}
],
"abilities_base": [
{
"name": "<string>",
"rarity": "COMMON",
"description": "<string>",
"type": "action",
"content_source_id": 123,
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"operations": [
{}
],
"actions": "ONE-ACTION",
"level": 123,
"availability": "STANDARD",
"prerequisites": [
"<string>"
],
"frequency": "<string>",
"cost": "<string>",
"trigger": "<string>",
"requirements": "<string>",
"access": "<string>",
"special": "<string>",
"meta_data": {
"source": {
"book": "<string>",
"page": "<string>",
"url": "<string>"
}
},
"traits": [
123
],
"version": "<string>"
}
],
"abilities_added": [
123
],
"inventory": {
"items": [
{}
],
"coins": {},
"eidolon_weapon_id": "<string>"
},
"spells": {},
"meta_data": {
"source": {
"book": "<string>",
"page": "<string>",
"url": "<string>"
},
"stat_block": {
"perception_note": "<string>",
"listed_senses": [
"<string>"
],
"trait_labels": {},
"languages_note": "<string>",
"skills_note": "<string>",
"listed_skills": [
"<string>"
],
"items_note": "<string>",
"defenses_note": "<string>",
"hp_note": "<string>",
"immunities_note": "<string>",
"resistances_note": "<string>",
"recall_knowledge": "<string>",
"omit_innate_attack": true,
"innate_spell_frequencies": {}
}
},
"deprecated": true
},
"character": 123,
"hazard": {
"id": 123,
"name": "<string>",
"level": 123,
"rarity": "COMMON",
"type": "hazard",
"details": {
"complexity": "SIMPLE",
"trait_labels": [
"<string>"
],
"stealth": "<string>",
"description": "<string>",
"disable": "<string>",
"activation": {
"name": "<string>",
"trigger": "<string>",
"effect": "<string>",
"actions": "ONE-ACTION",
"traits": [
"<string>"
]
},
"trait_ids": [
123
],
"defenses": {
"ac": 123,
"fort": 123,
"ref": 123,
"hardness": 123,
"hp": 123,
"bt": 123,
"immunities": "<string>"
},
"routine": {
"actions": 123,
"text": "<string>"
},
"reset": "<string>"
},
"content_source_id": 123,
"uuid": 123,
"version": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"meta_data": {
"source": {
"book": "<string>",
"page": "<string>",
"url": "<string>"
}
}
},
"hazard_state": {
"hp_current": 1,
"disabled": true
}
}
]
},
"meta_data": {
"description": "<string>",
"party_level": 123,
"party_size": 123
}
}
}
