Skip to main content

Encounter

GET /encounters

Get all active encounters

Retrieves a list of all currently active encounters in the Foundry world.

Parameters

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

Returns

array - An array of active encounters with details

Try It Out


POST /start-encounter

Start a new encounter

Initiates a new encounter in the Foundry world.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
tokensarraybodyArray of token UUIDs to include in the encounter
startWithSelectedbooleanbodyWhether to start with selected tokens
startWithPlayersbooleanbodyWhether to start with players
rollNPCbooleanbodyWhether to roll for NPCs
rollAllbooleanbodyWhether to roll for all tokens
namestringbodyThe name of the encounter
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - Details of the started encounter

Try It Out


POST /next-turn

Advance to the next turn in the encounter

Moves the encounter to the next turn.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
encounterstringbody, queryThe ID of the encounter (optional, defaults to current encounter)
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - Details of the next turn

Try It Out


POST /next-round

Advance to the next round in the encounter

Moves the encounter to the next round.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
encounterstringbody, queryThe ID of the encounter (optional, defaults to current encounter)
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - Details of the next round

Try It Out


POST /last-turn

Go back to the last turn in the encounter

Moves the encounter back to the last turn.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
encounterstringbody, queryThe ID of the encounter (optional, defaults to current encounter)
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - Details of the last turn

Try It Out


POST /last-round

Go back to the last round in the encounter

Moves the encounter back to the last round.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
encounterstringbody, queryThe ID of the encounter (optional, defaults to current encounter)
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - Details of the last round

Try It Out


POST /end-encounter

End an encounter

Ends the current encounter in the Foundry world.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
encounterstringbody, queryThe ID of the encounter (optional, defaults to current encounter)
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - Details of the ended encounter

Try It Out


POST /add-to-encounter

Add tokens to an encounter

Adds selected tokens or specified UUIDs to the current encounter.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
encounterstringbody, queryThe ID of the encounter (optional, defaults to current encounter)
selectedbooleanquery, bodyWhether to get the selected entity
uuidsarraybodyThe UUIDs of the tokens to add
rollInitiativebooleanbodyWhether to roll initiative for the added tokens
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - Details of the updated encounter

Try It Out


POST /remove-from-encounter

Remove tokens from an encounter

Removes selected tokens or specified UUIDs from the current encounter.

Parameters

NameTypeRequiredSourceDescription
clientIdstringqueryClient ID for the Foundry world
encounterstringbody, queryThe ID of the encounter (optional, defaults to current encounter)
selectedbooleanquery, bodyWhether to get the selected entity
uuidsarraybodyThe UUIDs of the tokens to remove
userIdstringquery, bodyFoundry user ID or username to scope permissions (omit for GM-level access)

Returns

object - Details of the updated encounter

Try It Out