Ban a user from a channel

​

Bans a user from a channel. Any live connection for that user on this channel is force-disconnected. A ban is independent of membership — banning does not remove the member row, so combine a ban with a remove if you want both kick and lock. expiresAt (ISO 8601) is optional; omit it for a ban that does not auto-expire.

Path Parameters

  • The channel id. Channels are not created explicitly — they exist by being used.

Body·

required
application/json
  • Optional ban expiry (RFC 3339). Omit for a ban that does not auto-expire.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/channels/{channelId}/bans
curl https://api.useportal.co/v1/channels/chat-general/bans \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "userId": "u_456",
  "expiresAt": "2026-08-19T00:00:00.000Z"
}'
{}