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

# Create restream

> Creates a new restream for a specified live stream.
  


Specify the target platform's URI (RTMP, RTMPS, or SRT) and the ID of the source stream.
  


Restreaming allows you to broadcast a single live stream to multiple platforms or servers simultaneously (e.g., Facebook, YouTube, or a custom media server).

**How it works:**
1. Get credentials (stream URL/key or SRT URL) from the target platform.
2. Create a restream in the Gcore system by specifying the target URI and the source live stream.
3. Start your live stream; it will be automatically pushed to the target destination.

```text
                +-----------------------+
RTMP/RTMPS      |                       | -------->  Facebook (RTMP)
    or  ------> |    Gcore Streaming    | -------->  YouTube (RTMPS)
SRT             |                       | -------->  Media server (SRT)
                +-----------------------+ -------->  Other RTMP/SRT targets
```

**Supported combinations:** RTMP → RTMP, RTMPS → RTMPS, RTMP → SRT, SRT → SRT, SRT → RTMP.
For SRT targets, only `mode=caller` is supported (Gcore initiates a PUSH connection).
  


Source stream parameters (bitrate, codecs, resolution) are sent "as is". Ensure they match the destination requirements.



## OpenAPI

````yaml /api-reference/services_documented/streaming_api.yaml post /streaming/restreams
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Streaming API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-11T15:10:30.328297+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: AI
    x-displayName: AI
  - name: Broadcasts
    x-displayName: Broadcasts
  - name: Directories
    x-displayName: Directories
  - name: Overlays
    x-displayName: Overlays
  - name: Players
    x-displayName: Players
  - name: Playlists
    x-displayName: Playlists
  - name: QualitySets
    x-displayName: QualitySets
  - name: Restreams
    x-displayName: Restreams
  - name: Streaming Statistics
    x-displayName: Statistics
  - name: Streams
    x-displayName: Streams
  - name: Subtitles
    x-displayName: Subtitles
  - name: Videos
    x-displayName: Videos
paths:
  /streaming/restreams:
    post:
      tags:
        - Restreams
      summary: Create restream
      description: >-
        Creates a new restream for a specified live stream.
          


        Specify the target platform's URI (RTMP, RTMPS, or SRT) and the ID of
        the source stream.
          


        Restreaming allows you to broadcast a single live stream to multiple
        platforms or servers simultaneously (e.g., Facebook, YouTube, or a
        custom media server).


        **How it works:**

        1. Get credentials (stream URL/key or SRT URL) from the target platform.

        2. Create a restream in the Gcore system by specifying the target URI
        and the source live stream.

        3. Start your live stream; it will be automatically pushed to the target
        destination.


        ```text
                        +-----------------------+
        RTMP/RTMPS      |                       | -------->  Facebook (RTMP)
            or  ------> |    Gcore Streaming    | -------->  YouTube (RTMPS)
        SRT             |                       | -------->  Media server (SRT)
                        +-----------------------+ -------->  Other RTMP/SRT targets
        ```


        **Supported combinations:** RTMP → RTMP, RTMPS → RTMPS, RTMP → SRT, SRT
        → SRT, SRT → RTMP.

        For SRT targets, only `mode=caller` is supported (Gcore initiates a PUSH
        connection).
          


        Source stream parameters (bitrate, codecs, resolution) are sent "as is".
        Ensure they match the destination requirements.
      operationId: post_restreams
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                restream:
                  $ref: '#/components/schemas/createRestream'
        required: false
      responses:
        '200':
          description: Successful
          content: {}
        '422':
          description: |-
            Possible error messages:   
             **{ "errors": { "stream": [ "must exist" ] } }**   
             A required parameter *`stream_id`* wasn't specified or a stream with such ID hasn't been created.   
             **{ "errors": { "stream": [ "does not belong to the same client " ] } }**   
             A stream with specified ID belongs to another client. **{ "errors": { "uri": [ "invalid uri, supported protocols are rtmp, rtmps, srt" ] } }**   
             A required parameter *uri* wasn't specified or the input protocol is not supported
          content: {}
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            client.streaming.restreams.create()
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/option\"\n\t\"github.com/G-Core/gcore-go/streaming\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Streaming.Restreams.New(context.TODO(), streaming.RestreamNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
components:
  schemas:
    createRestream:
      type: object
      properties:
        name:
          type: string
          description: Restream name
        live:
          type: boolean
          description: >-
            Indicates that the stream is being published. Has two possible
            values:


            - **true** — stream is being published

            - **false** — stream isn't published
        active:
          type: boolean
          description: |-
            Enables/Disables restream. Has two possible values:

            - **true** — restream is enabled and can be started
            - **false** — restream is disabled.

              
            Default is true
        uri:
          type: string
          description: >-
            A URL to push the stream to. Supported protocols: rtmp, rtmps, srt.
            For SRT target URLs, only `mode=caller` is supported.
          example: srt://example.com:1234?mode=caller
        stream_id:
          type: integer
          description: ID of the stream to restream
        client_user_id:
          type: integer
          description: Custom field where you can specify user ID in your system
      example:
        name: first restream
        active: true
        uri: rtmp://a.rtmp.youtube.com/live/k17a-13s8
        stream_id: 20
        client_user_id: 10
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````