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

# Update directory

> Change a directory name or move to another "parent_id".



## OpenAPI

````yaml /api-reference/services_documented/streaming_api.yaml patch /streaming/directories/{directory_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/directories/{directory_id}:
    patch:
      tags:
        - Directories
      summary: Update directory
      description: Change a directory name or move to another "parent_id".
      operationId: patch_directories_id
      parameters:
        - name: directory_id
          in: path
          description: Directory ID
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/directory_patch'
        required: true
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/directory_base'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        '422':
          description: |-
            Possible error messages:   
             **{ "errors": { "name": [ "can't be blank" ] } }**   
             *Name* is a required parameter, so it must be specified
          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
            )
            directory_base = client.streaming.directories.update(
                directory_id=0,
            )
            print(directory_base.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\tdirectoryBase, err := client.Streaming.Directories.Update(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tstreaming.DirectoryUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", directoryBase.ID)\n}\n"
components:
  schemas:
    directory_patch:
      type: object
      properties:
        name:
          type: string
          description: Title of the directory. Omit this if you don't want to change.
        parent_id:
          type: integer
          description: >-
            ID of a parent directory. "null" if it's in the root. Omit this if
            you don't want to change.
      example:
        name: New series. Season 2
    directory_base:
      type: object
      properties:
        id:
          type: integer
          description: ID of the directory
        name:
          type: string
          description: Title of the directory
        parent_id:
          type: integer
          description: ID of a parent directory. "null" if it's in the root.
          default: null
        items_count:
          type: integer
          description: >-
            Number of objects in this directory. Counting files and folders. The
            quantity is calculated only at one level (not recursively in all
            subfolders).
        created_at:
          type: string
          description: Time of creation. Datetime in ISO 8601 format.
        updated_at:
          type: string
          description: >-
            Time of last update of the directory entity. Datetime in ISO 8601
            format.
      example:
        id: 100
        name: New series
        parent_id: null
        items_count: 2
        created_at: '2024-07-01T18:00:00Z'
        updated_at: '2024-07-01T18:00:00Z'
    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
    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

````