Skip to content
Start here

Kick participants from an active session

client.RealtimeKit.ActiveSession.KickParticipants(ctx, appID, meetingID, params) (*ActiveSessionKickParticipantsResponse, error)
POST/accounts/{account_id}/realtime/kit/{app_id}/meetings/{meeting_id}/active-session/kick

Kicks one or more participants from an active session using user ID or custom participant ID.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appID string

The app identifier tag.

maxLength32
meetingID string
params ActiveSessionKickParticipantsParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
CustomParticipantIDs param.Field[[]string]

Body param

ParticipantIDs param.Field[[]string]

Body param

ReturnsExpand Collapse
type ActiveSessionKickParticipantsResponse struct{…}
Data ActiveSessionKickParticipantsResponseDataoptional
Action stringoptional
Participants []ActiveSessionKickParticipantsResponseDataParticipantoptional
ID string

ID of the session participant

CreatedAt string
UpdatedAt string
Email stringoptional

Email of the session participant.

Name stringoptional

Name of the session participant.

Picture stringoptional

A URL pointing to a picture of the participant.

Success booloptional

Kick participants from an active session

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/realtime_kit"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.RealtimeKit.ActiveSession.KickParticipants(
    context.TODO(),
    "app_id",
    "meeting_id",
    realtime_kit.ActiveSessionKickParticipantsParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
      CustomParticipantIDs: cloudflare.F([]string{"string"}),
      ParticipantIDs: cloudflare.F([]string{"string"}),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "action": "action",
    "participants": [
      {
        "id": "id",
        "created_at": "created_at",
        "updated_at": "updated_at",
        "email": "email",
        "name": "name",
        "picture": "picture"
      }
    ]
  },
  "success": true
}
{
  "error": {
    "code": 404,
    "message": "No user found with id 813432c7-3c5a-45e2-9acf-eef7061c7584"
  },
  "success": false
}
Returns Examples
{
  "data": {
    "action": "action",
    "participants": [
      {
        "id": "id",
        "created_at": "created_at",
        "updated_at": "updated_at",
        "email": "email",
        "name": "name",
        "picture": "picture"
      }
    ]
  },
  "success": true
}
{
  "error": {
    "code": 404,
    "message": "No user found with id 813432c7-3c5a-45e2-9acf-eef7061c7584"
  },
  "success": false
}