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

# Update folders

> `orderedIds` changes the folder order; `ids` with `name` or `slug` renames them. Files stay in place.



## OpenAPI

````yaml en/openapi/en-api-v3-openapi.yaml PATCH /cdn/folders
openapi: 3.1.0
info:
  title: ER:LC Russia API V3
  description: >-
    ER:LC Russia API for servers, users, CDN, redirects, subscriptions, and
    access keys.
  version: 3.0.0
servers:
  - url: https://api.erlcrussia.com/v3
    description: Production server (com)
  - url: https://api.erlcrussia.xyz/v3
    description: Backup server (xyz)
security: []
tags:
  - name: ER:LC Server
    description: Obtaining status, online, lists of players and staff of the ER:LC server.
  - name: ER:LC Teams
    description: Sending and queuing in-game server commands (:h, :m, :kick, :ban, etc.).
  - name: Economics
    description: >-
      Interaction with the economic system (users, businesses, mafias, stores,
      advertising).
  - name: Statistics API
    description: >-
      High-performance obtaining statistics of discord servers and game servers
      (online, participants, bots).
  - name: Verification API
    description: Search and comparison of Discord ID and Roblox ID accounts.
  - name: CDN Assets
    description: >-
      Load, manage, statistic and clear MinIO/Edge CDN object storage file
      cache.
  - name: CDN Folders
    description: Hierarchical structure and sorting of CDN media library folders.
  - name: Punishment API
    description: Manage the balance and transaction history of players' points.
  - name: Subscriptions API
    description: >-
      Catalog of plans, FunPay orders, accrual of benefits and activation of
      subscriptions.
  - name: Authorization API
    description: >-
      Login via Discord and Roblox OAuth2, manage user sessions and link
      accounts.
  - name: Management API - WebSocket Keys
    description: Managing access keys to the WebSocket gateway and channel subscriptions.
  - name: Management API - Webhooks
    description: Registration, accessibility validation and monitoring of custom webhooks.
  - name: Control API - Panel
    description: >-
      Management of users, subscriptions, tariffs, manual balance and system
      statistics.
  - name: State API
    description: >-
      Monitoring the performance of the service, connections to PostgreSQL and
      Redis.
  - name: AI Audio
  - name: AI Studio
  - name: AI administration
  - name: API Keys
  - name: Admin API - Servers
  - name: Administration of E-Coins
  - name: CDN
  - name: CDN Domains
  - name: CDN V3
  - name: Custom Webhooks
  - name: Management API - Servers
  - name: Management API - Tokens
  - name: Organization redirects V3
  - name: Private files and library
  - name: Рекламные кампании V3
paths:
  /cdn/folders:
    patch:
      tags:
        - CDN Folders
      summary: Update folders
      description: >-
        `orderedIds` changes the folder order; `ids` with `name` or `slug`
        renames them. Files stay in place.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  description: >-
                    Список ID папок. Передаётся только в теле запроса, не в
                    query.
                  items:
                    type: string
                name:
                  type: string
                pathEnabled:
                  type: boolean
                  default: true
                  description: Отключите для обычной папки галереи без префикса URL.
                slug:
                  type: string
                orderedIds:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - fld_2Qx7
              name: Логотипы
      responses:
        '200':
          description: Folders have been updated and/or sorted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  reordered:
                    type: integer
                  updatedCount:
                    type: integer
                  folders:
                    type: array
                    items:
                      $ref: '#/components/schemas/CdnFolder'
              examples:
                folders_updated_ok:
                  summary: Folders updated ok
                  value:
                    folders:
                      - name: Документы
                        slug: docs
                        sortOrder: 0
                        sort_order: 0
                        asset_count: 3
                        created_at: '2026-10-06T14:56:09.0229568Z'
                        createdAt: '2026-10-06T14:56:09.0229568Z'
                        updated_at: '2026-10-06T14:56:09.0229568Z'
                        updatedAt: '2026-10-06T14:56:09.0229568Z'
                    reordered: 0
                    success: true
                    updatedCount: 1
                folders_reordered_ok:
                  summary: Folders reordered ok
                  value:
                    reordered: 3
                    success: true
                    updatedCount: 0
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          description: Folder not found.
          content:
            application/json:
              examples:
                folder_not_found:
                  summary: Folder not found
                  value:
                    code: 5137
                    message: CDN Folder Not Found
        '409':
          description: Slug folder is already occupied.
          content:
            application/json:
              examples:
                folder_slug_taken:
                  summary: Folder slug taken
                  value:
                    code: 5136
                    message: CDN Folder Slug Already Exists
        '429':
          description: >-
            Request limit has been reached. Consider Retry-After; Don't run
            unlimited parallel downloads.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                code: 5016
                message: Rate Limit Exceeded
      security:
        - ApiKeyHeader: []
components:
  schemas:
    CdnFolder:
      type: object
      description: >-
        Organization folder. Renaming and changing pathEnabled does not rewrite
        the URL of already downloaded files.
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        pathEnabled:
          type: boolean
          default: true
          description: >-
            Adds slug folders only to new downloads without an explicitly
            specified path. false leaves the folder as an interface group.
        sortOrder:
          type: integer
        sort_order:
          type: integer
        asset_count:
          type: integer
        createdAt:
          type: string
        created_at:
          type: string
        updatedAt:
          type: string
        updated_at:
          type: string
        teamId:
          type: string
    APIError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        error:
          type: string
        details:
          type: object
          additionalProperties: true
      required:
        - code
        - message
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 5009
          description: Numeric error code ER:LC Russia API.
        message:
          type: string
          example: Forbidden
          description: System error message in English.
  responses:
    BadRequestError:
      description: Bad Request (400) - invalid request parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing_params:
              summary: Missing Parameters (5002)
              value:
                code: 5002
                message: Missing Parameters
            invalid_json:
              summary: Invalid JSON (5034)
              value:
                code: 5034
                message: Invalid Json
            invalid_param:
              summary: Invalid Param Name (5004)
              value:
                code: 5004
                message: Invalid Param Name
    UnauthorizedError:
      description: Unauthorized (401) — the API token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing_token:
              summary: Missing Token (5007)
              value:
                code: 5007
                message: Missing Token
            invalid_token:
              summary: Invalid Token (5008)
              value:
                code: 5008
                message: Invalid Token
    ForbiddenError:
      description: >-
        Forbidden (403) - access is prohibited (key, action or server
        restrictions).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            forbidden:
              summary: Forbidden (5009)
              value:
                code: 5009
                message: Forbidden
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: erlcrussia-api-key
      description: >-
        Custom API key. Store on the server; do not include client-side
        JavaScript.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.