{"openapi":"3.1.0","info":{"title":"Alea Master API","version":"1.0.0","description":"Read-only access to your own Alea Master data — characters, campaigns, live session notes, NPC history, quest history and encounters — so you can point your own AI at it.\n\nA key acts as its owner and reads everything that account can see, GM secrets included. Requires an Alea Master Premium subscription. Create a key under Account ▸ API access."},"servers":[{"url":"https://www.aleamaster.com/api/v1"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Authorization: Bearer am_live_…"}}},"security":[{"apiKey":[]}],"paths":{"/me":{"get":{"summary":"Account info","description":"The key owner, their plan, the key's scopes and campaign count.","parameters":[],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns":{"get":{"summary":"List campaigns","description":"Every campaign, newest first, with per-entity counts.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}":{"get":{"summary":"Campaign overview","description":"The campaign plus its active session, latest session and open quests. Start here.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/sessions":{"get":{"summary":"List sessions","description":"Ordered by session number.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/sessions/{session}":{"get":{"summary":"One session","description":"The session plus every live note recorded during it.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"session","in":"path","required":true,"schema":{"type":"string"},"description":"Id, title, or session number."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/notes":{"get":{"summary":"Live session notes","description":"The notes the DM typed at the table, oldest first. NOT the same as /notes, which is the personal scratch-note collection.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"sessionId","in":"query","required":false,"schema":{"type":"string"},"description":"Limit to one session — id, title, or session number."},{"name":"marker","in":"query","required":false,"schema":{"type":"string"},"description":"Marker id: chapter, consequence, callback, unresolved, secret, future_hook, or a custom one."},{"name":"since","in":"query","required":false,"schema":{"type":"string"},"description":"ISO timestamp — only notes at or after it."},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Free-text search across note content and tags."},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/recap":{"get":{"summary":"Session recap (Markdown)","description":"A session's live notes rendered as Markdown, ready to summarise. Defaults to the active session. This is the same recap the app itself exports.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"sessionId","in":"query","required":false,"schema":{"type":"string"},"description":"Id, title, or session number."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/npcs":{"get":{"summary":"List campaign NPCs","description":"Roster summaries.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/npcs/{npc}":{"get":{"summary":"One NPC","description":"Full NPC including secrets, embedded stat block, and `interactions` — the per-session history of everywhere this NPC has come up.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"npc","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/quests":{"get":{"summary":"List quests","description":"Optionally filtered by status.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"active, dormant, failed, completed, hidden or time_sensitive."},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/quests/{quest}":{"get":{"summary":"One quest","description":"Full quest including `history` — every logged development — plus the DM prep fields (unresolved threads, consequences, next trigger).","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"quest","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/campaigns/{campaign}/events":{"get":{"summary":"Campaign timeline","description":"Timeline events, oldest first.","parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/characters":{"get":{"summary":"List characters","description":"Without campaignId: every character on the account. WITH campaignId: every character in that campaign, including the ones owned by invited players — those are reachable only through the campaign roster, never through a character's own campaignId field, which is null on invited sheets. Each item carries `ownerUserId` and `source` (\"own\" or \"party\"). A campaign the key has no claim on returns an empty list.","parameters":[{"name":"campaignId","in":"query","required":false,"schema":{"type":"string"},"description":"Campaign id, or a name of a campaign you own."},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/characters/{character}":{"get":{"summary":"One character","description":"The full sheet, searching your own characters first and then every campaign you can reach. Base64 portrait images are replaced by `hasPortraitImage`. The private DM↔player message thread is returned only for your OWN character and only with include=messages; on anyone else's character the flag is ignored.","parameters":[{"name":"character","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."},{"name":"campaignId","in":"query","required":false,"schema":{"type":"string"},"description":"Narrow the search to one campaign — use when two players share a name."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated. Only \"messages\" is recognised."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/encounters":{"get":{"summary":"List encounters","description":"Saved and in-progress encounters.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/encounters/{encounter}":{"get":{"summary":"One encounter","description":"Full combatant list with HP, AC and conditions.","parameters":[{"name":"encounter","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/npcs":{"get":{"summary":"List stat blocks","description":"The account-wide NPC stat-block library (not campaign NPCs).","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/npcs/{npc}":{"get":{"summary":"One stat block","description":"Full stat block.","parameters":[{"name":"npc","in":"path","required":true,"schema":{"type":"string"},"description":"An id, an exact name, or a unique partial name (case-insensitive)."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/notes":{"get":{"summary":"List personal notes","description":"The standalone scratch-note collection. For notes taken during play see /campaigns/{campaign}/notes.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max items to return (default 50, max 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Items to skip."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}},"/notes/{note}":{"get":{"summary":"One personal note","description":"Full note body.","parameters":[{"name":"note","in":"path","required":true,"schema":{"type":"string"},"description":"Id or title."}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, unknown, revoked or expired key"},"403":{"description":"The owning account is not Premium"},"404":{"description":"No such resource"},"409":{"description":"The name matched more than one resource — use an id"},"429":{"description":"Rate limit exceeded (2000 requests per hour)"}}}}}}