> ## 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.

# Transcoder status callback

> Internal endpoint called by the transcoder service when a stream's
status changes. Authenticated via shared secret in `X-Webhook-Secret`
header, not JWT/API key.

On receive: updates stream status, creates audit event, and dispatches
a signed webhook to the customer's configured `webhook_url` (if set).




## OpenAPI

````yaml https://raw.githubusercontent.com/vidinfra/open-api-docs/refs/heads/main/livestream-api.json post /webhooks/transcoder
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:
  /webhooks/transcoder:
    post:
      tags:
        - Webhooks
      summary: Transcoder status callback
      description: |
        Internal endpoint called by the transcoder service when a stream's
        status changes. Authenticated via shared secret in `X-Webhook-Secret`
        header, not JWT/API key.

        On receive: updates stream status, creates audit event, and dispatches
        a signed webhook to the customer's configured `webhook_url` (if set).
      operationId: transcoderWebhook
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TranscoderWebhookRequest'
            examples:
              streamLive:
                value:
                  event: stream.status.live
                  stream_id: 0000cf2e-ae90-46bc-b119-f5f626258434
                  status: live
                  previous_status: starting
                  session_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  timestamp: '2026-04-16T12:00:00Z'
                  details:
                    reason: first_keyframe_received
                    node_id: worker-01
                summary: Stream went live
              streamErrored:
                value:
                  event: stream.status.errored
                  stream_id: 0000cf2e-ae90-46bc-b119-f5f626258434
                  status: errored
                  previous_status: live
                  session_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  timestamp: '2026-04-16T12:30:00Z'
                  details:
                    reason: encoder_timeout
                    node_id: worker-01
                    error: connection reset by peer
                summary: Encoder errored
        required: true
      responses:
        '200':
          description: Webhook received
          content:
            application/json:
              schema:
                type: object
                properties:
                  received:
                    type: boolean
                    example: true
          headers: {}
        '400':
          $ref: '#/components/responses/BadRequest'
          description: Invalid request payload
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: Missing or invalid authentication
        '404':
          $ref: '#/components/responses/NotFound'
          description: Resource not found
        '422':
          $ref: '#/components/responses/ValidationError'
          description: Input validation failed
      deprecated: false
      security:
        - WebhookSecretAuth: []
components:
  schemas:
    TranscoderWebhookRequest:
      type: object
      required:
        - event
        - stream_id
        - status
        - timestamp
      properties:
        event:
          type: string
          description: Event type, e.g. `stream.status.live`
          example: stream.status.starting
        stream_id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/StreamStatus'
        previous_status:
          $ref: '#/components/schemas/StreamStatus'
        session_id:
          type: string
          format: uuid
          nullable: true
        timestamp:
          type: string
          format: date-time
        details:
          type: object
          description: Freeform context about the transition
          properties:
            reason:
              type: string
            node_id:
              type: string
            error:
              type: string
              nullable: true
          nullable: true
    StreamStatus:
      type: string
      enum:
        - idle
        - starting
        - live
        - reconnecting
        - stopping
        - errored
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: string
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorItem'
    ErrorItem:
      type: object
      properties:
        field:
          type: string
          nullable: true
        code:
          type: string
        message:
          type: string
        details:
          type: object
          properties: {}
          nullable: true
  responses:
    BadRequest:
      description: Invalid request payload
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            BadRequest:
              summary: Success
              value:
                success: false
                code: BAD_REQUEST
                message: Invalid request payload.
                errors:
                  - code: invalid_json
                    message: Malformed JSON at offset 42
    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.
    ValidationError:
      description: Input validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            ValidationError:
              summary: Success
              value:
                success: false
                code: VALIDATION_ERROR
                message: Some fields failed validation.
                errors:
                  - field: name
                    code: validation_required
                    message: cannot be blank
                  - field: ingest.kind
                    code: validation_required
                    message: ingest.kind is required
                  - field: ladder
                    code: validation_ladder_video_required
                    message: ladder.video is required for video streams
  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`
    WebhookSecretAuth:
      type: apiKey
      in: header
      name: X-Webhook-Secret
      description: Shared secret for transcoder webhook callbacks

````