Skip to content

APIs

Purple Cat has one API meant for users to write against, and a set of internal ones that self-hosters, module authors and contributors need to read.

Both are public. Which you want depends on what you are building.

Writing actions — start here

Action API

The JavaScript available inside an action script: what is in scope, what each function does, and worked examples. This is the one you want if you are automating an attack, a spell, a status effect, or anything else a token does.

You write action code in the app's editor, which has autocomplete for everything on that page and a Test panel that runs your code without sending anything to chat. Every function also has its own reference page.

Building against the platform

Developer APIs

Every API surface the platform exposes — the Module API a system module implements, the REST and realtime APIs the app talks to its server over, and the rest — with what each one is, whether it carries a version, and how much of a compatibility promise it makes.

Only the Module API is versioned and enforced. Everything else is internal: documented, readable, and free to change between releases.

If you are writing a module, Module Development is the practical guide; the developer index is the contract behind it.

How much you can rely on

API Promise
Action API Shipped and in use, but unversioned. It changes rarely, and breaking changes are called out in the changelog.
Module API Versioned and enforced. A module declares which platform versions it supports and the platform refuses to load one that does not fit.
REST / realtime Internal. Routes change between versions without notice. Read them if you are building against them, and expect to keep up.