Add a device
POST /server/v1/agent/create
Authentication: required (see Overview)
Register external devices such as SIP / H.323 phones, GB28181 surveillance devices, and RTSP streams under your app; then you can use
“Invite devices to the channel” to bring them into a channel. The response is the device ID—save it;
you need it to update, delete, and query details later.
Request body fields vary with the URL query parameter type (each integration type has different required fields); what to pass for each of the six integration types
is listed below by value. For how to choose an integration type, see the “Device integration guide”.
URL query parameters
Request parameters
The request body fields depend on the URL query parameter type. The fields for each value are listed below.
type=ipsip — SIP phone, direct IP
Display name; the device’s display name after it joins the channel (max length 100)
Example:
3rd-floor meeting room phoneDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=regsip — SIP phone, registration mode
Username; the account the device uses to register with the gateway; must not contain : (max length 100)
Example:
6001Display name; the device’s display name after it joins the channel (max length 100)
Example:
3rd-floor meeting room phoneDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=iph323 — H.323 endpoint, direct IP
Display name; the device’s display name after it joins the channel (max length 100)
Example:
3rd-floor meeting room endpointDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=regh323 — H.323 endpoint, registration mode
Display name; the device’s display name after it joins the channel (max length 100)
Example:
3rd-floor meeting room endpointDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=gb28181 — GB28181 surveillance device
Device SIP number, 18–20 digits; can be generated with “Generate a GB28181 device SIP number” (max length 20)
Example:
33010806661328458475Password; must match the GB28181 settings on the device (max length 50)
Example:
Abc123456Channel number → name: the video feeds under one device. After registration, you can also add or change them with “Set a GB28181 device channel”
Example:
{"33010806661329301268":"Guest seats"}Display name; the device’s display name after it joins the channel (max length 100)
Example:
Dome camera 1Device gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=rtsp — RTSP stream pull
RTSP stream URL; must start with rtsp (max length 100)
Example:
rtsp://192.168.1.70:554/stream1Display name; the device’s display name after it joins the channel (max length 100)
Example:
Lobby cameraDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1Update a device
POST /server/v1/agent/update
Authentication: required (see Overview)
Update the connection info or display name of a registered device. The request body fields are the same as for “Add a device” (they vary with type),
plus the device id; the full fields for each value are listed below.
- type must match how the device was originally integrated; you can’t use this to turn a SIP device into an RTSP one. To change the integration type, delete the device and register it again
- Changes take effect the next time the device connects; devices currently in a channel are not affected
type. The fields for each value are listed below.
type=ipsip — SIP phone, direct IP (update)
Device ID, from the response of “Add a device” or from “List devices” (max length 64)
Example:
sw8kjxDisplay name; the device’s display name after it joins the channel (max length 100)
Example:
3rd-floor meeting room phoneDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=regsip — SIP phone, registration mode (update)
Device ID, from the response of “Add a device” or from “List devices” (max length 64)
Example:
sw8kjxUsername; the account the device uses to register with the gateway; must not contain : (max length 100)
Example:
6001Display name; the device’s display name after it joins the channel (max length 100)
Example:
3rd-floor meeting room phoneDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=iph323 — H.323 endpoint, direct IP (update)
Device ID, from the response of “Add a device” or from “List devices” (max length 64)
Example:
sw8kjxDisplay name; the device’s display name after it joins the channel (max length 100)
Example:
3rd-floor meeting room endpointDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=regh323 — H.323 endpoint, registration mode (update)
Device ID, from the response of “Add a device” or from “List devices” (max length 64)
Example:
sw8kjxDisplay name; the device’s display name after it joins the channel (max length 100)
Example:
3rd-floor meeting room endpointDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=gb28181 — GB28181 surveillance device (update)
Device ID, from the response of “Add a device” or from “List devices” (max length 64)
Example:
sw8kjxDevice SIP number, 18–20 digits; can be generated with “Generate a GB28181 device SIP number” (max length 20)
Example:
33010806661328458475Password; must match the GB28181 settings on the device (max length 50)
Example:
Abc123456Channel number → name: the video feeds under one device. After registration, you can also add or change them with “Set a GB28181 device channel”
Example:
{"33010806661329301268":"Guest seats"}Display name; the device’s display name after it joins the channel (max length 100)
Example:
Dome camera 1Device gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1type=rtsp — RTSP stream pull (update)
Device ID, from the response of “Add a device” or from “List devices” (max length 64)
Example:
sw8kjxRTSP stream URL; must start with rtsp (max length 100)
Example:
rtsp://192.168.1.70:554/stream1Display name; the device’s display name after it joins the channel (max length 100)
Example:
Lobby cameraDevice gateway. For values, see “List device gateways” (max length 60)
Example:
devgw-1Set a GB28181 device channel
POST /server/v1/agent/set-gb28181-subject
Authentication: required (see Overview)
Add or update a channel of a GB28181 device (one GB28181 device can have multiple camera channels).
If the channel number already exists, its name is updated; otherwise a new channel is added.
You can also pass them in bulk with subjects when calling “Add a device”.
Request parameters
Device ID, from the response of “Add a device” or from “List devices” (max length 64)
Example:
sw8kjxChannel number; must match the device’s actual configuration. Can be generated automatically per the standard with “Generate a GB28181 channel number” (max length 20)
Example:
50010700001320000001GB28181 channel name, used in the channel to tell apart the different video feeds of the same device (max length 100)
Example:
Guest seatsdata is null
Response example:
Delete a GB28181 device channel
POST /server/v1/agent/del-gb28181-subject
Authentication: required (see Overview)
Delete one channel of a GB28181 device. The device itself is not affected; the GB28181 channel simply can no longer be invited to a channel.
If the GB28181 channel is currently in a channel, it is removed from that channel first.
Request parameters
Request example:
data is null
Response example:
Generate a GB28181 channel number
POST /server/v1/agent/gen-gb28181-subject
Authentication: required (see Overview)
Generate an unused channel number for the specified device according to the GB28181 standard, so you avoid format errors when building numbers yourself
or conflicts with existing channels.
The generated number is only returned to you and is not registered automatically—after getting it, you still need to call “Set a GB28181 device channel”
and provide the channel name.
Request parameters
Request example:
Generate a GB28181 device SIP number
POST /server/v1/agent/gen-gb28181-sip-no
Authentication: required (see Overview)
Generate an unused GB28181 device SIP number for registering a new GB28181 device (sip_no when type=gb28181).
No request parameters.
Likewise, this only returns a number and doesn’t create a device automatically.
Request parameters
None
Response parameters
Response example:
Control GB28181 device PTZ (direction and zoom)
POST /server/v1/agent/gb28181-ptz
Authentication: required (see Overview)
Control the PTZ (direction and zoom) of a GB28181 camera.
command supports up/down/left/right/zoomin/zoomout/stop, and a ”+” combination of two actions (such as left+up).
Speed ranges from 0 to 255: when speed_h/speed_v/speed_zoom is 0 it falls back to speed; when speed is also 0, the
gateway default speed of 50 is used.
The device must already be registered with “Add a device” (type gb28181); otherwise the gateway it belongs to can’t be located.
Request parameters
Device number, the SIP number of a GB28181 device (max length 20)
Example:
33010806661328458475Channel number; must match the device configuration. Can be generated with “Generate a GB28181 channel number” (max length 20)
Example:
33010806661329301268data is null
Response example:
Manage GB28181 device preset positions
POST /server/v1/agent/gb28181-preset
Authentication: required (see Overview)
Operate the preset positions of a GB28181 camera: set saves the current position, goto moves to a preset position, and delete removes a preset position;
all three actions require the preset number num (1–255).
As with “Control GB28181 device PTZ (direction and zoom)”, the device must already be registered.
Request parameters
Device number, the SIP number of a GB28181 device (max length 20)
Example:
33010806661328458475Preset action: set saves the current position, goto moves to the preset position, delete removes the preset position
Example:
gotodata is null
Response example:
List device gateways
POST /server/v1/agent/list-gw
Authentication: required (see Overview)
List the available device gateways. Call this before registering a device to get the value for gw.
A device gateway is the translation layer between external devices and RTC: SIP, H.323, and GB28181 each have their own signaling protocol,
which the gateway handles, converting the media into a format RTC can use. Different gateways support different integration types,
so filter with type; for values, see the “Device integration guide”.
URL query parameters
Filter by integration type; returns only gateways that support it. For values, see the “Device integration guide”
Node load piggybacked on the most recent heartbeat (empty for older gateways that don’t report it)
List device gateway platform info
POST /server/v1/agent/list-gw-info
Authentication: required (see Overview)
Get the gateway’s platform-side info for configuring the device side.
The typical use is GB28181 integration: a GB28181 camera needs the “upstream platform” SIP number, domain, IP, and
port filled in on the device side. Take these values from here and enter them on the camera’s GB28181 settings page so the device can register.
How this differs from “List device gateways”: that one answers “which gateways do we have”; this one answers “to connect a device to a given gateway,
what should be filled in on the device side”.
URL query parameters
Integration type; different types return different platform info fields. For values, see the “Device integration guide”
Node load piggybacked on the most recent heartbeat (empty for older gateways that don’t report it)
Call a gateway API
POST /server/v1/agent/call-gw-api
Authentication: required (see Overview)
Pass a call through to the device gateway’s own API, for troubleshooting and operations scenarios the regular endpoints don’t cover
(such as querying the gateway’s internal state or triggering a device reconnect). The data in the response is what the gateway returns, as is.
This is a low-level endpoint for operations: the values of api and params depend on the gateway version, with no stability guarantee.
Don’t rely on it in business code; prefer the other named endpoints in this group.
Request parameters
Request example:
Delete a device
POST /server/v1/agent/delete
Authentication: required (see Overview)
Delete a registered device. The data in the response is the ID of the deleted device.
If the device is currently in a channel, it is removed from the channel first. After deletion, the same physical device can be registered again,
but it gets a new device ID.
Request parameters
Request example:
Get device details
POST /server/v1/agent/detail
Authentication: required (see Overview)
Query the details of a single device, including connection parameters, the gateway it belongs to, and online status.
The device id comes from the response of “Add a device” or from “List devices”.
Request parameters
Request example:
List devices
POST /server/v1/agent/list-invite
Authentication: required (see Overview)
List the devices available for invitation with pagination, typically so users can pick devices in your UI.
Each channel of a GB28181 device takes its own entry. The contact (device identifier) in the response is the value to pass to
“Invite devices to the channel”.
Request parameters
Agent type: 2 SIP, 3 H.323, 4 GB28181 surveillance, 5 RTSP stream pull
Example:
2,4Keyword; fuzzy-matches the display name and device identifier (max length 100)
Example:
meeting roomInvite devices to the channel
POST /server/v1/agent/invite
Authentication: required (see Overview)
Bring devices into a channel; you can invite several at once. Take each device’s type and contact from “List devices”.
Devices join asynchronously: a successful response only means the invitation has been sent; the device is actually online when the user_join
callback arrives (the device’s uid has the agent prefix). Inviting a device that is already in the channel doesn’t bring it in again.
The agent_join callback is triggered before the device accepts the invitation. If you subscribe to this event, you must return sid as required,
otherwise the device can’t join the channel—see the “Callback events guide” for details.
SIP / H323 devices do not support share_enabled=true: if any one of them passes it, the whole request returns error code 1037 and no device is called.
Request parameters
Target room: for an SMeeting app, the meeting room number room_no (not meeting_id); for an SRTC app, the channel name
Example:
021890611data is null
Response example:
Turn device video on or off
POST /server/v1/agent/set-camera-enabled
Authentication: required (see Overview)
Turn a device’s camera on or off. Unlike a regular client, a device can’t operate this itself; it can only be controlled from the server.
If you subscribe to the agent_operate callback, this operation first asks your backend, and a non-zero response means rejection;
if you don’t subscribe, it is allowed by default.
Request parameters
In-channel user ID of the device; omit to apply to all devices in the channel. Has the agent prefix; get it from “List online or offline users” or the user_join callback (letters, digits, underscores (_), and hyphens (-) only)
Example:
_agent_co63jg6g54hu3b0xhtieChannel name (up to 64 bytes; letters, digits, underscores (_), and hyphens (-) only)
Example:
firedata is null
Response example:
Turn device audio on or off
POST /server/v1/agent/set-mic-enabled
Authentication: required (see Overview)
Turn a device’s microphone on or off; same semantics as “Turn device video on or off”.
Request parameters
In-channel user ID of the device; omit to apply to all devices in the channel. Has the agent prefix (letters, digits, underscores (_), and hyphens (-) only)
Example:
_agent_co63jg6g54hu3b0xhtieChannel name (up to 64 bytes; letters, digits, underscores (_), and hyphens (-) only)
Example:
firedata is null
Response example:
Send DTMF to a device
POST /server/v1/agent/send-dtmf
Authentication: required (see Overview)
Send key presses (DTMF) to a SIP / H323 device in a call, for navigating voice menus, entering a third-party meeting password, and so on.
The device presses the keys in digits one by one; a successful response only means the request was handed to the device gateway, without waiting for the keys to finish.
If you only need to enter a meeting password once when joining, it is simpler to pass dtmf in “Invite a device to join”.
Request parameters
In-channel user ID of the device, with the agent prefix; get it from “List online or offline users” or the user_join callback (letters, digits, underscores (_), and hyphens (-) only)
Example:
_agent_co63jg6g54hu3b0xhtieName of the channel the device is in (up to 64 bytes; letters, digits, underscores (_), and hyphens (-) only)
Example:
fireKey sequence; only 0-9 * # A-D are allowed, a comma means a 0.5-second pause, up to 64 characters (max length 64)
Example:
1#How long each key is pressed (optional), in milliseconds; omit or 0 for the default 160, minimum 40
Example:
160data is null
Response example:
Switch the video a device watches
POST /server/v1/agent/switch-subscribe
Authentication: required (see Overview)
After joining, a device watches the MCU composite picture by default. Call this API to make it watch a specific member’s camera or screen share instead,
and switch back to the composite picture at any time. The device stays in the channel and the phone call is not dropped; only the incoming video changes.
You can switch even if the target member has not turned on the camera or joined yet: the device keeps its current picture and shows the new one automatically once the member starts publishing.
Switching again before the previous switch completes (usually within a second or two) returns an error; just retry a moment later.
Requires device gateway 1.4.1 or later.
Request parameters
In-channel user ID of the device, with the agent prefix; get it from “List online or offline users” or the user_join callback (letters, digits, underscores (_), and hyphens (-) only)
Example:
_agent_co63jg6g54hu3b0xhtieName of the channel the device is in (up to 64 bytes; letters, digits, underscores (_), and hyphens (-) only)
Example:
fireWhom the device should watch: the user ID of another member in the channel. Omit it, pass an empty string or pass mcu to switch back to the MCU composite picture (the device’s default after joining) (max length 64)
Example:
1001Which video of that member to watch: camera_big (camera main stream), camera_small (camera sub stream), screen (screen share). Required when sub_uid is a regular member; ignored when switching back to the composite picture (max length 32)
Example:
camera_bigdata is null
Response example:
Turn device sharing on or off
POST /server/v1/agent/set-share-enabled
Authentication: required (see Overview)
Turn a device’s screen sharing on or off. With enabled=true: stream-pulling devices such as RTSP / GB28181 publish their main picture as screen sharing (screen) instead,
clients in the channel see it just like regular screen sharing, and the MCU composite layout also shows it as a share.
SIP / H323 endpoints cannot start sharing remotely, and enabled=true returns error code 1037: to share, press the share button (dual-stream / content key) on the endpoint.
With enabled=false the device’s screen sharing is withdrawn and stream-pulling devices switch back to the camera picture; dual-stream content the SIP / H323 endpoint started itself is withdrawn, and the endpoint is asked to give up the presentation token where possible.
This API only makes the device send / withdraw a share; it does not enforce sharing exclusivity. If only one person may share in the channel at a time,
check this in your business backend before calling. Requires a device gateway version that supports externally started sharing.
Request parameters
In-channel user ID of the device, with the agent prefix; get it from “List online or offline users” or the user_join callback (letters, digits, underscores (_), and hyphens (-) only)
Example:
_agent_co63jg6g54hu3b0xhtieName of the channel the device is in (up to 64 bytes; letters, digits, underscores (_), and hyphens (-) only)
Example:
firetrue starts sharing, false stops it. SIP / H323 endpoints cannot start sharing remotely: passing true returns 1037 (to share, press the share button on the endpoint); passing false stops the dual-stream content the endpoint is sending
Example:
truedata is null
Response example:
Turn device speaker on or off
POST /server/v1/agent/set-speaker-enabled
Authentication: required (see Overview)
Turn the device speaker on or off: whether the meeting audio is played out of the device; the counterpart of “Turn device audio on or off” (whether the device microphone’s audio goes into the meeting).
SIP / H323 endpoints: turns on or off the meeting audio sent to the endpoint; GB28181 cameras: on = start a GB28181 voice broadcast, off = end the broadcast;
RTSP and other pull-stream devices have no speaker, so the call has no effect. For the initial value when the device joins, see speaker_enabled in “Invite devices to the channel”.
Requires a device gateway version that supports the device speaker switch.
Request parameters
In-channel user ID of the device, with the agent prefix; get it from “List online or offline users” or the user_join callback (letters, digits, underscores (_), and hyphens (-) only)
Example:
_agent_co63jg6g54hu3b0xhtieName of the channel the device is in (up to 64 bytes; letters, digits, underscores (_), and hyphens (-) only)
Example:
firetrue plays the meeting audio through the device speaker, false stops it. For SIP / H323, this turns on or off the meeting audio sent to the endpoint; for GB28181, on = start a voice broadcast, off = end the broadcast; RTSP and other pull-stream devices have no speaker, so the call has no effect
Example:
truedata is null
Response example: