---
title: "Create a new live stream"
method: POST
path: "/v1/live_streams"
tags: ["LiveStreams"]
---

# Create a new live stream

`POST /v1/live_streams`

## Request

- Base URL: `https://api.hify.club`
- URL: `https://api.hify.club/v1/live_streams`
- Auth: API key in header `X-User-Token`

## Request body

- object
  - `live_stream` object, required
    - `game_id` integer, required
    - `camera_id` integer, required
    - `destination` object, required: Which account the stream broadcasts to. Mandatory. A hify destination provisions its own YouTube stream key and must not carry key material; a partner destination must supply the key, because the account is not ours to provision from.
      - `account` 'hify' | 'partner', required
      - `key_value` string: Required for account=partner, rejected for account=hify.
      - `stream_host` string: RTMP ingest host including the scheme. Partner only; defaults to rtmp://a.rtmp.youtube.com/live2.
      - `visibility` 'public' | 'unlisted' | 'private': Visibility of the YouTube broadcast. Hify only, ignored for account=partner. Unlisted suits test streams.

## Response `201`

Live stream created

- LiveStream
  - `id` integer
  - `game_id` integer
  - `camera_id` integer
  - `game` object
  - `camera` object
  - `live_stream_destinations` LiveStreamDestination[]
    - `id` integer
    - `provider` string
    - `account` 'hify' | 'partner'
    - `stream_protocol` string
    - `stream_host` string
    - `stream_key` string
    - `youtube_broadcast_id` string, nullable: YouTube liveBroadcast (video) id for a hify destination. Null until the broadcast is created, which happens asynchronously after the live stream is created.
    - `youtube_watch_url` string, nullable: Public YouTube page for the stream. Shows the scheduled page before the game, the live stream during it and the replay after. Null until youtube_broadcast_id is set.
    - `youtube_privacy_status` 'public' | 'unlisted' | 'private': Visibility of the YouTube broadcast created for a hify destination. Meaningless for a partner destination, which stays public.

## Other responses

- `422`: Invalid destination — absent, unknown account, a partner destination with no key, or a hify destination carrying key material. Nothing is written.
- `502`: YouTube stream key provisioning failed. No live stream, destination or key was created; retry the request.

---

[API](https://skmtc.dev/hify/apis/hify-apis.md) - [All operations](https://skmtc.dev/hify/apis/hify-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/hify/apis/hify-apis/revisions/b5920403538d?raw)
