---
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
  - `peerDisconnectedTimeout` integer, nullable — Duration (in seconds) after which the peer will be removed if it is disconnected. If not provided, this feature is disabled.
  - `peerlessPurgeTimeout` integer, nullable — Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled.
  - `roomId` string, nullable — Custom id used for identifying room within Fishjam. Must be unique across all rooms. If not provided, random UUID is generated.
  - `videoCodec` 'h264' | 'vp8', nullable — Enforces video codec for each peer in the room
  - `webhookUrl` string, nullable — URL where Fishjam notifications will be sent

## Response `201`

Room successfully created

- RoomCreateDetailsResponse — Response containing room details
  - `data` object, required
    - `fishjam_address` string, required — Fishjam instance address where the room was created. This might be different than the address of Fishjam where the request was sent only when running a cluster of Fishjams.
    - `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
              - …
            - `tracks` Track[], required — List of all component's tracks
              - …
            - `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
              - …
            - `tracks` Track[], required — List of all component's tracks
              - …
            - `type` string, required — Component type
          - object — Describes the File component
            - `id` string, required — Assigned component ID
            - `properties` ComponentPropertiesFile — Properties specific to the File component
              - …
            - `tracks` Track[], required — List of all component's tracks
              - …
            - `type` string, required — Component type
          - object — Describes the SIP component
            - `id` string, required — Assigned component ID
            - `properties` ComponentPropertiesSIP, required — Properties specific to the SIP component
              - …
            - `tracks` Track[], required — List of all component's tracks
              - …
            - `type` string, required — Component type
          - object — Describes the Recording component
            - `id` string, required — Assigned component ID
            - `properties` ComponentPropertiesRecording, required — Properties specific to the Recording component
              - …
            - `tracks` Track[], required — List of all component's tracks
              - …
            - `type` string, required — Component type
      - `config` RoomConfig, required — Room configuration
        - `maxPeers` integer, nullable — Maximum amount of peers allowed into the room
        - `peerDisconnectedTimeout` integer, nullable — Duration (in seconds) after which the peer will be removed if it is disconnected. If not provided, this feature is disabled.
        - `peerlessPurgeTimeout` integer, nullable — Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled.
        - `roomId` string, nullable — Custom id used for identifying room within Fishjam. Must be unique across all rooms. If not provided, random UUID is generated.
        - `videoCodec` 'h264' | 'vp8', nullable — Enforces video codec for each peer in the room
        - `webhookUrl` string, nullable — URL where Fishjam notifications will be sent
      - `id` string, required — Room ID
      - `peers` Peer[], required — List of all peers
        - `id` string, required — Assigned peer id
        - `metadata` unknown, required
        - `status` 'connected' | 'disconnected', required — Informs about the peer status
        - `tracks` Track[], required — List of all peer's tracks
          - `id` string
          - `metadata` unknown
          - `type` 'audio' | 'video'
        - `type` string, required — Peer type

## Other responses

- `400` — Invalid request structure
- `401` — Unauthorized
- `503` — Service temporarily unavailable

## Changes

> 50 revisions in range; 1 could not be searched.

- **2024-05-16** `824074081b46` — 1 breaking, 1 info
  - removed the required property `data/jellyfish_address` from the response with the `201` status
  - added the required property `data/fishjam_address` to the response with the `201` status
- **2024-04-17** `9c9961e4aa93` — 2 info
  - added the new optional request property `peerDisconnectedTimeout`
  - added the optional property `data/room/config/peerDisconnectedTimeout` to the response with the `201` status
- **2024-04-09** `432be2bc83f5` — 1 breaking, 1 info
  - removed the required property `data/room/components/items/oneOf[subschema #5: ComponentRecording]/properties/pathPrefix` from the response with the `201` status
  - added the required property `data/room/components/items/oneOf[subschema #5: ComponentRecording]/properties/subscribeMode` to the response with the `201` status
- **2024-03-14** `a91eab8f5c5d` — 1 breaking, 1 info
  - added `#/components/schemas/ComponentRecording` to the `data/room/components/items/` response property `oneOf` list for the response status `201`
  - added `recording` discriminator mapping keys to the `data/room/components/items/` response property for the response status `201`
- **2024-02-22** `4f1bea96a0f9` — 1 info
  - the endpoint scheme security `authorization` was added to the API

[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/7227c4e436c0/schema)
