> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# create

> Create a new video room.

Create a new video room.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/video/rooms:
    post:
      operationId: subpackageRooms_create_room
      summary: Create room
      description: >-
        Creates a reusable Video Room in the project for applications built with
        a SignalWire client SDK. Your server issues Room Tokens to participants
        and your application provides the client experience. For hosted guest
        and moderator access, use [Create video
        conference](/docs/apis/rest/video/video-conferences/create-video-conference).


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Video_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_rooms
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video.RoomResponse'
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode400'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '422':
          description: The request contains invalid parameters. See errors for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video.VideoStatusCode422'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Video.CreateRoomRequest'
tags:
  - name: subpackage_rooms
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    Video.VideoQuality:
      type: string
      enum:
        - 720p
        - 1080p
      description: Video quality resolution.
      title: Video.VideoQuality
    Video.RoomLayout:
      type: string
      enum:
        - grid-responsive
        - grid-responsive-mobile
        - highlight-1-responsive
        - 1x1
        - 2x1
        - 2x2
        - 5up
        - 3x3
        - 4x4
        - 5x5
        - 6x6
        - 8x8
        - 10x10
      description: The room's layout.
      title: Video.RoomLayout
    VideoCreateRoomRequestMeta:
      type: object
      properties: {}
      description: >-
        User-defined metadata for the room. Must be a valid JSON object. Maximum
        of 2000 characters when serialized.
      title: VideoCreateRoomRequestMeta
    Video.CreateRoomRequest:
      type: object
      properties:
        name:
          type: string
          pattern: ^[A-Za-z0-9_\-]+$
          maxLength: 100
          description: >-
            A named unique identifier for the room. Allowed characters:
            `A-Za-z0-9_-`. Maximum of 100 characters.
        display_name:
          type: string
          maxLength: 200
          description: >-
            Display name of the room. Maximum of 200 characters. Defaults to the
            value of name.
        description:
          type: string
          maxLength: 3000
          description: Description of the room. Maximum of 3000 characters.
        max_members:
          type: integer
          minimum: 1
          maximum: 300
          default: 20
          description: >-
            The maximum number of members in the room at a time. Must be at
            least 1 to a maximum of 300.
        quality:
          $ref: '#/components/schemas/Video.VideoQuality'
          default: 720p
          description: The room's resolution.
        join_from:
          type: string
          format: date-time
          description: >-
            Room does not accept new participants before this time. Expects RFC
            3339 datetime: `2022-01-01T23:59:60Z`. Date only: `2022-01-01` will
            be converted to `2022-01-01T00:00:00Z`.
        join_until:
          type: string
          format: date-time
          description: >-
            Room stops accepting new participants at this time, but keeps
            running until all participants leave. Expects RFC 3339 datetime:
            `2022-01-01T23:59:60Z`. Date only: `2022-01-01` will be converted to
            `2022-01-01T00:00:00Z`.
        remove_at:
          type: string
          format: date-time
          description: >-
            Remove users from the room at this time. Expects RFC 3339 datetime:
            `2022-01-01T23:59:60Z`. Date only: `2022-01-01` will be converted to
            `2022-01-01T00:00:00Z`.
        remove_after_seconds_elapsed:
          type: integer
          minimum: 1
          maximum: 200000
          description: Remove users after they are in the room for N seconds.
        layout:
          $ref: '#/components/schemas/Video.RoomLayout'
          default: grid-responsive
          description: The room's initial layout.
        record_on_start:
          type: boolean
          default: false
          description: >-
            Specifies whether to start recording a Room Session when one is
            started for this Room.
        enable_room_previews:
          type: boolean
          default: false
          description: >-
            Whether a video with a preview of the content of the room is to be
            generated.
        meta:
          $ref: '#/components/schemas/VideoCreateRoomRequestMeta'
          description: >-
            User-defined metadata for the room. Must be a valid JSON object.
            Maximum of 2000 characters when serialized.
        sync_audio_video:
          type: boolean
          description: Enable/disable jitter buffer audio-video sync.
      required:
        - name
      description: Request body for creating a room.
      title: Video.CreateRoomRequest
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    VideoRoomResponseMeta:
      type: object
      properties: {}
      description: User-defined metadata for the room.
      title: VideoRoomResponseMeta
    Video.VideoFps:
      type: string
      enum:
        - '20'
        - '30'
      description: Video frames per second.
      title: Video.VideoFps
    Video.RoomSessionStatus:
      type: string
      enum:
        - in-progress
        - completed
      description: Status of a room session.
      title: Video.RoomSessionStatus
    Video.ActiveSession:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the session.
        room_id:
          type: string
          description: >-
            Unique ID of the Room if the Session was created from a Room and was
            not an auto-created Session.
        name:
          type: string
          description: The named identifier of room session.
        display_name:
          type: string
          description: >-
            Display name of room, no character limitations. Maximum of 200
            characters. Defaults to the value of name.
        join_from:
          type: string
          format: date-time
          description: Room Session does not accept new Members before this time.
        join_until:
          type: string
          format: date-time
          description: Room Session stops accepting new Members at this time.
        remove_at:
          type: string
          format: date-time
          description: Remove Members from the Room Session at this time.
        remove_after_seconds_elapsed:
          type: integer
          description: Remove Members after they are in the Room Session for N seconds.
        layout:
          type: string
          description: >-
            The Room Session's initial layout. See documentation for a full list
            of supported layouts.
        max_members:
          type: integer
          description: The maximum number of members allowed in the room at a time.
        fps:
          $ref: '#/components/schemas/Video.VideoFps'
          description: The Room Session's frames per second.
        quality:
          $ref: '#/components/schemas/Video.VideoQuality'
          description: The Room Session's resolution.
        start_time:
          type: string
          format: date-time
          description: Start time of the session.
        end_time:
          type: string
          format: date-time
          description: End time of the session.
        duration:
          type: integer
          description: How long, in seconds, the Room Session lasted.
        status:
          $ref: '#/components/schemas/Video.RoomSessionStatus'
          description: Status of the session.
        record_on_start:
          type: boolean
          description: >-
            Whether a recording was automatically started when this Room Session
            began.
        enable_room_previews:
          type: boolean
          description: >-
            Whether a video with a preview of the content of the room is to be
            generated.
        preview_url:
          type: string
          description: >-
            If room previews are enabled and the room session is in progress,
            this is the URL of the preview video.
        audio_video_sync:
          type: boolean
          description: Enable/disable jitter buffer audio-video sync.
      description: Active session information for a room.
      title: Video.ActiveSession
    Video.RoomResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: A unique identifier for the room.
        name:
          type: string
          description: A named unique identifier for the room.
        display_name:
          type:
            - string
            - 'null'
          description: Display name of the room.
        description:
          type:
            - string
            - 'null'
          description: Description of the room.
        max_members:
          type: integer
          description: The maximum number of members in the room at a time.
        quality:
          $ref: '#/components/schemas/Video.VideoQuality'
          description: The room's resolution.
        fps:
          type: integer
          description: Frames per second parameter of room video quality.
        join_from:
          type:
            - string
            - 'null'
          format: date-time
          description: Room does not accept new participants before this time.
        join_until:
          type:
            - string
            - 'null'
          format: date-time
          description: Room stops accepting new participants at this time.
        remove_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Remove users from the room at this time.
        remove_after_seconds_elapsed:
          type:
            - integer
            - 'null'
          description: Remove users after they are in the room for N seconds.
        layout:
          $ref: '#/components/schemas/Video.RoomLayout'
          description: The room's initial layout.
        record_on_start:
          type: boolean
          description: >-
            Specifies whether to start recording a Room Session when one is
            started for this Room.
        tone_on_entry_and_exit:
          type: boolean
          description: Whether a tone is played when participants enter or exit the room.
        room_join_video_off:
          type: boolean
          description: Whether the room's video is turned off when participants join.
        user_join_video_off:
          type: boolean
          description: Whether a user's video is turned off when they join the room.
        enable_room_previews:
          type:
            - boolean
            - 'null'
          description: >-
            Whether a video with a preview of the content of the room is to be
            generated.
        sync_audio_video:
          type:
            - boolean
            - 'null'
          description: Enable/disable jitter buffer audio-video sync.
        meta:
          oneOf:
            - $ref: '#/components/schemas/VideoRoomResponseMeta'
            - type: 'null'
          description: User-defined metadata for the room.
        prioritize_handraise:
          type: boolean
          description: Whether hand raises are prioritized in the room layout.
        active_session:
          $ref: '#/components/schemas/Video.ActiveSession'
          description: Active session information for the room.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the room was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the room was last updated.
      required:
        - id
        - name
        - display_name
        - description
        - max_members
        - quality
        - fps
        - join_from
        - join_until
        - remove_at
        - remove_after_seconds_elapsed
        - layout
        - record_on_start
        - tone_on_entry_and_exit
        - room_join_video_off
        - user_join_video_off
        - enable_room_previews
        - sync_audio_video
        - meta
        - prioritize_handraise
        - created_at
        - updated_at
      description: Room response object.
      title: Video.RoomResponse
    TypesStatusCodesStatusCode400Error:
      type: string
      enum:
        - Bad Request
      title: TypesStatusCodesStatusCode400Error
    Types.StatusCodes.StatusCode400:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode400Error'
      required:
        - error
      description: The request is invalid.
      title: Types.StatusCodes.StatusCode400
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    Types.StatusCodes.RestApiErrorItem:
      type: object
      properties:
        type:
          type: string
          description: The category of error.
        code:
          type: string
          description: A specific error code.
        message:
          type: string
          description: A description of what caused the error.
        attribute:
          type:
            - string
            - 'null'
          description: The request parameter that caused the error, if applicable.
        url:
          type: string
          description: A link to documentation about this error.
      required:
        - type
        - code
        - message
        - url
      description: Details about a specific error.
      title: Types.StatusCodes.RestApiErrorItem
    Video.VideoStatusCode422:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Types.StatusCodes.RestApiErrorItem'
          description: List of validation errors.
      required:
        - errors
      description: The request contains invalid parameters. See errors for details.
      title: Video.VideoStatusCode422
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500

```

## **Response Example**

### Response (200)

```json
{
  "id": "c22d24f6-5a47-4597-9a23-c7d01e696b92",
  "name": "my_room",
  "display_name": "My Room's Name",
  "description": "This room will be used for full company all hands meetings",
  "max_members": 20,
  "quality": "720p",
  "fps": 20,
  "join_from": "2022-01-01T00:00:00Z",
  "join_until": "2022-12-31T23:59:59Z",
  "remove_at": "2022-12-31T23:59:59Z",
  "remove_after_seconds_elapsed": 120,
  "layout": "grid-responsive",
  "record_on_start": false,
  "tone_on_entry_and_exit": true,
  "room_join_video_off": false,
  "user_join_video_off": false,
  "enable_room_previews": false,
  "sync_audio_video": true,
  "meta": {},
  "prioritize_handraise": false,
  "created_at": "2022-01-01T10:00:00Z",
  "updated_at": "2022-01-01T11:00:00Z",
  "active_session": {
    "id": "c22d24f6-5a47-4597-9a23-c7d01e696b92",
    "room_id": "a1b2c3d4-5e6f-7890-abcd-ef1234567890",
    "name": "my_example_room",
    "display_name": "My Room's Name",
    "join_from": "2022-01-01T00:00:00Z",
    "join_until": "2022-12-31T23:59:59Z",
    "remove_at": "2022-12-31T23:59:59Z",
    "remove_after_seconds_elapsed": 120,
    "layout": "grid-responsive",
    "max_members": 20,
    "fps": 20,
    "quality": "720p",
    "start_time": "2022-01-01T10:00:00Z",
    "end_time": "2022-01-01T11:00:00Z",
    "duration": 120,
    "status": "completed",
    "record_on_start": true,
    "enable_room_previews": true,
    "preview_url": "https://example.signalwire.com/api/video/room_sessions/c22d24f6-5a47-4597-9a23-c7d01e696b92/preview",
    "audio_video_sync": true
  }
}
```

## **Example**

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

room = client.video.rooms.create(name="standup", max_members=10)
```