Logo
API_DOC API Documentation

Remove Peer

POST {{HOST}}/v2/active-rooms/:room_id/remove-peers

You can use this API to remove/disconnect a connected peer from an active room. 100ms provides options to disconnect a peer either with their peer_id or role.

  1. If peer_id is specified -- respective connected peer will be disconnected from the active room.
  2. If the role is specified -- all the connected peers assigned with that particular role will be disconnected from the active room.
  3. If both peer_id and role are specified -- preference will be given to the peer_id and the respective peer will be disconnected from the active room.
  4. If both peer_id and role are not specified -- you must specify peer_id or role for this request.

Arguments

Name Type Description Required
room_id
— path param
string Unique identifier of the room to which the peer is connected.

Example: 627cda81ab4f3b56a077dc33
Yes
peer_id
— body param
string Unique identifier of the connected peer/participant you wish to remove from the active room.

Example: fd9e87d8-5c7b-4750-932f-d8d2ff18b70b
Conditional
role
— body param
string You can use this to remove a list of connected peers with the specified role type from the active room. Conditional
reason
— body param
string You can specify the message to be passed to other connected peers in the active room. No

Note: Conditional Arguments

You should define either of these arguments (peer_id or role) in the payload for the request to be successful.

Why would you use this API?

  • Use this API to remove a peer from an active room for misconduct (e.g., abusive chat). This can be combined with custom logic not to generate app tokens for this user to block them from future joins.

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 




RESPONSES

status





Curl
curl -X POST 'https://api.100ms.live/v2/active-rooms/:room_id/remove-peers' -d '{"peer_id":"","role":"student","reason":"Removed due to misconduct"}'

ENDPOINTS