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

# Upload a file

> Uploads a file to the CDN (multipart, `file` field). Images and video are compressed by default; `compress=false` keeps the original.



## OpenAPI

````yaml en/openapi/en-api-v3-openapi.yaml POST /cdn/assets
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/assets:
    post:
      tags:
        - CDN Assets
      summary: Upload a file
      description: >-
        Uploads a file to the CDN (multipart, `file` field). Images and video
        are compressed by default; `compress=false` keeps the original.
      parameters:
        - name: domain
          in: query
          required: false
          description: >
            Пространство имён. `default` — наш общий namespace, либо домен
            клиента для его собственных файлов.
          schema:
            type: string
          example: client.ru
        - name: path
          in: query
          required: false
          description: Произвольный путь внутри пространства имён.
          schema:
            type: string
          example: branding/logo.png
        - name: folderId
          in: query
          required: false
          description: ID папки UI для группировки. На путь не влияет.
          schema:
            type: string
        - name: slug
          in: query
          required: false
          description: Имя файла, используется если не задан `path`.
          schema:
            type: string
          example: logo.png
        - name: autoFolders
          in: query
          required: false
          description: >-
            Создать папку UI по первому сегменту пути, если `folderId` не
            передан.
          schema:
            type: boolean
          example: true
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Файл, максимум 250 МБ.
                name:
                  type: string
                  description: Отображаемое имя. По умолчанию имя файла.
                slug:
                  type: string
                  description: Имя файла, если не задан `path`.
                path:
                  type: string
                  description: Произвольный путь, если не заданы `folderId` и `slug`.
                domain:
                  type: string
                  default: default
                folderId:
                  type: string
                isPinned:
                  type: boolean
                autoFolders:
                  type: boolean
            example:
              file: (binary)
              path: branding/logo.png
              folderId: fld_2Qx7
              compress: true
      responses:
        '200':
          description: The asset has been created, cache warming has been sent to edge.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  asset:
                    $ref: '#/components/schemas/CdnAsset'
                  edgeCached:
                    type: boolean
                    description: >-
                      Whether the edge cache was warmed before the upload
                      response.
              examples:
                asset_created_ok:
                  summary: Asset created ok
                  value:
                    asset:
                      name: Инструкция
                      slug: manual.png
                      domain: default
                      path: docs/manual.png
                      fullPath: default/docs/manual.png
                      full_path: default/docs/manual.png
                      folderId: 0199a1b7-033e-7e99-b1f2-6be98f4b2b1d
                      folder_id: 0199a1b7-033e-7e99-b1f2-6be98f4b2b1d
                      sourceType: LOCAL
                      source_type: LOCAL
                      sourceUrl: default/docs/manual.png
                      source_url: default/docs/manual.png
                      isPinned: true
                      is_pinned: 1
                      mimeType: image/png
                      mime_type: image/png
                      size: 70
                      sha256: >-
                        c2153f77e11087fcb078ae38527fa83bef29791e3700e30cc87fec4405a66d0f
                      downloads: 0
                      createdAt: '2026-10-06T14:56:09.0798434Z'
                      created_at: '2026-10-06T14:56:09.0798434Z'
                      updatedAt: '2026-10-06T14:56:09.0798434Z'
                      updated_at: '2026-10-06T14:56:09.0798434Z'
                      folder:
                        name: Документы
                        slug: docs
                    success: true
        '400':
          description: Bad Request (400) — incorrect request parameters.
          content:
            application/json:
              examples:
                invalid_param:
                  summary: Invalid param
                  value:
                    code: 5004
                    message: Invalid Param Name
                missing_params:
                  summary: Missing params
                  value:
                    code: 5002
                    message: Missing Parameters
        '401':
          description: Unauthorized (401) - the key was not transferred.
          content:
            application/json:
              examples:
                missing_token:
                  summary: Missing token
                  value:
                    code: 5007
                    message: Missing Token
        '403':
          description: Forbidden (403) - there is a key, but not enough rights.
          content:
            application/json:
              examples:
                missing_token:
                  summary: Missing token
                  value:
                    code: 5007
                    message: Missing Token
        '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
        '503':
          description: Storage is unavailable.
          content:
            application/json:
              examples:
                storage_unavailable:
                  summary: Storage unavailable
                  value:
                    code: 5138
                    message: CDN Storage Unavailable
      security:
        - ApiKeyHeader: []
components:
  schemas:
    CdnAsset:
      type: object
      description: >-
        Organizational asset; domain/path and fullPath specify the MinIO key.
        folderId specifies the grouping.
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        domain:
          type: string
          description: Namespace, first path segment.
          example: default
        path:
          type: string
          description: A path within a namespace.
          example: branding/logo.png
        fullPath:
          type: string
          description: Full path `{domain}/{path}`.
          example: default/branding/logo.png
        full_path:
          type: string
        folderId:
          type:
            - string
            - 'null'
        folder_id:
          type:
            - string
            - 'null'
        folder:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            name:
              type: string
            slug:
              type: string
        sourceType:
          type: string
          enum:
            - LOCAL
            - EXTERNAL
        source_type:
          type: string
        sourceUrl:
          type: string
          description: >-
            For LOCAL - the object key in MinIO, for EXTERNAL - the original
            address.
        source_url:
          type: string
        isPinned:
          type: boolean
        is_pinned:
          type: integer
        mimeType:
          type: string
        mime_type:
          type: string
        size:
          type: integer
          description: Size in bytes.
        sha256:
          type:
            - string
            - 'null'
        downloads:
          type: integer
          description: Always 0, files are sent by edge directly from MinIO.
        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
  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.