> ## Documentation Index
> Fetch the complete documentation index at: https://docs.livepeer.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Start Room Egress

> Livepeer Studio API endpoint

<OpenAPI path="POST /room/{id}/egress" />


## OpenAPI

````yaml POST /room/{id}/egress
openapi: 3.1.0
info:
  title: Livepeer API Reference
  description: |
    Welcome to the Livepeer API reference docs. Here you will find all the
    endpoints exposed on the standard Livepeer API, learn how to use them and
    what they return.
  version: 1.0.0
servers:
  - url: https://livepeer.studio/api
security:
  - apiKey: []
tags:
  - name: stream
    description: Operations related to livestream api
  - name: asset
    description: Operations related to asset/vod api
  - name: webhook
    description: Operations related to webhook api
  - name: multistream
    description: Operations related to multistream api
  - name: session
    description: Operations related to session api
  - name: room
    description: Operations related to rooms api
  - name: transcode
    description: Operations related to transcode api
  - name: metrics
    description: Operations related to metrics api
  - name: playback
    description: Operations related to playback api
  - name: accessControl
    description: Operations related to access control/signing keys api
  - name: task
    description: Operations related to tasks api
  - name: generate
    description: Operations related to AI generate api
paths:
  /room/{id}/egress:
    post:
      tags:
        - room
      summary: Start room RTMP egress
      description: >
        Create a livestream for your room.

        This allows you to leverage livestreaming features like recording and
        HLS output.
      operationId: startRoomEgress
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/room-egress-payload'
      responses:
        '204':
          description: Success
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      deprecated: true
      x-codeSamples:
        - lang: go
          label: startRoomEgress
          source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    s := livepeergo.New(\n        livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n    )\n\n    ctx := context.Background()\n    res, err := s.Room.StartEgress(ctx, \"<id>\", components.RoomEgressPayload{\n        StreamID: \"aac12556-4d65-4d34-9fb6-d1f0985eb0a9\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: startRoomEgress
          source: |-
            from livepeer import Livepeer

            s = Livepeer(
                api_key="<YOUR_BEARER_TOKEN_HERE>",
            )

            res = s.room.start_egress(id="<id>", room_egress_payload={
                "stream_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
            })

            if res is not None:
                # handle response
                pass
components:
  schemas:
    room-egress-payload:
      type: object
      required:
        - streamId
      additionalProperties: false
      properties:
        streamId:
          type: string
          description: The ID of the Livepeer Stream to stream to
          example: aac12556-4d65-4d34-9fb6-d1f0985eb0a9
    error:
      type: object
      properties:
        errors:
          type: array
          minItems: 1
          items:
            type: string
            example:
              - id not provided
              - Account not found
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````