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

# Reset stream key

> Old key invalid immediately. Disconnects active stream if live.



## OpenAPI

````yaml https://raw.githubusercontent.com/vidinfra/open-api-docs/refs/heads/main/livestream-api.json post /streams/{streamId}/reset-key
openapi: 3.0.1
info:
  title: Tenbyte Livestream API
  description: >-
    Live video and audio transcoding infrastructure as a service. Ingest via
    RTMP/SRT (push) or pull from upstream sources, transcode to adaptive
    bitrate, deliver via HLS/DASH.
  version: 1.0.0
servers:
  - url: https://api.tenbyte.io/v1/livestream
    description: Production server
security:
  - BearerAuth: []
  - apikey-header-X-API-Key: []
tags:
  - name: Health
  - name: Streams
  - name: Webhooks
paths:
  /streams/{streamId}/reset-key:
    post:
      tags:
        - Streams
      summary: Reset stream key
      description: Old key invalid immediately. Disconnects active stream if live.
      operationId: resetStreamKey
      parameters:
        - name: streamId
          in: path
          description: ''
          required: true
          example: 0000cf2e-ae90-46bc-b119-f5f626258434
          schema:
            type: string
      responses:
        '200':
          description: New stream key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamSuccessResponse'
          headers: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: Missing or invalid authentication
        '404':
          $ref: '#/components/responses/NotFound'
          description: Resource not found
        '409':
          $ref: '#/components/responses/Conflict'
          description: Action conflicts with current state
      deprecated: false
      security:
        - BearerAuth: []
        - apikey-header-X-API-Key: []
components:
  schemas:
    StreamSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          $ref: '#/components/schemas/StreamResource'
    StreamResource:
      type: object
      properties:
        id:
          type: string
        organization_id:
          type: string
        name:
          type: string
        type:
          $ref: '#/components/schemas/StreamType'
        mode:
          $ref: '#/components/schemas/StreamMode'
        status:
          $ref: '#/components/schemas/StreamStatus'
        region:
          type: string
        stream_key:
          type: string
        ingest:
          $ref: '#/components/schemas/IngestResource'
        output_protocols:
          type: array
          items:
            $ref: '#/components/schemas/OutputProtocol'
        packaging:
          $ref: '#/components/schemas/PackagingResource'
        ladder:
          $ref: '#/components/schemas/LadderResource'
        playback:
          $ref: '#/components/schemas/PlaybackResource'
        recording:
          $ref: '#/components/schemas/RecordingResource'
        webhook_url:
          type: string
        meta:
          type: object
          additionalProperties: true
          properties: {}
        last_live_at:
          type: string
          format: date-time
          nullable: true
        last_ended_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: string
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorItem'
    StreamType:
      type: string
      enum:
        - linear
        - event
      description: '`linear` (24/7) or `event` (up to 6h)'
    StreamMode:
      type: string
      enum:
        - video
        - audio
    StreamStatus:
      type: string
      enum:
        - idle
        - starting
        - live
        - reconnecting
        - stopping
        - errored
    IngestResource:
      type: object
      description: |
        For `kind=push` the server echoes accepted `protocols` and emits `rtmp`
        + `srt` publish URLs derived from the auto-generated stream key. For
        `kind=pull` the submitted `primary` and optional `backup` endpoints are
        echoed back.
      properties:
        kind:
          $ref: '#/components/schemas/IngestKind'
        protocols:
          type: array
          items:
            $ref: '#/components/schemas/IngestPushProtocol'
          description: Push only.
        rtmp:
          type: string
          description: >-
            Push only. RTMP publish base URL: `rtmp://host:1935/live`. Pair with
            `stream_key`.
        srt:
          type: string
          description: >-
            Push only. SRT publish URL with SRS streamid encoding (key
            embedded).
        primary:
          $ref: '#/components/schemas/IngestEndpointResource'
        backup:
          $ref: '#/components/schemas/IngestEndpointResource'
    OutputProtocol:
      type: string
      enum:
        - hls
        - dash
    PackagingResource:
      type: object
      description: Echoed per-protocol packaging settings.
      properties:
        hls:
          $ref: '#/components/schemas/HLSPackagingResource'
        dash:
          $ref: '#/components/schemas/DASHPackagingResource'
    LadderResource:
      type: object
      description: >-
        Echoed ladder. Either `video[]` or `audio[]` is populated based on
        `mode`.
      properties:
        video:
          type: array
          items:
            $ref: '#/components/schemas/VideoRenditionResource'
        audio:
          type: array
          items:
            $ref: '#/components/schemas/AudioRenditionResource'
    PlaybackResource:
      type: object
      properties:
        hls:
          type: string
          description: HLS master playlist URL (null when `hls` not in `output_protocols`)
          nullable: true
        dash:
          type: string
          description: DASH manifest URL (null when `dash` not in `output_protocols`)
          nullable: true
    RecordingResource:
      type: object
      description: Null when recording is disabled
      properties:
        enabled:
          type: boolean
        target:
          $ref: '#/components/schemas/RecordingTarget'
        library_id:
          type: string
          nullable: true
        folder_id:
          type: string
          nullable: true
        prefix:
          type: string
          nullable: true
        s3_config:
          type: object
          properties: {}
          nullable: true
      nullable: true
    ErrorItem:
      type: object
      properties:
        field:
          type: string
          nullable: true
        code:
          type: string
        message:
          type: string
        details:
          type: object
          properties: {}
          nullable: true
    IngestKind:
      type: string
      enum:
        - push
        - pull
    IngestPushProtocol:
      type: string
      enum:
        - rtmp
        - srt
    IngestEndpointResource:
      type: object
      properties:
        protocol:
          $ref: '#/components/schemas/IngestPullProtocol'
        url:
          type: string
          format: uri
    HLSPackagingResource:
      type: object
      properties:
        segment_format:
          $ref: '#/components/schemas/HLSSegmentFormat'
        playlist_size:
          type: integer
        preserved_segments:
          type: integer
        low_latency:
          type: boolean
    DASHPackagingResource:
      type: object
      properties:
        segment_format:
          $ref: '#/components/schemas/DASHSegmentFormat'
        window_s:
          type: integer
        min_buffer_s:
          type: integer
    VideoRenditionResource:
      type: object
      properties:
        name:
          type: string
        width:
          type: integer
        height:
          type: integer
        fps:
          type: integer
        gop:
          type: integer
        bitrate_kbps:
          type: integer
        max_bitrate_kbps:
          type: integer
        buf_size_kbps:
          type: integer
        crf:
          type: integer
          description: Optional. Present only when set in the request.
        codec:
          $ref: '#/components/schemas/VideoCodec'
        preset:
          type: string
        profile:
          type: string
        level:
          type: string
        rate_control:
          $ref: '#/components/schemas/RateControl'
        bframes:
          type: integer
        ref_frames:
          type: integer
        rc_lookahead:
          type: integer
        audio:
          $ref: '#/components/schemas/VideoRenditionAudioResource'
    AudioRenditionResource:
      type: object
      properties:
        name:
          type: string
        codec:
          $ref: '#/components/schemas/AudioCodec'
        channels:
          type: integer
        sample_rate_hz:
          type: integer
        bitrate_kbps:
          type: integer
    RecordingTarget:
      type: string
      enum:
        - library
        - s3
    IngestPullProtocol:
      type: string
      enum:
        - srt
        - rtsp
        - rtmp
        - udp
    HLSSegmentFormat:
      type: string
      enum:
        - mpegts
        - fmp4
    DASHSegmentFormat:
      type: string
      enum:
        - fmp4
    VideoCodec:
      type: string
      enum:
        - h264
        - h265
    RateControl:
      type: string
      enum:
        - cbr
        - vbr
    VideoRenditionAudioResource:
      type: object
      properties:
        codec:
          $ref: '#/components/schemas/AudioCodec'
        channels:
          type: integer
        sample_rate_hz:
          type: integer
        audio_bitrate_kbps:
          type: integer
    AudioCodec:
      type: string
      enum:
        - aac
  responses:
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Unauthorized:
              summary: Success
              value:
                success: false
                code: UNAUTHORIZED
                message: >-
                  Missing authorization. Provide Authorization header or
                  X-API-Key header.
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            NotFound:
              summary: Success
              value:
                success: false
                code: NOT_FOUND
                message: Resource not found.
    Conflict:
      description: Action conflicts with current state
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Conflict:
              summary: Success
              value:
                success: false
                code: INTERNAL_ERROR
                message: cannot delete stream while live
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: RSA-signed JWT token
    apikey-header-X-API-Key:
      type: apiKey
      in: header
      name: X-API-Key
      description: HMAC-signed API key with prefix `tkb`

````