---
title: "Subscribe component to the tracks of peers or components"
method: POST
path: "/room/{room_id}/component/{component_id}/subscribe"
tags: ["room"]
---

# Subscribe component to the tracks of peers or components

`POST /room/{room_id}/component/{component_id}/subscribe`

## Path parameters

- `room_id` string, required
- `component_id` string, required

## Request body

- SubscriptionConfig — Subscription config
  - `origins` string[] — List of peers and components ids whose tracks the HLS endpoint will subscribe to

## Response `201`

Tracks succesfully added.

## Other responses

- `400` — Invalid request structure
- `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-04-09** `432be2bc83f5` — 1 info
  - endpoint added
- **2023-07-18** `dafa9a249254` — 1 breaking
  - api path removed without deprecation

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