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

# Change subtitle

> Method to update subtitle of a video. 

You can update all or only some of fields you need.

If you want to replace the text of subtitles (i.e. found a typo in the text, or the timing in the video changed), then:
- download it using GET method,
- change it in an external editor,
- and update it using this PATCH method.

Just like videos, subtitles are cached, so it takes time to update the data. See POST method for details.



## OpenAPI

````yaml /api-reference/services_documented/streaming_api.yaml patch /streaming/videos/{video_id}/subtitles/{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: '2026-05-07T20:33:46.548242+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/videos/{video_id}/subtitles/{id}:
    patch:
      tags:
        - Subtitles
      summary: Change subtitle
      description: >-
        Method to update subtitle of a video. 


        You can update all or only some of fields you need.


        If you want to replace the text of subtitles (i.e. found a typo in the
        text, or the timing in the video changed), then:

        - download it using GET method,

        - change it in an external editor,

        - and update it using this PATCH method.


        Just like videos, subtitles are cached, so it takes time to update the
        data. See POST method for details.
      operationId: patch_api_videos_video_id_subtitles_id
      parameters:
        - name: id
          in: path
          description: ID of a subtitle
          required: true
          schema:
            type: integer
        - name: video_id
          in: path
          description: ID of a video
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/subtitleBodyPatch'
        required: true
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subtitlePatched'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        '422':
          description: One or more parameters were specified incorrectly, check the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subtitleerror422'
      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
            )
            subtitle_base = client.streaming.videos.subtitles.update(
                id=0,
                video_id=0,
            )
            print(subtitle_base.language)
        - 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\tsubtitleBase, err := client.Streaming.Videos.Subtitles.Update(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tstreaming.VideoSubtitleUpdateParams{\n\t\t\tVideoID:      0,\n\t\t\tSubtitleBase: streaming.SubtitleBaseParam{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", subtitleBase.Language)\n}\n"
components:
  schemas:
    subtitleBodyPatch:
      allOf:
        - $ref: '#/components/schemas/subtitleBase'
        - example:
            language: ltz
    subtitlePatched:
      allOf:
        - $ref: '#/components/schemas/subtitleBase'
        - example:
            name: German (AI-generated)
            language: ltz
            vtt: >-
              WEBVTT


              1

              00:00:07.154 --> 00:00:12.736

              Wir haben 100 Millionen registrierte Benutzer oder aktive
              Benutzer, die mindestens einmal pro Woche spielen.


              2

              00:00:13.236 --> 00:00:20.198

              Wir haben vielleicht 80 oder 100.000, die auf einem bestimmten
              Cluster spielen.
    notfound:
      allOf:
        - $ref: '#/components/schemas/badrequest'
        - example:
            status: 404
            error: >-
              Not Found. Entity you are looking for was not found, please check
              the initial parameters
    subtitleerror422:
      allOf:
        - $ref: '#/components/schemas/badrequest'
        - example:
            status: 422
            error: Unprocessable Entity. Language code is not recognized.
    subtitleBase:
      type: object
      properties:
        name:
          type: string
          description: Name of subtitle file
        language:
          type: string
          description: 3-letter language code according to ISO-639-2 (bibliographic code)
        vtt:
          type: string
          description: >-
            Full text of subtitles/captions, with escaped "\n" ("\r") symbol of
            new line
      example: null
    badrequest:
      type: object
      properties:
        status:
          type: integer
          description: Error number
        error:
          type: string
          description: Error message
      example:
        status: 400
        error: >-
          Bad Request response status code indicates that the server cannot or
          will not process the request due to something that is perceived to be
          a client error (for example, malformed request syntax, invalid request
          message framing, or deceptive request routing).
  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

````