Skip to content

Content

Part of the Server API — not a stable public interface yet; see the note there.

Entities are the app’s generic content objects — monsters, spells, items, and whatever else the loaded game system defines. The path segment is the collection label from the system’s entity definitions, so it varies by system. In D&D 5e: characters, monsters, npcs, spells, items, feats, backgrounds, species, races, classes, subclasses, vehicles, rules.

An unknown collection is a 404 — fetch /api/system to discover what the loaded system offers. The app’s own paths take some names (pages, maps, groups, encounters, combatants, tokens, tiles, lights, markers, measurements, area-effects, messages, assets, references, modules, campaigns, clients, system, session, server, import, game, contents, files): a system collection with one of those labels can’t be reached here, and loading the system logs a warning.

GET /api/{collection} A page of the loaded system’s entries
POST /api/{collection} Creates an entry in the system’s library
GET /api/modules/{id}/{collection} A page of a module’s entries
POST /api/modules/{id}/{collection} Creates an entry in a module
GET, POST /api/campaigns/{id}/{collection} The same for a campaign
GET /api/{collection}/{id} One entry
PUT /api/{collection}/{id} Replaces it
PATCH /api/{collection}/{id} Changes part of it (merge patch)
DELETE /api/{collection}/{id} Deletes it

An entry is the Entity model, the same going in and coming out, so what a client read can be sent back changed:

{
"id": "2f1c…", "kind": "Monster", "system": "dnd5e", "moduleId": "8a0e…",
"name": "Goblin", "slug": "goblin", "type": "humanoid",
"data": { "ac": 15, "hp": 7 },
"tags": ["small"], "created": "2026-11-22T10:00:00Z", "modified": "2026-11-22T10:00:00Z"
}

The server owns id, kind, system, moduleId, campaignId, created, modified, appVersion, systemVersion and meta: they are sent, and ignored when written. visibility is the entry’s own visibility. kind comes from the collection, and an entry stays in the container it was created in. A combatant has its own address and is never part of the body.

data is checked the way the entity editor checks it on Save: against the type’s model schema when the system declares one — only the keys that change, so keys an older system version wrote survive — and saved as given when it doesn’t. A schema refusing it is a 422 that lists why in errors.

One page of library entries, { entries, total }, filtered and sorted exactly as queryEntities answers: the collection’s kind and the kinds extending it. The nested paths list a module’s or campaign’s entries alone.

Terminal window
curl 'http://192.168.1.42:8080/api/monsters?keys=list'

The parameters are those of queryEntities: search, sort, offset, limit, where as a JSON object, and keys and ids comma separated — keys=list for the system’s list keys, alone or with paths (keys=list,data.weight,view.data.evasion). A parameter that can’t be read is a 400 saying why. Entries carry only the data. and view. paths keys asks for; fetch one entity for its whole body. An entry carries the entity’s own visibility when it has one.

Terminal window
curl -G 'http://192.168.1.42:8080/api/items' \
--data-urlencode 'where={"data.skill": ["axes", "swords"]}' \
--data-urlencode 'keys=data.skill,data.weight' \
--data-urlencode 'limit=20'

Creates an entry and answers 201 with it, its address in Location. The body needs a name; everything else is optional, and the server’s fields are ignored, so a copy is a GET, an edit and a POST:

Terminal window
curl -X POST http://192.168.1.42:8080/api/modules/8a0e…/monsters \
-H 'Authorization: Bearer epk_…' -H 'Content-Type: application/json' \
-d '{"name": "Goblin Boss", "data": {"hp": 21}}'

A slug that another entry of the kind already has in the same container gets a number: goblin-2. Without a slug, the name’s is used.

One entry, with an ETag. Sending that back in If-None-Match answers 304 while the entry is unchanged. An entry that isn’t of the collection’s kind is a 404 — so /api/spells/<a-monster-id> is not a monster — and so is one the client may not see.

The computed values a view shows (the entity’s rendering context) are no longer a separate representation: ask the collection for them with ids and view. keys, /api/monsters?ids=2f1c…&keys=view.data.ac.

Replaces what a body can write — the name, slug, type, descriptions, images, data, attributes, modifiers, tags and sources — and answers 200 with the entry. A key left out is cleared, except slug: without one the entry keeps its address, which links, copies and tokens hold. The body’s id is ignored; the path names the entry.

A JSON Merge Patch (application/merge-patch+json; plain application/json works too): objects merge key by key, null removes a key, and anything else — arrays included — replaces. It is the entry with the patch merged in, written as a PUT, so it is checked the same way. This is the request for “set current HP” and similar edits:

Terminal window
curl -X PATCH http://192.168.1.42:8080/api/monsters/2f1c… \
-H 'Authorization: Bearer epk_…' -H 'Content-Type: application/merge-patch+json' \
-d '{"data": {"hp": 12, "conditions": null}}'

Deletes the entry and answers 204. Its image and token files go too, unless another entry uses them.

PUT, PATCH and DELETE take If-Match with the ETag a client read: if the entry changed since, the write is refused with 412 and nothing changes, so a script can’t overwrite an edit the GM made meanwhile. Without If-Match the write always goes ahead.

Writes notify the app, so open views redraw, and a unique entity’s linked combatant takes over its ranges and the status effects of linked flags. They need write on everything — the GM and API keys with write. A player can’t use them, and a sheet writes through entity subscriptions instead, where every write needs a schema.

GET /api/modules and GET /api/campaigns list the loaded system’s modules and campaigns as { entries, total }, sorted by name. search (part of the name) and ids (comma separated) narrow the list, offset and limit page it, and the entity-only where, sort and keys are 400. GET /api/modules/{id} and GET /api/campaigns/{id} read one: the Module and Campaign models. Their content is under the nested paths. A module or campaign hidden from players is missing for them, and hides what it holds — see Visibility.

Both can be written, {collection} being modules or campaigns:

POST /api/{collection} Creates one: 201 + Location
PUT /api/{collection}/{id} Replaces what can be written
PATCH /api/{collection}/{id} A merge patch
DELETE /api/{collection}/{id} Deletes an empty one: 204
Terminal window
curl -X POST http://192.168.1.20:8080/api/modules \
-H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d '{ "name": "The Sunless Citadel", "acronym": "TSC", "category": "adventure", "author": "Me" }'
  • name is required. A module’s version is 1.0.0 unless sent, and its category is one of adventure, pack, rules, compendium or other (400).
  • id, system and systemVersion are the server’s: a new one gets a fresh id and the loaded system, and neither ever moves to another system.
  • A campaign’s play state is the app’s, sent and never written: party, assetModules, its game, its players, and whether it is the campaign being played. A new campaign has none of it.
  • The slug is unique among modules, or among campaigns — a second “Lost Mine” is lost-mine-2 — and a body without one keeps it, since links (/module/<slug>/page/…) hold it.
  • image and banner are paths in the folder; upload them to files/image and files/banner. A path outside the folder is 422, unless it is the one already stored.
  • The images and videos its pages and entities link go into its folder through /api/{modules|campaigns}/{id}/files, which also lists what the folder holds.
  • DELETE removes only one that holds nothing — no pages, groups, maps, encounters, references, assets, tables or entities — and never the campaign being played. Otherwise it is 409: delete its items first, or delete it in the app, which takes all of it and its files.
  • A module installed from a package can be written like any other, but updating the package replaces it.

GET /api/modules/{id}/contents and GET /api/campaigns/{id}/contents answer a container’s whole tree in one read, and GET /api/contents the system library’s. It is flat, as module archives carry it: every kind of item under its collection’s name, each list by rank, then name.

{
"pages": [{ "id": "P1", "name": "Introduction", "slug": "introduction", "parentId": "G1", "rank": 0 }],
"groups": [{ "id": "G1", "name": "Chapter 1", "slug": "chapter-1", "parentId": "", "rank": 0 }],
"maps": [],
"encounters": [],
"references": [],
"assets": []
}

An item sits under the item its parentId names, of any kind (pages hold subpages); "" is the top. Its address is /api/{collection}/{id}, for the collections served so far. Read only, with an ETag. An entry carries the item’s own visibility when it has one, and the tree leaves out what the client may not see: an item shown inside a hidden one keeps its parentId, naming an item the tree doesn’t hold.

/api/pages, /api/groups, /api/encounters and /api/references work like entities: GET and POST on the collection, nested under /api/modules/{id}/ and /api/campaigns/{id}/, and GET, PUT, PATCH and DELETE on /api/{collection}/{id}. The bodies are the Page, Group, Encounter and Reference models, as archives carry them, with moduleId and campaignId added:

{
"id": "P1",
"name": "Introduction",
"slug": "introduction",
"content": "# Introduction\n\nThe road to Phandalin…",
"format": "markdown",
"parentId": "G1",
"rank": 0,
"moduleId": "6F0A…"
}
  • content is Markdown or HTML, as format says (no format is HTML). It links images by a path relative to its container’s folder (images/cave.png); upload them to the folder first.
  • An encounter’s combatants is its roster, one list: { reference, label?, name?, role?, x?, y? }, where reference is the creature’s address (/monster/goblin) and role hostile, friendly or neutral. An entry that can’t be read is 400.
  • A reference is a named link placed in the tree: reference is an app address, /kind/slug or longer (/monster/bugbear, /page/intro), with no scheme or host (400 otherwise). Its target needn’t exist, as in the app: modules link to content that may not be installed.
  • parentId must name an item in the same module, campaign or library, and must not put an item inside itself (422). A body without parentId or rank keeps them; a new item without a rank goes after its siblings.
  • The slug is unique per kind and container (intro-2), and a body without one keeps the address.
  • An item that still holds others can’t be deleted (409): move or delete them first.

GET /api/{collection} answers summaries, { id, name, slug, parentId, rank, visibility?, moduleId?, campaignId? }, by rank. parentId narrows the list to one level of the tree (parentId= the top), beside search, ids, offset and limit; where, sort and keys are 400. Without a module or campaign the list covers all of the loaded system’s, and its library.

/api/assets serves a container’s map artwork the same way, nested too, and in the tree like pages: parentId, rank and the list parameters are as above. The body is the Asset model with moduleId and campaignId added:

{
"id": "A1",
"name": "Wooden Door",
"slug": "wooden-door",
"type": "image",
"resource": "wooden-door.png",
"parameters": { "size": "1x2" },
"tags": ["door"],
"moduleId": "6F0A…"
}
  • type is image, pattern, spriteSheet, animatedImage or video; anything else is 400. parameters hold its settings, components its filters and animations (an unknown component type is 400).
  • resource is the file’s path inside the container. Upload a file to files/resource rather than setting it; a body may point it at a file the container already has, but a path that leaves the container (.., /…) is 422.
  • These are a container’s assets. The copies tokens and tiles draw with belong to their map object and aren’t served here.

/api/tables serves roll tables the same way, nested too. The body is the Table model with moduleId and campaignId added. Tables aren’t in a container’s tree, so they have no parentId or rank.

  • columns needs at least one column, and every row in rows one cell per column, at most 1,000 rows. Both are 422, with the rows that are off in errors.
  • rollMode is normal, noRepeat or eachRow; anything else is 400.
  • rolls is the no-repeat history, which [] clears.

Lists answer { id, name, slug, descr?, visibility?, moduleId?, campaignId? } by name, narrowed by search and ids.

Every entity, page, group, map, encounter, reference, asset, table, module and campaign has a visibility in its body: "gm" hides it from players and guests, "players" shows it, and none — left out, or null — follows what it sits in:

Item Without its own
Entity Hidden if its type (visibility) or its module or campaign hides it
Page, group, map, encounter, reference, asset The item its parentId names, then its module or campaign
Table Its module or campaign
Module, campaign Shown

Every list entry carries the item’s own visibility when it has one — entities, content, tables, modules and campaigns alike. It is the item’s own setting only: an item that follows a hidden group or module has none in its entry, though players can’t see it.

A client whose access is scoped — a player, a guest — gets only what it may see: a hidden item is a 404, the same as one that doesn’t exist, and so are its files and, for a map, its objects; lists and contents leave it out, and total counts what is left. A hidden module’s or campaign’s own address is a 404, but its nested paths still list what in it says "players". A player always sees their own characters. The GM and API keys see everything.

Anyone who may write sets it: PATCH with { "visibility": "gm" } hides an item, null makes it follow again. A PUT replaces it like any field, so a body without it follows. A value other than gm, players or null is 400. The play the GM runs — the map being played, what the screen shows — isn’t affected.

visibility is access, and is enforced the same over REST, the WebSocket and MCP. The hidden flag of a token, a combatant or a marker is something else: what the table shows right now, which the GM toggles to time a reveal. It isn’t access. Every client that may read gets hidden objects like any other, with hidden: true, and decides what to draw — the web client and the player display leave them out.

Offers a piece of content to the device for import. This is the network counterpart of the encounterplus://import URL scheme, and takes the same parameters — either as a JSON body or as a query string:

Terminal window
curl -X POST 'http://192.168.1.42:8080/api/import' \
-H 'Content-Type: application/json' \
-d '{"manifest": "https://example.com/packages/dnd5e.json"}'
Terminal window
curl -X POST 'http://192.168.1.42:8080/api/import?url=https%3A%2F%2Fexample.com%2Fmaps%2Fcave.uvtt'

Exactly one source must be given. Providing one in the body and one in the query is rejected, as is a source the app will not accept.

202 Accepted means the import screen is now on the device’s display — not that anything was imported. Only the person at the app can confirm it, which is what keeps an open port from being a way to install content on someone else’s iPad. There is no way to poll for the outcome.

It is POST rather than GET deliberately: a GET would fire from an <img src> on any page a user on the network happened to load.