Canvas
GET /canvas/:documentType
Get canvas embedded documents
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| documentType | string | ✓ | params | Type of canvas document (tokens, tiles, drawings, lights, sounds, notes, templates, walls, regions) |
| clientId | string | query | Client ID for the Foundry world | |
| sceneId | string | query | Scene ID to query (defaults to the active scene) | |
| documentId | string | query | Specific document ID to retrieve | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
array - Array of embedded documents
Try It Out
GET /measure-distance
Measure the distance between two points or tokens
Calculates the distance between two positions on the canvas, respecting the grid type and measurement rules. Points can be specified as coordinates or by referencing tokens by UUID or name.
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| clientId | string | query | Client ID for the Foundry world | |
| originX | number | body, query | Origin x coordinate (optional if originUuid/originName provided) | |
| originY | number | body, query | Origin y coordinate | |
| targetX | number | body, query | Target x coordinate (optional if targetUuid/targetName provided) | |
| targetY | number | body, query | Target y coordinate | |
| originUuid | string | body, query | UUID of the origin token | |
| originName | string | body, query | Name of the origin token | |
| targetUuid | string | body, query | UUID of the target token | |
| targetName | string | body, query | Name of the target token | |
| sceneId | string | body, query | Scene ID (defaults to active scene) | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
object - Distance measurement including units and grid spaces
Try It Out
POST /canvas/:documentType
Create canvas embedded document(s)
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| documentType | string | ✓ | params | Type of canvas document (tokens, tiles, drawings, lights, sounds, notes, templates, walls, regions) |
| data | object | ✓ | body | Document data object or array of objects to create |
| clientId | string | query | Client ID for the Foundry world | |
| sceneId | string | body, query | Scene ID to create in (defaults to the active scene) | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
object - Created document(s)
Try It Out
PUT /canvas/:documentType
Update a canvas embedded document
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| documentType | string | ✓ | params | Type of canvas document (tokens, tiles, drawings, lights, sounds, notes, templates, walls, regions) |
| documentId | string | ✓ | body, query | ID of the document to update |
| data | object | ✓ | body | Object containing the fields to update |
| clientId | string | query | Client ID for the Foundry world | |
| sceneId | string | body, query | Scene ID containing the document (defaults to the active scene) | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
object - Updated document
Try It Out
DELETE /canvas/:documentType
Delete a canvas embedded document
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| documentType | string | ✓ | params | Type of canvas document (tokens, tiles, drawings, lights, sounds, notes, templates, walls, regions) |
| documentId | string | ✓ | query | ID of the document to delete |
| clientId | string | query | Client ID for the Foundry world | |
| sceneId | string | query | Scene ID containing the document (defaults to the active scene) | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
object - Deletion result
Try It Out
POST /move-token
Move a token to specific coordinates
Moves a token on the canvas to the specified x,y position, optionally animating through waypoints. Token can be identified by UUID or name.
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| x | number | ✓ | body, query | Target x coordinate |
| y | number | ✓ | body, query | Target y coordinate |
| clientId | string | query | Client ID for the Foundry world | |
| uuid | string | body, query | UUID of the token to move (optional if name provided) | |
| name | string | body, query | Name of the token to move (optional if uuid provided) | |
| waypoints | array | body, query | Array of waypoint objects with x and y coordinates to animate through before reaching final position | |
| animate | boolean | body, query | Whether to animate the movement (default: true) | |
| sceneId | string | body, query | Scene ID (defaults to active scene) | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
object - Result of the token movement including new position