Skip to main content

Utility

POST /select

Select token(s)

Selects one or more tokens in the Foundry VTT client.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
uuidsarraybodyArray of UUIDs to select
namestringbodyName of the token(s) to select
dataobjectbodyData to match for selection (e.g., "data.attributes.hp.value": 20)
overwritebooleanbodyWhether to overwrite existing selection
allbooleanbodyWhether to select all tokens on the canvas
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - The selected token(s)

Try It Out


GET /selected

Get selected token(s)

Retrieves the currently selected token(s) in the Foundry VTT client.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - The selected token(s)

Try It Out


GET /players

Get players/users

Retrieves a list of all users configured in the Foundry VTT world. Useful for discovering valid userId values for permission-scoped API calls.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - List of users with their IDs, names, roles, and active status

Try It Out


GET /world-info

Get comprehensive world information

Returns a single object with world name, game system, Foundry version, all modules (with active status), all users (with online status), and the active scene. Useful for API clients to discover the world state.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - World information object

Try It Out


POST /execute-js

Execute JavaScript

Executes a JavaScript script in the Foundry VTT client.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
scriptstringbodyJavaScript script to execute
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - The result of the executed script

Try It Out