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

# Update a stream

> Update a stream. When `retryMirror: true`, the resolver also writes a
fresh MirrorIntent for the latest desired state of this stream's YouTube
schedule mirror — used to recover after reauth / quota reset / channel
freeing. retryMirror is a sibling argument rather than a field on
UpdateStreamInput because that input type is generated by ent and
cannot carry non-column fields. Has no effect when the stream has no
existing MirrorIntent (`INVALID_ARG` is returned in that case).

When `input.status` is set, the resolver translates the legacy enum value to
the equivalent lifecycle command and routes it through
`streamlifecycle.Transition()` instead of writing the column directly.
`input.status` is deprecated; frontends should call the command mutations
directly.



## OpenAPI

````yaml https://api.streamloop.app/v1/openapi.json patch /streams/{id}
openapi: 3.1.0
info:
  contact:
    name: Streamloop
    url: https://streamloop.app
  description: >-
    The Streamloop REST API. Authenticate with either an `X-API-Key` header (a
    Streamloop API key, prefix `sl_` — simplest for programmatic clients) or an
    OAuth 2.1 bearer access token (obtain one via https://auth.streamloop.app).
    Collections are cursor-paginated (`limit` + `cursor`, returning `{ data,
    page }`). Errors are RFC 7807 problem documents.
  summary: >-
    Programmatic access to Streamloop — create and control 24/7 loop streams,
    manage media, destinations, playlists, and billing.
  title: Streamloop API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.streamloop.app/v1
security:
  - oauth2: []
  - bearerAuth: []
  - apiKey: []
tags:
  - description: The authenticated user's account.
    name: account
  - description: Credits, usage analytics, invoices, and top-ups.
    name: billing
  - description: Crypto deposit options for topping up credits.
    name: crypto
  - description: Manage streaming destinations (custom RTMP).
    name: destinations
  - description: 'Service metadata: status and the OpenAPI document (unauthenticated).'
    name: meta
  - description: Manage and publish stream playlists.
    name: playlists
  - description: Create, control, schedule, and monitor 24/7 loop streams.
    name: streams
  - description: Upload and manage source media (video/audio).
    name: uploads
paths:
  /streams/{id}:
    patch:
      tags:
        - streams
      summary: Update a stream
      description: >-
        Update a stream. When `retryMirror: true`, the resolver also writes a

        fresh MirrorIntent for the latest desired state of this stream's YouTube

        schedule mirror — used to recover after reauth / quota reset / channel

        freeing. retryMirror is a sibling argument rather than a field on

        UpdateStreamInput because that input type is generated by ent and

        cannot carry non-column fields. Has no effect when the stream has no

        existing MirrorIntent (`INVALID_ARG` is returned in that case).


        When `input.status` is set, the resolver translates the legacy enum
        value to

        the equivalent lifecycle command and routes it through

        `streamlifecycle.Transition()` instead of writing the column directly.

        `input.status` is deprecated; frontends should call the command
        mutations

        directly.
      operationId: updateStream
      parameters:
        - description: Resource identifier.
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: >-
            Optional client-generated key. A repeated request with the same key
            replays the original response (within 24h) instead of re-executing —
            safe retries.
          in: header
          name: Idempotency-Key
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStreamRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stream'
          description: Successful response.
          headers:
            RateLimit-Limit:
              description: Requests allowed per window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Missing or invalid access token.
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The token lacks the required scope or access to the resource.
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The resource does not exist or is not visible to the caller.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request body or parameters are invalid.
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Rate limit exceeded. Retry after the indicated delay.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
        '502':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The upstream data service returned an error.
      security:
        - oauth2:
            - streamloop:write
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    UpdateStreamRequest:
      description: |-
        UpdateStreamInput is used for update Stream object.
        Input was generated by ent.
      properties:
        addPlaylistIDs:
          items:
            type: string
          type: array
        addPreparedPlaylistIDs:
          items:
            type: string
          type: array
        agentModeEnabled:
          description: >-
            Feature flag: run stream in agent mode (/agent) with replica-based
            orchestration.
          type:
            - boolean
            - 'null'
        audioUploadObjectID:
          type:
            - string
            - 'null'
        clearAudioUploadObject:
          type:
            - boolean
            - 'null'
        clearDestination:
          type:
            - boolean
            - 'null'
        clearFramerate:
          type:
            - boolean
            - 'null'
        clearName:
          type:
            - boolean
            - 'null'
        clearPlaylists:
          type:
            - boolean
            - 'null'
        clearPreparedPlaylists:
          type:
            - boolean
            - 'null'
        clearQuality:
          type:
            - boolean
            - 'null'
        clearScheduleEndAt:
          type:
            - boolean
            - 'null'
        clearScheduleStartAt:
          type:
            - boolean
            - 'null'
        clearStreamBackend:
          type:
            - boolean
            - 'null'
        clearStreamDuration:
          type:
            - boolean
            - 'null'
        clearStreamKey:
          type:
            - boolean
            - 'null'
        clearStreamState:
          type:
            - boolean
            - 'null'
        clearVideoUploadObject:
          type:
            - boolean
            - 'null'
        clearYoutubeSettings:
          type:
            - boolean
            - 'null'
        destinationID:
          type:
            - string
            - 'null'
        framerate:
          enum:
            - f_24
            - f_25
            - f_30
            - f_60
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        quality:
          enum:
            - q_720p
            - q_1080p
            - q_1440p
            - q_2160p
          type:
            - string
            - 'null'
        removePlaylistIDs:
          items:
            type: string
          type: array
        removePreparedPlaylistIDs:
          items:
            type: string
          type: array
        runBackupStream:
          description: >-
            Stream preference: enable backup destination streaming in agent
            mode.
          type:
            - boolean
            - 'null'
        scheduleEndAt:
          format: date-time
          type:
            - string
            - 'null'
        scheduleStartAt:
          format: date-time
          type:
            - string
            - 'null'
        streamBackend:
          description: >-
            RTMP publisher backend. 'manifest' runs manifest-streamer
            in-process; 'ffmpeg' or empty uses the legacy subprocess. Editing is
            gated by the native_backend_streamer PostHog feature flag in the
            update resolver — the column is nullable so admin tooling can clear
            it.
          enum:
            - ffmpeg
            - manifest
          type:
            - string
            - 'null'
        streamDestination:
          enum:
            - youtube
          type:
            - string
            - 'null'
        streamDuration:
          description: >-
            Stream duration in seconds. 0 = never expires. Copied from user
            default on creation.
          type:
            - integer
            - 'null'
        streamKey:
          description: >-
            DEPRECATED: use destination_id. Kept for backward-compat during
            destination migration.
          type:
            - string
            - 'null'
        streamStateID:
          type:
            - string
            - 'null'
        videoUploadObjectID:
          type:
            - string
            - 'null'
        youtubeSettingsID:
          type:
            - string
            - 'null'
      type: object
    Stream:
      properties:
        createdAt:
          format: date-time
          type: string
        framerate:
          enum:
            - f_24
            - f_25
            - f_30
            - f_60
          type:
            - string
            - 'null'
        id:
          type: string
        name:
          type:
            - string
            - 'null'
        quality:
          enum:
            - q_720p
            - q_1080p
            - q_1440p
            - q_2160p
          type:
            - string
            - 'null'
        state:
          enum:
            - draft
            - invalid
            - scheduled
            - preparing
            - activating
            - active
            - failing
            - failed
            - stopping
            - stopped
          type:
            - string
            - 'null'
      required:
        - createdAt
        - id
      type: object
    Problem:
      description: RFC 7807 problem-details error body.
      properties:
        code:
          description: A stable, machine-readable error code.
          type: string
        detail:
          description: A human-readable explanation specific to this occurrence.
          type: string
        status:
          description: The HTTP status code.
          type: integer
        title:
          description: A short, human-readable summary of the problem.
          type: string
        type:
          description: A URI reference identifying the problem type.
          format: uri-reference
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
      type: object
  securitySchemes:
    oauth2:
      description: OAuth 2.1 authorization-code flow with PKCE.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.streamloop.app/api/auth/oauth2/authorize
          scopes:
            streamloop:billing: Read billing/usage and create top-up links
            streamloop:destructive: Delete streams and destinations
            streamloop:read: Read streams, destinations, playlists, and billing status
            streamloop:write: Create and control streams, destinations, and playlists
          tokenUrl: https://auth.streamloop.app/api/auth/oauth2/token
      type: oauth2
    bearerAuth:
      bearerFormat: JWT
      description: An OAuth 2.1 bearer access token.
      scheme: bearer
      type: http
    apiKey:
      description: >-
        A Streamloop API key (prefix `sl_`), sent in the `X-API-Key` header.
        Create and manage keys in the dashboard. The simplest auth for
        programmatic / agent clients — no OAuth flow required; the key acts as
        its owning user.
      in: header
      name: X-API-Key
      type: apiKey

````