Twilio Participants API

Manage room participants

Documentation

Specifications

Other Resources

OpenAPI Specification

twilio-participants-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Twilio - Accounts A2p Participants API
  description: This is the public Twilio REST API.
  termsOfService: https://www.twilio.com/legal/tos
  contact:
    name: Twilio Support
    url: https://support.twilio.com
    email: support@twilio.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.52.0
servers:
- url: https://accounts.twilio.com
tags:
- name: Participants
  description: Manage room participants
paths:
  /Rooms/{RoomSid}/Participants:
    get:
      operationId: listParticipants
      summary: Twilio List Room Participants
      description: Retrieve a list of participants who have connected to a room.
      tags:
      - Participants
      parameters:
      - $ref: '#/components/parameters/RoomSid'
      - name: Status
        in: query
        schema:
          type: string
          enum:
          - connected
          - disconnected
      - name: Identity
        in: query
        schema:
          type: string
      - name: PageSize
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
      responses:
        '200':
          description: List of participants
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoParticipantList'
        '404':
          description: Room not found
  /Rooms/{RoomSid}/Participants/{ParticipantSid}:
    get:
      operationId: fetchParticipant
      summary: Twilio Fetch a Participant
      tags:
      - Participants
      parameters:
      - $ref: '#/components/parameters/RoomSid'
      - $ref: '#/components/parameters/ParticipantSid'
      responses:
        '200':
          description: Participant details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoParticipant'
        '404':
          description: Participant not found
    post:
      operationId: updateParticipant
      summary: Twilio Disconnect a Participant
      description: Remove a participant from a room by setting their status to disconnected.
      tags:
      - Participants
      parameters:
      - $ref: '#/components/parameters/RoomSid'
      - $ref: '#/components/parameters/ParticipantSid'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - Status
              properties:
                Status:
                  type: string
                  enum:
                  - disconnected
      responses:
        '200':
          description: Participant disconnected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoParticipant'
  /Rooms/{RoomSid}/Participants/{ParticipantSid}/PublishedTracks:
    get:
      operationId: listPublishedTracks
      summary: Twilio List Published Tracks
      description: List the tracks a participant has published to a room.
      tags:
      - Participants
      parameters:
      - $ref: '#/components/parameters/RoomSid'
      - $ref: '#/components/parameters/ParticipantSid'
      responses:
        '200':
          description: List of published tracks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishedTrackList'
  /Rooms/{RoomSid}/Participants/{ParticipantSid}/SubscribeRules:
    get:
      operationId: fetchSubscribeRules
      summary: Twilio Fetch Subscribe Rules
      tags:
      - Participants
      parameters:
      - $ref: '#/components/parameters/RoomSid'
      - $ref: '#/components/parameters/ParticipantSid'
      responses:
        '200':
          description: Subscribe rules
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscribeRules'
    post:
      operationId: updateSubscribeRules
      summary: Twilio Update Subscribe Rules
      description: Update the subscribe rules for a participant to control which tracks they receive.
      tags:
      - Participants
      parameters:
      - $ref: '#/components/parameters/RoomSid'
      - $ref: '#/components/parameters/ParticipantSid'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                Rules:
                  type: string
                  description: JSON array of subscribe rules
      responses:
        '200':
          description: Subscribe rules updated
components:
  schemas:
    PublishedTrack:
      type: object
      properties:
        sid:
          type: string
          pattern: ^MT[0-9a-fA-F]{32}$
        participant_sid:
          type: string
          pattern: ^PA[0-9a-fA-F]{32}$
        room_sid:
          type: string
          pattern: ^RM[0-9a-fA-F]{32}$
        name:
          type: string
          description: Track name
        kind:
          type: string
          enum:
          - audio
          - video
          - data
        enabled:
          type: boolean
        date_created:
          type: string
          format: date-time
        date_updated:
          type: string
          format: date-time
        url:
          type: string
          format: uri
    PaginationMeta:
      type: object
      properties:
        page:
          type: integer
        page_size:
          type: integer
        first_page_url:
          type: string
          format: uri
        previous_page_url:
          type: string
          format: uri
        next_page_url:
          type: string
          format: uri
        url:
          type: string
          format: uri
        key:
          type: string
    VideoParticipant:
      type: object
      properties:
        sid:
          type: string
          pattern: ^PA[0-9a-fA-F]{32}$
          description: Unique identifier for the participant
        room_sid:
          type: string
          pattern: ^RM[0-9a-fA-F]{32}$
        account_sid:
          type: string
          pattern: ^AC[0-9a-fA-F]{32}$
        identity:
          type: string
          description: User identity of the participant
        status:
          type: string
          enum:
          - connected
          - disconnected
        duration:
          type: integer
          description: Duration the participant was connected
        start_time:
          type: string
          format: date-time
        end_time:
          type: string
          format: date-time
        date_created:
          type: string
          format: date-time
        date_updated:
          type: string
          format: date-time
        url:
          type: string
          format: uri
        links:
          type: object
          properties:
            published_tracks:
              type: string
              format: uri
            subscribe_rules:
              type: string
              format: uri
            subscribed_tracks:
              type: string
              format: uri
    VideoParticipantList:
      type: object
      properties:
        participants:
          type: array
          items:
            $ref: '#/components/schemas/VideoParticipant'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    SubscribeRules:
      type: object
      properties:
        participant_sid:
          type: string
        room_sid:
          type: string
        rules:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                - include
                - exclude
              all:
                type: boolean
              kind:
                type: string
                enum:
                - audio
                - video
                - data
              publisher:
                type: string
              track:
                type: string
        date_created:
          type: string
          format: date-time
        date_updated:
          type: string
          format: date-time
    PublishedTrackList:
      type: object
      properties:
        published_tracks:
          type: array
          items:
            $ref: '#/components/schemas/PublishedTrack'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
  parameters:
    ParticipantSid:
      name: ParticipantSid
      in: path
      required: true
      description: The SID of the participant
      schema:
        type: string
        pattern: ^PA[0-9a-fA-F]{32}$
    RoomSid:
      name: RoomSid
      in: path
      required: true
      description: The SID or unique name of the room
      schema:
        type: string
  securitySchemes:
    accountSid_authToken:
      type: http
      scheme: basic
x-maturity:
- name: GA
  description: This product is Generally Available.
- name: Beta
  description: PLEASE NOTE that this is a Beta product that is subject to change. Use it with caution.