Red5 Pro Restreamer API

The Red5 Pro Restreamer API controls live stream retransmission to external RTMP, RTMPS, SRT, and Zixi destinations including social media platforms like Facebook, YouTube, and Twitch. It accepts JSON-based provisions via POST requests to configure push and pull restreaming sessions from a Red5 Pro server. The API supports file-based pseudo-live restreaming of FLV and MP4 files as well as real-time forwarding of live ingest streams.

OpenAPI Specification

red5-restreamer-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Red5 Pro Restreamer API
  description: >-
    The Red5 Pro Restreamer API controls live stream retransmission to external
    RTMP, RTMPS, SRT, and Zixi destinations including social media platforms like
    Facebook and YouTube. It accepts JSON-based provisions via POST requests to
    configure push and pull restreaming sessions from a Red5 Pro server. The API
    supports file-based pseudo-live restreaming of FLV and MP4 files, as well as
    real-time forwarding of live ingest streams to multiple destinations simultaneously.
  version: '1.0'
  contact:
    name: Red5 Support
    url: https://www.red5.net/contact/
  termsOfService: https://www.red5.net/terms/
externalDocs:
  description: Red5 Pro Restreamer API Documentation
  url: https://www.red5.net/docs/red5-pro/development/api/restreamer/
servers:
  - url: http://{host}:5080
    description: Red5 Pro Server with Restreamer plugin
    variables:
      host:
        default: localhost
        description: Hostname or IP address of the Red5 Pro server
tags:
  - name: File Restreamer
    description: Restream recorded FLV or MP4 files as pseudo-live streams
  - name: RTMP Restreamer
    description: Configure RTMP and RTMPS push/pull restreaming
  - name: Servlet Configuration
    description: Server-level restreamer plugin configuration
security:
  - accessToken: []
paths:
  /restreamer/provision.create:
    post:
      operationId: createRtmpProvision
      summary: Create Rtmp Restream Provision
      description: >-
        Creates a provision that configures the Red5 Pro server to push a live
        ingest stream to one or more external RTMP or RTMPS destinations such as
        Facebook Live, YouTube Live, or any RTMP-compatible CDN endpoint.
        Each destination is specified with a stream URL and stream key.
      tags:
        - RTMP Restreamer
      parameters:
        - $ref: '#/components/parameters/accessTokenParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RtmpProvision'
      responses:
        '200':
          description: RTMP restream provision created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvisionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /restreamer/provision.delete:
    post:
      operationId: deleteRtmpProvision
      summary: Delete Rtmp Restream Provision
      description: >-
        Removes an active RTMP restreaming provision, stopping retransmission
        to the configured external destinations for the specified source stream.
      tags:
        - RTMP Restreamer
      parameters:
        - $ref: '#/components/parameters/accessTokenParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisionDelete'
      responses:
        '200':
          description: RTMP restream provision deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvisionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /restreamer/provision.pull.create:
    post:
      operationId: createRtmpPullProvision
      summary: Create Rtmp Pull Restream Provision
      description: >-
        Creates a provision that configures the Red5 Pro server to pull a live stream
        from an external RTMP source and make it available as a local stream for
        subscribers. Useful for ingesting streams from external encoders or sources.
      tags:
        - RTMP Restreamer
      parameters:
        - $ref: '#/components/parameters/accessTokenParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RtmpPullProvision'
      responses:
        '200':
          description: RTMP pull restream provision created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvisionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /filerestreamer/provision.create:
    post:
      operationId: createFileRestreamProvision
      summary: Create File Restream Provision
      description: >-
        Creates a provision that restreams a recorded FLV or MP4 file as a
        pseudo-live stream. The file is played back continuously or on loop,
        allowing pre-recorded content to be distributed as a live stream.
      tags:
        - File Restreamer
      parameters:
        - $ref: '#/components/parameters/accessTokenParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileRestreamProvision'
      responses:
        '200':
          description: File restream provision created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvisionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /filerestreamer/provision.delete:
    post:
      operationId: deleteFileRestreamProvision
      summary: Delete File Restream Provision
      description: >-
        Stops and removes an active file restreaming provision, halting
        playback and live distribution of the specified pre-recorded file.
      tags:
        - File Restreamer
      parameters:
        - $ref: '#/components/parameters/accessTokenParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisionDelete'
      responses:
        '200':
          description: File restream provision deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvisionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /restreamer/config:
    get:
      operationId: getRestreamConfig
      summary: Get Restreamer Servlet Configuration
      description: >-
        Returns the current server-level configuration for the Restreamer plugin
        servlet, including connection limits, timeouts, and default settings.
      tags:
        - Servlet Configuration
      parameters:
        - $ref: '#/components/parameters/accessTokenParam'
      responses:
        '200':
          description: Restreamer configuration returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestreamerConfig'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  securitySchemes:
    accessToken:
      type: apiKey
      in: query
      name: accessToken
      description: API access token for authenticating Restreamer API requests
  parameters:
    accessTokenParam:
      name: accessToken
      in: query
      description: API access token for authentication
      required: true
      schema:
        type: string
  responses:
    Unauthorized:
      description: Authentication failed or access token is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Request body or parameters are invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    RtmpProvision:
      type: object
      description: Configuration for an RTMP push restreaming provision
      required:
        - streamName
        - destinations
      properties:
        streamName:
          type: string
          description: Name of the source live stream to retransmit
        appName:
          type: string
          description: Red5 Pro application scope containing the source stream
          default: live
        destinations:
          type: array
          description: List of RTMP destination endpoints
          minItems: 1
          items:
            $ref: '#/components/schemas/RtmpDestination'
    RtmpDestination:
      type: object
      description: An external RTMP destination for stream retransmission
      required:
        - url
        - streamKey
      properties:
        url:
          type: string
          description: RTMP or RTMPS ingest URL of the destination (e.g., rtmp://a.rtmp.youtube.com/live2)
        streamKey:
          type: string
          description: Stream key for the destination platform
        protocol:
          type: string
          enum:
            - rtmp
            - rtmps
          description: Transport protocol to use for this destination
          default: rtmp
    RtmpPullProvision:
      type: object
      description: Configuration for pulling a stream from an external RTMP source
      required:
        - sourceUrl
        - streamName
      properties:
        sourceUrl:
          type: string
          description: RTMP URL of the external source to pull from
        streamKey:
          type: string
          description: Stream key at the source if required
        streamName:
          type: string
          description: Name to assign to the pulled stream on the local server
        appName:
          type: string
          description: Red5 Pro application scope to publish the pulled stream into
          default: live
    FileRestreamProvision:
      type: object
      description: Configuration for restreaming a pre-recorded file as a live stream
      required:
        - filePath
        - streamName
      properties:
        filePath:
          type: string
          description: Server filesystem path to the FLV or MP4 file to restream
        streamName:
          type: string
          description: Name to use for the pseudo-live output stream
        appName:
          type: string
          description: Red5 Pro application scope to publish the stream into
          default: live
        loop:
          type: boolean
          description: Whether to loop the file continuously when playback ends
          default: false
    ProvisionDelete:
      type: object
      description: Parameters to identify the provision to delete
      required:
        - streamName
      properties:
        streamName:
          type: string
          description: Name of the stream whose provision should be removed
        appName:
          type: string
          description: Red5 Pro application scope containing the stream
          default: live
    ProvisionResponse:
      type: object
      description: Response from a provision create or delete operation
      properties:
        result:
          type: boolean
          description: True if the operation completed successfully
        message:
          type: string
          description: Human-readable result message
        streamName:
          type: string
          description: Name of the stream affected by the operation
    RestreamerConfig:
      type: object
      description: Server-level restreamer plugin configuration
      properties:
        maxConnections:
          type: integer
          description: Maximum number of concurrent restream connections allowed
        connectionTimeout:
          type: integer
          description: Connection timeout in milliseconds
        reconnectAttempts:
          type: integer
          description: Number of reconnection attempts on connection loss
        reconnectDelay:
          type: integer
          description: Delay between reconnect attempts in milliseconds
    Error:
      type: object
      description: Error response
      properties:
        code:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Human-readable error message