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

# Change restream

> Updates restream settings, such as the target URI or active status



## OpenAPI

````yaml /api-reference/services_docs_mintlify_enriched/streaming_api.yaml patch /streaming/restreams/{restream_id}
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: a530a0309a3f
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: AI
  - name: Broadcasts
  - name: Directories
  - name: Overlays
  - name: Players
  - name: Playlists
  - name: QualitySets
  - name: Restreams
  - name: Statistics
  - name: Streams
  - name: Subtitles
  - name: Videos
paths:
  /streaming/restreams/{restream_id}:
    patch:
      tags:
        - Restreams
      summary: Change restream
      description: Updates restream settings, such as the target URI or active status
      operationId: patch_restreams_id
      parameters:
        - name: restream_id
          in: path
          description: Restream ID
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                restream:
                  $ref: '#/components/schemas/createRestream'
        required: false
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/restream'
        '422':
          description: |-
            Possible error messages:   
             **{ "errors": { "stream": [ "must exist" ] } }**   
             A stream with such ID was deleted or hasn't been created yet.   
             **{ "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 *uri* parameter input protocol is not supported. **{ "errors": { "no_audio": [ "must be boolean" ] } }**   
             The *`no_audio`* parameter was set to a non-boolean value.
          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
            )
            restream = client.streaming.restreams.update(
                restream_id=0,
            )
            print(restream.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\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\trestream, err := client.Streaming.Restreams.Update(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tstreaming.RestreamUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", restream.ID)\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
        no_audio:
          type: boolean
          default: false
          description: >-
            Removes the source audio track from the restream. Has two possible
            values:

            - false – the source audio track is forwarded to the target as is
            (default)

            - true – the audio track is removed or replaced, depending on
            `no_audio_mode`


            Useful to avoid copyright claims on platforms like YouTube when the
            source stream contains licensed music or other copyrighted audio.


            Only strict boolean values (`true`/`false`) are accepted; any other
            value returns a 422 error.
        no_audio_mode:
          type: string
          default: drop
          enum:
            - drop
            - silence
          description: >-
            Defines how the audio track is handled when `no_audio` is `true`.
            Ignored when `no_audio` is `false`.


            Types:
              - "drop" – removes the audio track entirely.
              - "silence" – replaces the audio track with a silent track instead of removing it.

            > **Note:** YouTube rejects incoming streams with no audio track at
            all. Use `no_audio_mode=silence` when restreaming to YouTube.
        source:
          type: string
          default: original
          enum:
            - original
            - transcoded
          description: >-
            Selects which version of the stream is used as the source for the
            restream.


            Types:
              - "original" – uses the original ingested stream without any modifications (default).
              - "transcoded" – uses the transcoded output, including overlays. Use it when you want to restream the stream with enabled overlays.

            > **Note:** For `transcoded`, the highest quality available in the
            stream's quality ladder is used. For example, if the ladder is
            480p/720p/1080p, 1080p is used; if the ladder goes up to 4K, 4K is
            used.
      example:
        name: first restream
        active: true
        uri: rtmp://a.rtmp.youtube.com/live/k17a-13s8
        stream_id: 20
        client_user_id: 10
        source: original
        no_audio: true
        no_audio_mode: silence
    restream:
      allOf:
        - $ref: '#/components/schemas/createRestream'
        - properties:
            id:
              type: integer
              description: Restream ID
            client_id:
              type: integer
              description: Client ID
            playlist_id:
              type: integer
              nullable: true
              default: null
              description: >-
                ID of the playlist used as source for the restream, if
                applicable
            quality_id:
              type: integer
              nullable: true
              default: null
              description: >-
                ID of the specific transcoded quality used as source for the
                restream, if applicable
      example:
        id: 287834
        name: Live Stream to Youtube 2024-06-21
        live: false
        active: true
        client_id: 102748
        uri: rtmp://a.rtmp.youtube.com/live2/6w4g-9cw7-62dh-c6se-b4hq
        stream_id: 1439046
        playlist_id: null
        client_user_id: 1000
        quality_id: null
        source: transcoded
  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

````