---
title: "Creates a room"
method: POST
path: "/room"
tags: ["room"]
---

# Creates a room

`POST /room`

## Request body

- RoomConfig — Room configuration
  - `maxPeers` integer, nullable — Maximum amount of peers allowed into the room
  - `videoCodec` 'h264' | 'vp8', nullable — Enforces video codec for each peer in the room
  - `webhookUrl` string, nullable — URL where Jellyfish notifications will be sent

## Response `201`

Room successfully created

- RoomCreateDetailsResponse — Response containing room details
  - `data` object, required
    - `jellyfish_address` string, required — Jellyfish instance address where the room was created. This might be different than the address of Jellyfish where the request was sent only when running a cluster of Jellyfishes.
    - `room` Room, required — Description of the room state
      - `components` Component[], required — List of all components
        - union — Describes component
          - object — Describes the HLS component
            - `id` string, required — Assigned component ID
            - `properties` ComponentPropertiesHLS, required — Properties specific to the HLS component
              - …
            - `type` string, required — Component type
          - object — Describes the RTSP component
            - `id` string, required — Assigned component ID
            - `properties` ComponentPropertiesRTSP, required — Properties specific to the RTSP component
            - `type` string, required — Component type
          - object — Describes the File component
            - `id` string, required — Assigned component ID
            - `type` string, required — Component type
      - `config` RoomConfig, required — Room configuration
        - `maxPeers` integer, nullable — Maximum amount of peers allowed into the room
        - `videoCodec` 'h264' | 'vp8', nullable — Enforces video codec for each peer in the room
        - `webhookUrl` string, nullable — URL where Jellyfish notifications will be sent
      - `id` string, required — Room ID
      - `peers` Peer[], required — List of all peers
        - `id` string, required — Assigned peer id
        - `status` 'connected' | 'disconnected', required — Informs about the peer status
        - `type` string, required — Peer type

## Other responses

- `400` — Invalid request structure
- `401` — Unauthorized

## Changes

- **2023-12-08** `0b63a5682b1f` — 1 breaking, 1 info
  - added `#/components/schemas/ComponentFile` to the `data/room/components/items/` response property `oneOf` list for the response status `201`
  - added `file` discriminator mapping keys to the `data/room/components/items/` response property for the response status `201`
- **2023-12-08** `d078a424baf3` — 2 breaking, 2 info
  - removed the required property `data/room/components/items/oneOf[subschema #1: ComponentHLS]/metadata` from the response with the `201` status
  - removed the required property `data/room/components/items/oneOf[subschema #2: ComponentRTSP]/metadata` from the response with the `201` status
  - added the required property `data/room/components/items/oneOf[subschema #1: ComponentHLS]/properties` to the response with the `201` status
  - added the required property `data/room/components/items/oneOf[subschema #2: ComponentRTSP]/properties` to the response with the `201` status
- **2023-11-23** `1cdd25629361` — 1 info
  - added the required property `data/room/components/items/oneOf[subschema #1: ComponentHLS]/metadata/subscribeMode` to the response with the `201` status
- **2023-10-19** `ac8fa8102f73` — 2 info
  - added the new optional request property `webhookUrl`
  - added the optional property `data/room/config/webhookUrl` to the response with the `201` status
- …earlier changes not shown

[Full history](https://skmtc.dev/fishjam-dev/apis/fishjam-media-server/changes/room/post.md)

---

[API](https://skmtc.dev/fishjam-dev/apis/fishjam-media-server.md) · [All operations](https://skmtc.dev/fishjam-dev/apis/fishjam-media-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fishjam-dev/fishjam-media-server/revisions/ac17ad2abfa4/schema)
