---
title: "Creates the component and adds it to the room"
method: POST
path: "/room/{room_id}/component"
tags: ["room"]
---

# Creates the component and adds it to the room

`POST /room/{room_id}/component`

## Path parameters

- `room_id` string, required

## Request body

- object
  - `options` union — Component-specific options
    - object — Options specific to the HLS component
      - `lowLatency` boolean — Whether the component should use LL-HLS
      - `persistent` boolean — Whether the video is stored after end of stream
      - `s3` object, nullable — An AWS S3 credential that will be used to send HLS stream. The stream will only be uploaded if credentials are provided
        - `accessKeyId` string, required — An AWS access key identifier, linked to your AWS account.
        - `bucket` string, required — The name of the S3 bucket where your data will be stored.
        - `region` string, required — The AWS region where your bucket is located.
        - `secretAccessKey` string, required — The secret key that is linked to the Access Key ID.
      - `subscribeMode` 'auto' | 'manual' — Whether the HLS component should subscribe to tracks automatically or manually.
      - `targetWindowDuration` integer, nullable — Duration of stream available for viewer
    - object — Options specific to the RTSP component
      - `keepAliveInterval` integer — Interval (in ms) in which keep-alive RTSP messages will be sent to the remote stream source
      - `pierceNat` boolean — Whether to attempt to create client-side NAT binding by sending an empty datagram from client to source, after the completion of RTSP setup
      - `reconnectDelay` integer — Delay (in ms) between successive reconnect attempts
      - `rtpPort` integer — Local port RTP stream will be received at
      - `sourceUri` string, required — URI of RTSP source stream
    - object — Options specific to the File component
      - `filePath` string, required — Path to track file. Must be either OPUS encapsulated in Ogg or raw h264
      - `framerate` integer, nullable — Framerate of video in a file. It is only valid for video track
    - object — Options specific to the SIP component
      - `registrarCredentials` object, required — Credentials used to authorize in SIP Provider service
        - `address` string, required — SIP provider address. Can be in the form of FQDN (my-sip-registrar.net) or IPv4 (1.2.3.4). Port can be specified e.g: 5.6.7.8:9999. If not given, the default SIP port `5060` will be assumed
        - `password` string, required — Password in SIP service provider
        - `username` string, required — Username in SIP service provider
    - object — Options specific to the Recording component
      - `credentials` object, nullable — An AWS S3 credential that will be used to send HLS stream. The stream will only be uploaded if credentials are provided
        - `accessKeyId` string, required — An AWS access key identifier, linked to your AWS account.
        - `bucket` string, required — The name of the S3 bucket where your data will be stored.
        - `region` string, required — The AWS region where your bucket is located.
        - `secretAccessKey` string, required — The secret key that is linked to the Access Key ID.
      - `pathPrefix` string, nullable — Path prefix under which all recording are stored
      - `subscribeMode` 'auto' | 'manual' — Whether the Recording component should subscribe to tracks automatically or manually.
  - `type` string, required — Component type

## Response `201`

Successfully added component

- ComponentDetailsResponse — Response containing component details
  - `data` union, required — Describes component
    - object — Describes the HLS component
      - `id` string, required — Assigned component ID
      - `properties` ComponentPropertiesHLS, required — Properties specific to the HLS component
        - `lowLatency` boolean, required — Whether the component uses LL-HLS
        - `persistent` boolean, required — Whether the video is stored after end of stream
        - `playable` boolean, required — Whether the generated HLS playlist is playable
        - `subscribeMode` 'auto' | 'manual', required — Whether the HLS component should subscribe to tracks automatically or manually
        - `targetWindowDuration` integer, nullable, required — Duration of stream available for viewer
      - `tracks` Track[], required — List of all component's tracks
        - `id` string
        - `metadata` unknown
        - `type` 'audio' | 'video'
      - `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
        - `keepAliveInterval` integer, required — Interval (in ms) in which keep-alive RTSP messages will be sent to the remote stream source
        - `pierceNat` boolean, required — Whether to attempt to create client-side NAT binding by sending an empty datagram from client to source, after the completion of RTSP setup
        - `reconnectDelay` integer, required — Delay (in ms) between successive reconnect attempts
        - `rtpPort` integer, required — Local port RTP stream will be received at
        - `sourceUri` string, required — URI of RTSP source stream
      - `tracks` Track[], required — List of all component's tracks
        - `id` string
        - `metadata` unknown
        - `type` 'audio' | 'video'
      - `type` string, required — Component type
    - object — Describes the File component
      - `id` string, required — Assigned component ID
      - `properties` ComponentPropertiesFile — Properties specific to the File component
        - `filePath` string, required — Relative path to track file. Must be either OPUS encapsulated in Ogg or raw h264
        - `framerate` integer, nullable, required — Framerate of video in a file. It is only valid for video track
      - `tracks` Track[], required — List of all component's tracks
        - `id` string
        - `metadata` unknown
        - `type` 'audio' | 'video'
      - `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
        - `registrarCredentials` object, required — Credentials used to authorize in SIP Provider service
          - `address` string, required — SIP provider address. Can be in the form of FQDN (my-sip-registrar.net) or IPv4 (1.2.3.4). Port can be specified e.g: 5.6.7.8:9999. If not given, the default SIP port `5060` will be assumed
          - `password` string, required — Password in SIP service provider
          - `username` string, required — Username in SIP service provider
      - `tracks` Track[], required — List of all component's tracks
        - `id` string
        - `metadata` unknown
        - `type` 'audio' | 'video'
      - `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
        - `subscribeMode` 'auto' | 'manual', required — Whether the Recording component should subscribe to tracks automatically or manually
      - `tracks` Track[], required — List of all component's tracks
        - `id` string
        - `metadata` unknown
        - `type` 'audio' | 'video'
      - `type` string, required — Component type

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `404` — Room doesn't exist
- `503` — Service temporarily unavailable

## Changes

- **2026-07-17** `7227c4e436c0` — 1 info
  - added the non-success response with the status `503`
- **2024-06-07** `df3d07a8ff0e` — 2 info
  - the request property `options/oneOf[subschema #1: ComponentOptionsHLS]/s3` became nullable
  - the request property `options/oneOf[subschema #5: ComponentOptionsRecording]/credentials` became nullable
- **2024-06-04** `7ea039e5d9c8` — 12 breaking
  - added the new required request property `options/oneOf[subschema #1: ComponentOptionsHLS]/s3/accessKeyId`
  - added the new required request property `options/oneOf[subschema #1: ComponentOptionsHLS]/s3/bucket`
  - added the new required request property `options/oneOf[subschema #1: ComponentOptionsHLS]/s3/region`
  - added the new required request property `options/oneOf[subschema #1: ComponentOptionsHLS]/s3/secretAccessKey`
  - …8 more
- **2024-04-09** `432be2bc83f5` — 1 breaking, 2 info
  - removed the required property `data/oneOf[subschema #5: ComponentRecording]/properties/pathPrefix` from the response with the `201` status
  - added the new optional request property `options/oneOf[subschema #5: ComponentOptionsRecording]/subscribeMode`
  - added the required property `data/oneOf[subschema #5: ComponentRecording]/properties/subscribeMode` to the response with the `201` status
- **2024-04-05** `c9ea5a438831` — 1 info
  - the request property `options/oneOf[subschema #5: ComponentOptionsRecording]/pathPrefix` became nullable

[Full history](https://skmtc.dev/fishjam-dev/apis/fishjam-media-server/changes/room/:room_id/component/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)
