Canvas Video Layout State
Canvas configuration, views, render mode and mirror mode state backing the SDK Canvas capability.
Group overview
Generated at build time from the public REST API definition: tag canvas, 9 operations (out of 230). For authentication, envelope and pagination conventions see REST API overview.
| Method | Path | Summary |
|---|---|---|
GET | /v1/canvas/canvases | List canvases |
POST | /v1/canvas/canvases | Create a canvas |
GET | /v1/canvas/canvases/{canvasId} | Read a canvas with its views |
DELETE | /v1/canvas/canvases/{canvasId} | Destroy a canvas |
PATCH | /v1/canvas/canvases/{canvasId}/config | Set canvas configs |
GET | /v1/canvas/canvases/{canvasId}/views | List canvas views |
POST | /v1/canvas/canvases/{canvasId}/views | Add a view |
PATCH | /v1/canvas/canvases/{canvasId}/views/{uid} | Update one view |
DELETE | /v1/canvas/canvases/{canvasId}/views/{uid} | Remove a view |
Operation details
GET /v1/canvas/canvases
List canvases
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
channelName | query | string | ||
state | query | enum(active | destroyed) |
Response
| Status codes | Description / schema |
|---|---|
200 | OK — object{ canvases } |
400 | Invalid parameter — Error |
Example call
curl -s -X GET "$NIMEET_API_BASE/v1/canvas/canvases?channelName=weekly-sync&state=running" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/canvas/canvases
Create a canvas
One active canvas per (project, channel, ownerUid); a duplicate answers canvas_conflict with the existing canvasId. Owner null (or omitted) means a channel-wide shared layout.
Authentication: project credentials (Base64 of customerId:customerSecret)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
channelName | string | is | pattern ^[A-Za-z0-9_-]{1,128}$ |
ownerUid | integer | null | 1..2147483647 | |
videoRenderMode | enum(hidden | fit | adaptive) | ||
videoMirrorMode | enum(auto | enabled | disabled) | ||
backgroundColor | string |
{
"channelName": "weekly-sync",
"ownerUid": 1,
"videoRenderMode": "hidden"
}Response
| Status codes | Description / schema |
|---|---|
201 | OK — CanvasDetail |
400 | Invalid parameter — Error |
409 | Canvas already exists (canvas_conflict) — Error |
Example call
curl -s -X POST "$NIMEET_API_BASE/v1/canvas/canvases" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"channelName":"weekly-sync","ownerUid":1,"videoRenderMode":"hidden"}'GET /v1/canvas/canvases/{canvasId}
Read a canvas with its views
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
canvasId | path | is | string |
Response
| Status codes | Description / schema |
|---|---|
200 | OK — CanvasDetail |
404 | Unknown canvas (canvas_not_found) — Error |
Example call
curl -s -X GET "$NIMEET_API_BASE/v1/canvas/canvases/canvasId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"DELETE /v1/canvas/canvases/{canvasId}
Destroy a canvas
Moves the canvas to destroyed. The layout stays readable for forensics, but every write afterwards answers canvas_destroyed.
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
canvasId | path | is | string |
Response
| Status codes | Description / schema |
|---|---|
200 | OK — CanvasRecord |
404 | Unknown canvas (canvas_not_found) — Error |
409 | Canvas already destroyed (canvas_destroyed) — Error |
Example call
curl -s -X DELETE "$NIMEET_API_BASE/v1/canvas/canvases/canvasId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PATCH /v1/canvas/canvases/{canvasId}/config
Set canvas configs
Agora setConfigs / setVideoRenderMode / setVideoMirrorMode. At least one field is required.
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
canvasId | path | is | string |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
videoRenderMode | enum(hidden | fit | adaptive) | ||
videoMirrorMode | enum(auto | enabled | disabled) | ||
backgroundColor | string |
{
"videoRenderMode": "hidden",
"videoMirrorMode": "auto",
"backgroundColor": "string"
}Response
| Status codes | Description / schema |
|---|---|
200 | OK — CanvasDetail |
400 | Invalid parameter — Error |
404 | Unknown canvas (canvas_not_found) — Error |
409 | Canvas is destroyed (canvas_destroyed) — Error |
Example call
curl -s -X PATCH "$NIMEET_API_BASE/v1/canvas/canvases/canvasId/config" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"videoRenderMode":"hidden","videoMirrorMode":"auto","backgroundColor":"string"}'GET /v1/canvas/canvases/{canvasId}/views
List canvas views
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
canvasId | path | is | string |
Response
| Status codes | Description / schema |
|---|---|
200 | OK — object{ count, views } |
404 | Unknown canvas (canvas_not_found) — Error |
Example call
curl -s -X GET "$NIMEET_API_BASE/v1/canvas/canvases/canvasId/views" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/canvas/canvases/{canvasId}/views
Add a view
Agora addView(ViewInfo). Re-adding the same uid replaces the existing view (setupMode=replace), matching the SDK ViewInfo set semantics.
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
canvasId | path | is | string |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
uid | integer | is | 1..2147483647 |
subviewUid | integer | null | 1..2147483647 | |
videoRenderMode | enum(hidden | fit | adaptive) | ||
videoMirrorMode | enum(auto | enabled | disabled) | ||
sourceType | enum(video | screen | mediaPlayer) | ||
mediaPlayerId | integer | null | 0..9999 | |
position | object{ x, y, width, height, zOrder } | ||
backgroundColor | string |
{
"uid": 1,
"subviewUid": 1,
"videoRenderMode": "hidden"
}Response
| Status codes | Description / schema |
|---|---|
201 | OK — CanvasView |
400 | Invalid parameter — Error |
404 | Unknown canvas (canvas_not_found) — Error |
409 | Canvas is destroyed (canvas_destroyed) — Error |
Example call
curl -s -X POST "$NIMEET_API_BASE/v1/canvas/canvases/canvasId/views" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"uid":1,"subviewUid":1,"videoRenderMode":"hidden"}'PATCH /v1/canvas/canvases/{canvasId}/views/{uid}
Update one view
Agora setViewConfig (the replace branch of addView:config:).
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
canvasId | path | is | string | |
uid | path | is | integer | 1..2147483647 |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
subviewUid | integer | null | 1..2147483647 | |
videoRenderMode | enum(hidden | fit | adaptive) | ||
videoMirrorMode | enum(auto | enabled | disabled) | ||
sourceType | enum(video | screen | mediaPlayer) | ||
mediaPlayerId | integer | null | 0..9999 | |
position | object{ x, y, width, height, zOrder } | ||
backgroundColor | string |
{
"subviewUid": 1,
"videoRenderMode": "hidden",
"videoMirrorMode": "auto"
}Response
| Status codes | Description / schema |
|---|---|
200 | OK — CanvasView |
400 | Invalid parameter — Error |
404 | Unknown canvas or view (canvas_view_not_found) — Error |
409 | Canvas is destroyed (canvas_destroyed) — Error |
Example call
curl -s -X PATCH "$NIMEET_API_BASE/v1/canvas/canvases/canvasId/views/10001" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"subviewUid":1,"videoRenderMode":"hidden","videoMirrorMode":"auto"}'DELETE /v1/canvas/canvases/{canvasId}/views/{uid}
Remove a view
Agora removeView(ViewInfo). Removing an absent view is a 404, not a silent success.
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
canvasId | path | is | string | |
uid | path | is | integer | 1..2147483647 |
Response
| Status codes | Description / schema |
|---|---|
204 | view removed |
404 | Unknown canvas or view (canvas_view_not_found) — Error |
409 | Canvas is destroyed (canvas_destroyed) — Error |
Example call
curl -s -X DELETE "$NIMEET_API_BASE/v1/canvas/canvases/canvasId/views/10001" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"Schemas used by this group
CanvasConfig — object{ videoRenderMode, videoMirrorMode, backgroundColor, renderModeCode, mirrorModeCode }
| Field | Type | Required | Description |
|---|---|---|---|
videoRenderMode | enum(hidden | fit | adaptive) | is | |
videoMirrorMode | enum(auto | enabled | disabled) | is | |
backgroundColor | string | is | |
renderModeCode | integer | is | Agora numeric code: hidden=1, fit=2, adaptive=3. |
mirrorModeCode | integer | is | Agora numeric code: auto=0, enabled=1, disabled=2. |
CanvasDetail — object
| Field | Type | Required | Description |
|---|---|---|---|
canvasId | string | is | |
projectId | string | ||
channelName | string | is | |
ownerUid | integer | null | ||
state | enum(active | destroyed) | is | |
config | object{ videoRenderMode, videoMirrorMode, backgroundColor, renderModeCode, mirrorModeCode } | is | |
viewCount | integer | >= 0 | |
views | array<object> | is | |
createdAt | string | format date-time | |
updatedAt | string | format date-time | |
destroyedAt | string | null | format date-time |
CanvasPosition — object{ x, y, width, height, zOrder }
| Field | Type | Required | Description |
|---|---|---|---|
x | number | is | |
y | number | is | |
width | number | is | |
height | number | is | |
zOrder | integer | is |
CanvasRecord — object
| Field | Type | Required | Description |
|---|---|---|---|
canvasId | string | is | |
projectId | string | is | |
channelName | string | is | |
ownerUid | integer | null | ||
state | enum(active | destroyed) | is | |
config | object{ videoRenderMode, videoMirrorMode, backgroundColor, renderModeCode, mirrorModeCode } | is | |
viewCount | integer | is | >= 0 |
createdAt | string | format date-time | |
updatedAt | string | format date-time | |
destroyedAt | string | null | format date-time |
CanvasView — object
| Field | Type | Required | Description |
|---|---|---|---|
uid | integer | is | >= 1 |
subviewUid | integer | null | ||
renderMode | enum(hidden | fit | adaptive) | is | |
mirrorMode | enum(auto | enabled | disabled) | is | |
renderModeCode | integer | ||
mirrorModeCode | integer | ||
sourceType | enum(video | screen | mediaPlayer) | is | |
mediaPlayerId | integer | null | ||
position | object{ x, y, width, height, zOrder } | is | |
backgroundColor | string | null | ||
setupMode | enum(add | replace) | is | |
updatedAt | string | is | format date-time |
Error — object{ code, message, reason, sdkCode, details }
| Field | Type | Required | Description |
|---|---|---|---|
code | string | is | stable machine code, see errors.json |
message | string | is | |
reason | string | ||
sdkCode | integer | Agora-aligned client error number | |
details | object |