Skip to main content

utility

POST /select​

Select token(s) Selects one or more tokens in the Foundry VTT client.

Parameters​

NameTypeRequiredSourceDescription
clientIdstring✓queryClient 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

Returns​

object - The selected token(s)

Example Request​

POST /select
Content-Type: application/json

{
"uuids": [
"example"
],
"name": "example-value"
}

GET /selected​

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

Parameters​

NameTypeRequiredSourceDescription
clientIdstring✓queryClient ID for the Foundry world

Returns​

object - The selected token(s)

Example Request​

GET /selected


POST /execute-js​

Execute JavaScript Executes a JavaScript script in the Foundry VTT client.

Parameters​

NameTypeRequiredSourceDescription
clientIdstring✓queryClient ID for the Foundry world
scriptstringbodyJavaScript script to execute

Returns​

object - The result of the executed script

Example Request​

POST /execute-js
Content-Type: application/json

{
"script": "example-value"
}