openapi: 3.1.0
info:
  title: 'files API documentation'
  description: 'Website-scoped file storage and delivery used across solidpixels.'
  version: 1.0.0
servers:
  -
    url: 'https://files.app.solidpixels.com'
tags:
  -
    name: 'Website Files'
    description: 'Website-scoped file operations.'
  -
    name: 'Account Files'
    description: 'Account-scoped file operations.'
  -
    name: 'File Serving'
    description: 'Public endpoints for serving files and on-demand image processing.'
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: 'Use a JWT (Bearer token) for authentication.'
  schemas:
    CreateFileFolderRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 100
        namespace:
          type:
            - string
            - 'null'
          maxLength: 100
        parent_id:
          type:
            - string
            - 'null'
          maxLength: 35
      required:
        - name
    DeleteFileFolderResult:
      type: object
      properties:
        id:
          type: string
    DeleteFileFolderResultResponse:
      type: object
      properties:
        success:
          const: true
        data:
          $ref: '#/components/schemas/DeleteFileFolderResult'
        message:
          type: string
      required:
        - success
        - data
    DeleteFileResult:
      type: object
      properties:
        id:
          type: string
    DeleteFileResultResponse:
      type: object
      properties:
        success:
          const: true
        data:
          $ref: '#/components/schemas/DeleteFileResult'
        message:
          type: string
      required:
        - success
        - data
    DownloadFilesFromUrlRequest:
      type: object
      properties:
        urls:
          type: array
          description: 'Array of URLs to download.'
          items:
            type: string
        preserve_original:
          type: boolean
          description: 'Preserve the original file.'
        private:
          type: boolean
          description: 'Serve the new attachments only through signed URLs.'
        temporary:
          type: boolean
          description: 'Create private attachments that expire after one day or at expires_at (at most 7 days). Cannot be combined with private=false.'
        expires_at:
          type: string
          description: 'Attachment expiry timestamp (ISO 8601 with offset) in the future.'
      required:
        - urls
    Error:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        errors:
          type: object
      required:
        - success
        - message
    File:
      type: object
      properties:
        id:
          type: string
          maxLength: 35
        file_size:
          type: integer
        mime_type:
          type: string
          maxLength: 100
        cdn_path:
          type:
            - string
            - 'null'
        cdn_original_path:
          type:
            - string
            - 'null'
        serve_path:
          type:
            - string
            - 'null'
          maxLength: 500
        serve_mime_type:
          type:
            - string
            - 'null'
          maxLength: 100
          description: 'Resolved public response MIME when it differs from stored MIME.'
        metadata:
          type:
            - object
            - 'null'
        formats:
          type:
            - object
            - 'null'
        private:
          type: boolean
          description: 'The selected attachment is served only through signed URLs.'
        expires_at:
          type:
            - string
            - 'null'
          description: 'Expiry of the selected attachment.'
        namespace:
          type:
            - string
            - 'null'
          maxLength: 100
        attachment_id:
          type:
            - string
            - 'null'
          maxLength: 36
        folder_id:
          type:
            - string
            - 'null'
          maxLength: 35
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - file_size
        - mime_type
        - cdn_path
        - cdn_original_path
        - serve_path
        - serve_mime_type
        - metadata
        - formats
        - private
        - expires_at
        - namespace
        - attachment_id
        - folder_id
        - created_at
        - updated_at
    FileAttachment:
      type: object
      properties:
        id:
          type: string
          maxLength: 36
        file_id:
          type: string
          maxLength: 35
        namespace:
          type:
            - string
            - 'null'
          maxLength: 100
        folder_id:
          type:
            - string
            - 'null'
          maxLength: 35
        file:
          type: object
          properties:
            id:
              type: string
              maxLength: 35
            file_size:
              type: integer
            mime_type:
              type: string
              maxLength: 100
            cdn_path:
              type:
                - string
                - 'null'
            cdn_original_path:
              type:
                - string
                - 'null'
            serve_path:
              type:
                - string
                - 'null'
              maxLength: 500
            serve_mime_type:
              type:
                - string
                - 'null'
              maxLength: 100
              description: 'Resolved public response MIME when it differs from stored MIME.'
            metadata:
              type:
                - object
                - 'null'
            formats:
              type:
                - object
                - 'null'
            private:
              type: boolean
              description: 'The selected attachment is served only through signed URLs.'
            expires_at:
              type:
                - string
                - 'null'
              description: 'Expiry of the selected attachment.'
            namespace:
              type:
                - string
                - 'null'
              maxLength: 100
            attachment_id:
              type:
                - string
                - 'null'
              maxLength: 36
            folder_id:
              type:
                - string
                - 'null'
              maxLength: 35
            created_at:
              type: string
            updated_at:
              type: string
          required:
            - id
            - file_size
            - mime_type
            - cdn_path
            - cdn_original_path
            - serve_path
            - serve_mime_type
            - metadata
            - formats
            - private
            - expires_at
            - namespace
            - attachment_id
            - folder_id
            - created_at
            - updated_at
      required:
        - id
        - file_id
        - namespace
        - folder_id
        - file
    FileAttachmentPaginatedResponse:
      type: object
      properties:
        success:
          const: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/FileAttachment'
        message:
          type: string
        meta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - success
        - data
        - meta
    FileAttachmentResponse:
      type: object
      properties:
        success:
          const: true
        data:
          $ref: '#/components/schemas/FileAttachment'
        message:
          type: string
      required:
        - success
        - data
    FileFolder:
      type: object
      properties:
        id:
          type: string
          maxLength: 35
        name:
          type: string
          maxLength: 100
        namespace:
          type:
            - string
            - 'null'
          maxLength: 100
        parent_id:
          type:
            - string
            - 'null'
          maxLength: 35
        tree_position:
          type: integer
          minimum: 1
          description: '1-based position among the sibling folders. Read-only: change it with POST /folders/{folder}/move.'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - namespace
        - parent_id
        - tree_position
        - created_at
        - updated_at
    FileFolderPaginatedResponse:
      type: object
      properties:
        success:
          const: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/FileFolder'
        message:
          type: string
        meta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - success
        - data
        - meta
    FileFolderResponse:
      type: object
      properties:
        success:
          const: true
        data:
          $ref: '#/components/schemas/FileFolder'
        message:
          type: string
      required:
        - success
        - data
    FilePaginatedResponse:
      type: object
      properties:
        success:
          const: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/File'
        message:
          type: string
        meta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - success
        - data
        - meta
    FileResponse:
      type: object
      properties:
        success:
          const: true
        data:
          $ref: '#/components/schemas/File'
        message:
          type: string
      required:
        - success
        - data
    MoveFileAttachmentRequest:
      type: object
      properties:
        folder_id:
          type:
            - string
            - 'null'
          maxLength: 35
      required:
        - folder_id
    MoveFileFolderRequest:
      type: object
      properties:
        parent_id:
          type:
            - string
            - 'null'
          description: 'New parent ID. Null or omitted selects the top level.'
        position:
          type: integer
          minimum: 1
          description: '1-based position among the new siblings. A position past the last sibling moves the item last.'
      required:
        - position
    PaginationMeta:
      type: object
      properties:
        current_page:
          type: integer
        last_page:
          type: integer
        per_page:
          type: integer
        total:
          type: integer
      required:
        - current_page
        - last_page
        - per_page
        - total
    ScopedFileUploadRequest:
      type: object
      properties:
        files:
          type: array
          description: 'Array of binary files to upload.'
          items:
            type: string
            format: binary
        preserve_original:
          type: boolean
          description: 'Preserve the original file.'
        namespace:
          type:
            - string
            - 'null'
          maxLength: 100
          description: 'Attachment namespace. Null selects the default namespace.'
        folder_id:
          type:
            - string
            - 'null'
          maxLength: 35
          description: 'Folder in the selected owner and namespace. Null selects root.'
        serve_paths:
          type: array
          description: 'Exact target serve path per file (one entry per file).'
          items:
            type: string
            maxLength: 500
        private:
          type: boolean
          description: 'Serve the new attachments only through signed URLs.'
        temporary:
          type: boolean
          description: 'Create private attachments that expire after one day or at expires_at (at most 7 days). Cannot be combined with private=false.'
        expires_at:
          type: string
          description: 'Attachment expiry timestamp (ISO 8601 with offset) in the future.'
      required:
        - files
    UpdateFileFolderRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 100
    UpdateFileRequest:
      type: object
      properties:
        serve_path:
          type: string
          description: 'Maximum 500 characters.'
    UploadResult:
      type: object
      properties:
        filename:
          type: string
          maxLength: 500
        success:
          type: boolean
        created:
          type: boolean
        exists:
          type: boolean
        file:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              maxLength: 35
            file_size:
              type: integer
            mime_type:
              type: string
              maxLength: 100
            cdn_path:
              type:
                - string
                - 'null'
            cdn_original_path:
              type:
                - string
                - 'null'
            serve_path:
              type:
                - string
                - 'null'
              maxLength: 500
            serve_mime_type:
              type:
                - string
                - 'null'
              maxLength: 100
              description: 'Resolved public response MIME when it differs from stored MIME.'
            metadata:
              type:
                - object
                - 'null'
            formats:
              type:
                - object
                - 'null'
            private:
              type: boolean
              description: 'The selected attachment is served only through signed URLs.'
            expires_at:
              type:
                - string
                - 'null'
              description: 'Expiry of the selected attachment.'
            namespace:
              type:
                - string
                - 'null'
              maxLength: 100
            attachment_id:
              type:
                - string
                - 'null'
              maxLength: 36
            folder_id:
              type:
                - string
                - 'null'
              maxLength: 35
            created_at:
              type: string
            updated_at:
              type: string
          required:
            - id
            - file_size
            - mime_type
            - cdn_path
            - cdn_original_path
            - serve_path
            - serve_mime_type
            - metadata
            - formats
            - private
            - expires_at
            - namespace
            - attachment_id
            - folder_id
            - created_at
            - updated_at
        error:
          type:
            - string
            - 'null'
      required:
        - filename
        - success
        - created
        - exists
        - file
        - error
    UploadResultCollectionResponse:
      type: object
      properties:
        success:
          const: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/UploadResult'
        message:
          type: string
      required:
        - success
        - data
    ValidationError:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        errors:
          type: object
      required:
        - success
        - message
        - errors
  responses:
    Forbidden:
      description: Forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: 'Internal server error.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: 'Not found.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthenticated:
      description: Unauthenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationFailed:
      description: 'Validation failed.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
security:
  -
    default: []
paths:
  /api/v1/websites/files:
    get:
      summary: 'List files'
      operationId: getApiV1WebsitesFiles
      description: 'Name matching and sorting use the full serve_path. Each stored file appears once, using the lowest-ID matching attachment. Default order: files.created_at DESC, files.id ASC. The default page size is 20, with a maximum of 100.'
      parameters:
        -
          in: query
          name: page
          description: 'Page number.'
          required: false
          schema:
            type: integer
            description: 'Page number.'
            examples:
              - 1
        -
          in: query
          name: per_page
          description: 'Items per page (max 100).'
          required: false
          schema:
            type: integer
            description: 'Items per page (max 100).'
            examples:
              - 20
            default: 20
            maximum: 100
        -
          in: query
          name: namespace
          description: 'Filter by namespace. Empty selects the default namespace.'
          required: false
          schema:
            type: string
            description: 'Filter by namespace. Empty selects the default namespace.'
            examples:
              - assets
            maxLength: 100
        -
          in: query
          name: serve_path
          description: 'Filter by exact serve path.'
          required: false
          schema:
            type: string
            description: 'Filter by exact serve path.'
            examples:
              - notes/plan.md
        -
          in: query
          name: 'filter[name]'
          description: 'Literal, case-insensitive substring of the full serve_path. Blank values are ignored. Maximum 500 characters before trimming.'
          required: false
          schema:
            type: string
            description: 'Literal, case-insensitive substring of the full serve_path. Blank values are ignored. Maximum 500 characters before trimming.'
            examples:
              - banner
            maxLength: 500
        -
          in: query
          name: 'filter[id][]'
          description: 'File IDs combined with OR, up to 100. Missing or inaccessible files are omitted. Other filters combine with AND.'
          required: false
          schema:
            type: array
            description: 'File IDs combined with OR, up to 100. Missing or inaccessible files are omitted. Other filters combine with AND.'
            items:
              type: string
              pattern: '^fi_[0-9a-f]{32}$'
            examples:
              -
                - fi_0123456789abcdef0123456789abcdef
            minItems: 1
            maxItems: 100
          style: form
          explode: true
        -
          in: query
          name: 'filter[mime_type]'
          description: 'Exact MIME type or trailing type/* family. Use this or the array form.'
          required: false
          schema:
            type: string
            description: 'Exact MIME type or trailing type/* family. Use this or the array form.'
            examples:
              - 'image/*'
            maxLength: 100
        -
          in: query
          name: 'filter[mime_type][]'
          description: 'MIME types or families combined with OR. Other filters combine with AND.'
          required: false
          schema:
            type: array
            description: 'MIME types or families combined with OR. Other filters combine with AND.'
            items:
              type: string
              maxLength: 100
            examples:
              -
                - 'image/*'
                - application/pdf
            minItems: 1
          style: form
          explode: true
        -
          in: query
          name: sort
          description: 'Comma-separated name, file_size, or created_at. Prefix a field with - for descending order. Unsupported fields return 422.'
          required: false
          schema:
            type: string
            description: 'Comma-separated name, file_size, or created_at. Prefix a field with - for descending order. Unsupported fields return 422.'
            examples:
              - 'name,-file_size'
            pattern: '^\s*(?:-?(?:name|file_size|created_at)(?:\s*,\s*-?(?:name|file_size|created_at))*)?\s*$'
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilePaginatedResponse'
              example:
                success: true
                data:
                  -
                    id: fi_w7hikcnvqf9k
                    file_size: 96355
                    mime_type: image/webp
                    cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                    serve_path: assets/itaque.webp
                    serve_mime_type: null
                    metadata:
                      width: 2108
                      height: 1015
                      is_animated: false
                      has_transparency: false
                    formats:
                      jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                      webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                    private: false
                    expires_at: null
                    namespace: null
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                    attachment_id: fat_gzu16lymnbzh
                    folder_id: null
                  -
                    id: fi_w7hikcnvqf9k
                    file_size: 96355
                    mime_type: image/webp
                    cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                    serve_path: assets/itaque.webp
                    serve_mime_type: null
                    metadata:
                      width: 2108
                      height: 1015
                      is_animated: false
                      has_transparency: false
                    formats:
                      jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                      webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                    private: false
                    expires_at: null
                    namespace: null
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                    attachment_id: fat_gzu16lymnbzh
                    folder_id: null
                meta:
                  current_page: 1
                  last_page: 5
                  per_page: 15
                  total: 73
                message: 'Files retrieved'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
    post:
      summary: 'Upload files'
      operationId: postApiV1WebsitesFiles
      description: 'Uploads files to the website scope.'
      parameters: []
      responses:
        200:
          description: 'All files already existed (no new uploads). Items have `created: false` and `exists: true`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files uploaded'
        201:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files uploaded'
        207:
          description: 'Partial success - some uploads failed. Check individual item `success` and `error` fields.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files uploaded'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ScopedFileUploadRequest'
  /api/v1/websites/files/archive:
    get:
      summary: 'Download files as zip'
      operationId: getApiV1WebsitesFilesArchive
      description: 'Streams the selected files as one uncompressed zip. Each file uses its lowest-ID attachment in the selected namespace. Entry paths are the folder path plus the serving path base name. Repeated paths get a number. Any missing, expired, or out-of-scope file returns 404 for the whole request.'
      parameters:
        -
          in: query
          name: 'ids[]'
          description: '1 to 100 unique file IDs in entry order.'
          required: true
          schema:
            type: array
            description: '1 to 100 unique file IDs in entry order.'
            items:
              type: string
              pattern: '^fi_[0-9a-z]{32}$'
            examples:
              -
                - fi_0123456789abcdef0123456789abcdef
            minItems: 1
            maxItems: 100
            uniqueItems: true
          style: form
          explode: true
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
            maxLength: 100
      responses:
        200:
          description: ''
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
  '/api/v1/websites/files/{file}':
    get:
      summary: 'Get file'
      operationId: getApiV1WebsitesFilesByFile
      description: 'Fetch file metadata.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
              example:
                success: true
                data:
                  id: fi_w7hikcnvqf9k
                  file_size: 96355
                  mime_type: image/webp
                  cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                  cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                  serve_path: assets/itaque.webp
                  serve_mime_type: null
                  metadata:
                    width: 2108
                    height: 1015
                    is_animated: false
                    has_transparency: false
                  formats:
                    jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                    webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                  private: false
                  expires_at: null
                  namespace: null
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
                  attachment_id: fat_gzu16lymnbzh
                  folder_id: null
                message: 'File retrieved'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
    put:
      summary: 'Update file'
      operationId: putApiV1WebsitesFilesByFile
      description: 'Update serve path.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
              example:
                success: true
                data:
                  id: fi_w7hikcnvqf9k
                  file_size: 96355
                  mime_type: image/webp
                  cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                  cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                  serve_path: assets/itaque.webp
                  serve_mime_type: null
                  metadata:
                    width: 2108
                    height: 1015
                    is_animated: false
                    has_transparency: false
                  formats:
                    jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                    webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                  private: false
                  expires_at: null
                  namespace: null
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
                  attachment_id: fat_gzu16lymnbzh
                  folder_id: null
                message: 'File updated'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFileRequest'
    delete:
      summary: 'Delete file'
      operationId: deleteApiV1WebsitesFilesByFile
      description: 'Detach or delete a file.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteFileResultResponse'
              example:
                success: true
                data:
                  id: fi_gzu16lymnbzh
                message: 'File deleted successfully'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
    parameters:
      -
        in: path
        name: file
        description: 'Prefixed file ID (fi_...)'
        required: true
        schema:
          type: string
          examples:
            - fi_01jk8mz3x9n7q2w4v6b5
  '/api/v1/websites/files/{file}/download':
    get:
      summary: 'Download file'
      operationId: getApiV1WebsitesFilesByFileDownload
      description: 'Stream file content.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
    parameters:
      -
        in: path
        name: file
        description: 'Prefixed file ID (fi_...)'
        required: true
        schema:
          type: string
          examples:
            - fi_01jk8mz3x9n7q2w4v6b5
  /api/v1/websites/files/download-from:
    post:
      summary: 'Download from URL'
      operationId: postApiV1WebsitesFilesDownloadFrom
      description: 'Downloads files from URLs and stores them as website files.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files downloaded'
        207:
          description: 'Partial success - some downloads failed.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files downloaded'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DownloadFilesFromUrlRequest'
  /api/v1/files:
    get:
      summary: 'List files'
      operationId: getApiV1Files
      description: 'Name matching and sorting use the full serve_path. Each stored file appears once, using the lowest-ID matching attachment. Default order: files.created_at DESC, files.id ASC. The default page size is 20, with a maximum of 100.'
      parameters:
        -
          in: query
          name: page
          description: 'Page number.'
          required: false
          schema:
            type: integer
            description: 'Page number.'
            examples:
              - 1
        -
          in: query
          name: per_page
          description: 'Items per page (max 100).'
          required: false
          schema:
            type: integer
            description: 'Items per page (max 100).'
            examples:
              - 20
            default: 20
            maximum: 100
        -
          in: query
          name: namespace
          description: 'Filter by namespace. Empty selects the default namespace.'
          required: false
          schema:
            type: string
            description: 'Filter by namespace. Empty selects the default namespace.'
            examples:
              - assets
            maxLength: 100
        -
          in: query
          name: serve_path
          description: 'Filter by exact serve path.'
          required: false
          schema:
            type: string
            description: 'Filter by exact serve path.'
            examples:
              - notes/plan.md
        -
          in: query
          name: 'filter[name]'
          description: 'Literal, case-insensitive substring of the full serve_path. Blank values are ignored. Maximum 500 characters before trimming.'
          required: false
          schema:
            type: string
            description: 'Literal, case-insensitive substring of the full serve_path. Blank values are ignored. Maximum 500 characters before trimming.'
            examples:
              - banner
            maxLength: 500
        -
          in: query
          name: 'filter[id][]'
          description: 'File IDs combined with OR, up to 100. Missing or inaccessible files are omitted. Other filters combine with AND.'
          required: false
          schema:
            type: array
            description: 'File IDs combined with OR, up to 100. Missing or inaccessible files are omitted. Other filters combine with AND.'
            items:
              type: string
              pattern: '^fi_[0-9a-f]{32}$'
            examples:
              -
                - fi_0123456789abcdef0123456789abcdef
            minItems: 1
            maxItems: 100
          style: form
          explode: true
        -
          in: query
          name: 'filter[mime_type]'
          description: 'Exact MIME type or trailing type/* family. Use this or the array form.'
          required: false
          schema:
            type: string
            description: 'Exact MIME type or trailing type/* family. Use this or the array form.'
            examples:
              - 'image/*'
            maxLength: 100
        -
          in: query
          name: 'filter[mime_type][]'
          description: 'MIME types or families combined with OR. Other filters combine with AND.'
          required: false
          schema:
            type: array
            description: 'MIME types or families combined with OR. Other filters combine with AND.'
            items:
              type: string
              maxLength: 100
            examples:
              -
                - 'image/*'
                - application/pdf
            minItems: 1
          style: form
          explode: true
        -
          in: query
          name: sort
          description: 'Comma-separated name, file_size, or created_at. Prefix a field with - for descending order. Unsupported fields return 422.'
          required: false
          schema:
            type: string
            description: 'Comma-separated name, file_size, or created_at. Prefix a field with - for descending order. Unsupported fields return 422.'
            examples:
              - 'name,-file_size'
            pattern: '^\s*(?:-?(?:name|file_size|created_at)(?:\s*,\s*-?(?:name|file_size|created_at))*)?\s*$'
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilePaginatedResponse'
              example:
                success: true
                data:
                  -
                    id: fi_w7hikcnvqf9k
                    file_size: 96355
                    mime_type: image/webp
                    cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                    serve_path: assets/itaque.webp
                    serve_mime_type: null
                    metadata:
                      width: 2108
                      height: 1015
                      is_animated: false
                      has_transparency: false
                    formats:
                      jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                      webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                    private: false
                    expires_at: null
                    namespace: null
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                    attachment_id: fat_gzu16lymnbzh
                    folder_id: null
                  -
                    id: fi_w7hikcnvqf9k
                    file_size: 96355
                    mime_type: image/webp
                    cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                    serve_path: assets/itaque.webp
                    serve_mime_type: null
                    metadata:
                      width: 2108
                      height: 1015
                      is_animated: false
                      has_transparency: false
                    formats:
                      jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                      webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                    private: false
                    expires_at: null
                    namespace: null
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                    attachment_id: fat_gzu16lymnbzh
                    folder_id: null
                meta:
                  current_page: 1
                  last_page: 5
                  per_page: 15
                  total: 73
                message: 'Files retrieved'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
  /api/v1/websites/folders:
    get:
      summary: 'List folders'
      operationId: getApiV1WebsitesFolders
      description: 'Lists direct children by default. include_descendants=true returns all descendants as flat records, excluding the selected parent. Omitted namespace and parent select the default namespace root. Sorts by tree position, creation time, then ID and paginates the complete selection.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
            maxLength: 100
        -
          in: query
          name: parent_id
          description: 'Parent folder ID. Empty selects root.'
          required: false
          schema:
            type: string
            description: 'Parent folder ID. Empty selects root.'
            examples:
              - aspernatur
            maxLength: 35
        -
          in: query
          name: include_descendants
          description: 'Include all descendants. Accepts true, false, 1, or 0. Defaults to false. At root, includes every folder in the selected namespace.'
          required: false
          schema:
            type: boolean
            description: 'Include all descendants. Accepts true, false, 1, or 0. Defaults to false. At root, includes every folder in the selected namespace.'
            examples:
              - false
        -
          in: query
          name: page
          description: 'Page number.'
          required: false
          schema:
            type: integer
            description: 'Page number.'
            examples:
              - 1
        -
          in: query
          name: per_page
          description: 'Page size. Default 20, maximum 100.'
          required: false
          schema:
            type: integer
            description: 'Page size. Default 20, maximum 100.'
            examples:
              - 20
            default: 20
            maximum: 100
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFolderPaginatedResponse'
              example:
                success: true
                data:
                  -
                    id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    name: Photos
                    namespace: null
                    parent_id: null
                    tree_position: 1
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                  -
                    id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    name: Photos
                    namespace: null
                    parent_id: null
                    tree_position: 1
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                meta:
                  current_page: 1
                  last_page: 5
                  per_page: 15
                  total: 73
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
    post:
      summary: 'Create folder'
      operationId: postApiV1WebsitesFolders
      description: 'Creates a folder in the selected owner and namespace. Parent must share that scope.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFolderResponse'
              example:
                success: true
                data:
                  id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  name: Photos
                  namespace: null
                  parent_id: null
                  tree_position: 1
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFileFolderRequest'
  '/api/v1/websites/folders/{folder}':
    get:
      summary: 'Get folder'
      operationId: getApiV1WebsitesFoldersByFolder
      description: 'Returns one folder in the selected owner and namespace.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFolderResponse'
              example:
                success: true
                data:
                  id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  name: Photos
                  namespace: null
                  parent_id: null
                  tree_position: 1
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
    put:
      summary: 'Update folder'
      operationId: putApiV1WebsitesFoldersByFolder
      description: 'Renames a folder. Use POST /folders/{folder}/move to change the parent or position.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFolderResponse'
              example:
                success: true
                data:
                  id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  name: Photos
                  namespace: null
                  parent_id: null
                  tree_position: 1
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFileFolderRequest'
    delete:
      summary: 'Delete folder tree'
      operationId: deleteApiV1WebsitesFoldersByFolder
      description: 'Deletes the complete subtree. By default attachments move to namespace root. delete_files=true also removes subtree attachments.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
        -
          in: query
          name: delete_files
          description: 'Optional. Accepts true, false, 1, or 0 once. Defaults to false.'
          required: false
          schema:
            type: boolean
            description: 'Optional. Accepts true, false, 1, or 0 once. Defaults to false.'
            examples:
              - false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteFileFolderResultResponse'
              example:
                success: true
                data:
                  id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
    parameters:
      -
        in: path
        name: folder
        description: 'The folder.'
        required: true
        schema:
          type: string
          examples:
            - aspernatur
  /api/v1/websites/attachments:
    get:
      summary: 'List attachments'
      operationId: getApiV1WebsitesAttachments
      description: 'Returns each matching attachment separately. Omitted namespace and folder select the default namespace root. Expired attachments are excluded.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
            maxLength: 100
        -
          in: query
          name: folder_id
          description: 'Folder ID. Empty selects root.'
          required: false
          schema:
            type: string
            description: 'Folder ID. Empty selects root.'
            examples:
              - aspernatur
            maxLength: 35
        -
          in: query
          name: serve_path
          description: 'Exact serving path.'
          required: false
          schema:
            type: string
            description: 'Exact serving path.'
            examples:
              - aspernatur
        -
          in: query
          name: 'filter[name]'
          description: 'Case-insensitive literal substring of the full serving path.'
          required: false
          schema:
            type: string
            description: 'Case-insensitive literal substring of the full serving path.'
            examples:
              - aspernatur
            maxLength: 500
        -
          in: query
          name: 'filter[mime_type]'
          description: 'Stored MIME or type/* family.'
          required: false
          schema:
            type: string
            description: 'Stored MIME or type/* family.'
            examples:
              - aspernatur
            maxLength: 100
        -
          in: query
          name: 'filter[mime_type][]'
          description: 'Stored MIME alternatives.'
          required: false
          schema:
            type: array
            description: 'Stored MIME alternatives.'
            items:
              type: string
              maxLength: 100
            examples:
              -
                - aspernatur
            minItems: 1
          style: form
          explode: true
        -
          in: query
          name: sort
          description: 'Comma-separated name, file_size, or created_at. Prefix with - for descending. Default -created_at, then attachment ID.'
          required: false
          schema:
            type: string
            description: 'Comma-separated name, file_size, or created_at. Prefix with - for descending. Default -created_at, then attachment ID.'
            examples:
              - aspernatur
            pattern: '^\s*(?:-?(?:name|file_size|created_at)(?:\s*,\s*-?(?:name|file_size|created_at))*)?\s*$'
        -
          in: query
          name: page
          description: 'Page number.'
          required: false
          schema:
            type: integer
            description: 'Page number.'
            examples:
              - 1
        -
          in: query
          name: per_page
          description: 'Page size. Default 20, maximum 100.'
          required: false
          schema:
            type: integer
            description: 'Page size. Default 20, maximum 100.'
            examples:
              - 20
            default: 20
            maximum: 100
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileAttachmentPaginatedResponse'
              example:
                success: true
                data:
                  -
                    id: fat_gzu16lymnbzh
                    file_id: fi_w7hikcnvqf9k
                    namespace: null
                    folder_id: null
                    file:
                      id: fi_w7hikcnvqf9k
                      file_size: 96355
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                      serve_path: assets/itaque.webp
                      serve_mime_type: null
                      metadata:
                        width: 2108
                        height: 1015
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_gzu16lymnbzh
                      folder_id: null
                  -
                    id: fat_gzu16lymnbzh
                    file_id: fi_w7hikcnvqf9k
                    namespace: null
                    folder_id: null
                    file:
                      id: fi_w7hikcnvqf9k
                      file_size: 96355
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                      serve_path: assets/itaque.webp
                      serve_mime_type: null
                      metadata:
                        width: 2108
                        height: 1015
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_gzu16lymnbzh
                      folder_id: null
                meta:
                  current_page: 1
                  last_page: 5
                  per_page: 15
                  total: 73
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
  '/api/v1/websites/folders/{folder}/move':
    post:
      summary: 'Move folder'
      operationId: postApiV1WebsitesFoldersByFolderMove
      description: 'Moves a folder under parent_id (null or omitted: namespace root) at the 1-based position among the new siblings. A position past the last sibling moves the folder last. Both sibling groups are renumbered. Serving paths and URLs remain stable.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
      responses:
        204:
          description: 'Folder moved.'
          content:
            application/json:
              schema:
                type:
                  - object
                  - 'null'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveFileFolderRequest'
    parameters:
      -
        in: path
        name: folder
        description: 'The folder.'
        required: true
        schema:
          type: string
          examples:
            - aspernatur
  '/api/v1/websites/attachments/{attachment}':
    put:
      summary: 'Move attachment'
      operationId: putApiV1WebsitesAttachmentsByAttachment
      description: 'Changes only the selected attachment folder within its owner and namespace. Null moves it to root.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileAttachmentResponse'
              example:
                success: true
                data:
                  id: fat_gzu16lymnbzh
                  file_id: fi_w7hikcnvqf9k
                  namespace: null
                  folder_id: null
                  file:
                    id: fi_w7hikcnvqf9k
                    file_size: 96355
                    mime_type: image/webp
                    cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                    serve_path: assets/itaque.webp
                    serve_mime_type: null
                    metadata:
                      width: 2108
                      height: 1015
                      is_animated: false
                      has_transparency: false
                    formats:
                      jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                      webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                    private: false
                    expires_at: null
                    namespace: null
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                    attachment_id: fat_gzu16lymnbzh
                    folder_id: null
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Website Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveFileAttachmentRequest'
    parameters:
      -
        in: path
        name: attachment
        description: 'The attachment.'
        required: true
        schema:
          type: string
          examples:
            - aspernatur
  /api/v1/account/files:
    get:
      summary: 'List account files'
      operationId: getApiV1AccountFiles
      description: 'Name matching and sorting use the full serve_path. Each stored file appears once, using the lowest-ID matching attachment. Default order: files.created_at DESC, files.id ASC. The default page size is 20, with a maximum of 100.'
      parameters:
        -
          in: query
          name: page
          description: 'Page number.'
          required: false
          schema:
            type: integer
            description: 'Page number.'
            examples:
              - 1
        -
          in: query
          name: per_page
          description: 'Items per page (max 100).'
          required: false
          schema:
            type: integer
            description: 'Items per page (max 100).'
            examples:
              - 20
            default: 20
            maximum: 100
        -
          in: query
          name: namespace
          description: 'Filter by namespace. Empty selects the default namespace.'
          required: false
          schema:
            type: string
            description: 'Filter by namespace. Empty selects the default namespace.'
            examples:
              - assets
            maxLength: 100
        -
          in: query
          name: serve_path
          description: 'Filter by exact serve path.'
          required: false
          schema:
            type: string
            description: 'Filter by exact serve path.'
            examples:
              - notes/plan.md
        -
          in: query
          name: 'filter[name]'
          description: 'Literal, case-insensitive substring of the full serve_path. Blank values are ignored. Maximum 500 characters before trimming.'
          required: false
          schema:
            type: string
            description: 'Literal, case-insensitive substring of the full serve_path. Blank values are ignored. Maximum 500 characters before trimming.'
            examples:
              - banner
            maxLength: 500
        -
          in: query
          name: 'filter[id][]'
          description: 'File IDs combined with OR, up to 100. Missing or inaccessible files are omitted. Other filters combine with AND.'
          required: false
          schema:
            type: array
            description: 'File IDs combined with OR, up to 100. Missing or inaccessible files are omitted. Other filters combine with AND.'
            items:
              type: string
              pattern: '^fi_[0-9a-f]{32}$'
            examples:
              -
                - fi_0123456789abcdef0123456789abcdef
            minItems: 1
            maxItems: 100
          style: form
          explode: true
        -
          in: query
          name: 'filter[mime_type]'
          description: 'Exact MIME type or trailing type/* family. Use this or the array form.'
          required: false
          schema:
            type: string
            description: 'Exact MIME type or trailing type/* family. Use this or the array form.'
            examples:
              - 'image/*'
            maxLength: 100
        -
          in: query
          name: 'filter[mime_type][]'
          description: 'MIME types or families combined with OR. Other filters combine with AND.'
          required: false
          schema:
            type: array
            description: 'MIME types or families combined with OR. Other filters combine with AND.'
            items:
              type: string
              maxLength: 100
            examples:
              -
                - 'image/*'
                - application/pdf
            minItems: 1
          style: form
          explode: true
        -
          in: query
          name: sort
          description: 'Comma-separated name, file_size, or created_at. Prefix a field with - for descending order. Unsupported fields return 422.'
          required: false
          schema:
            type: string
            description: 'Comma-separated name, file_size, or created_at. Prefix a field with - for descending order. Unsupported fields return 422.'
            examples:
              - 'name,-file_size'
            pattern: '^\s*(?:-?(?:name|file_size|created_at)(?:\s*,\s*-?(?:name|file_size|created_at))*)?\s*$'
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilePaginatedResponse'
              example:
                success: true
                data:
                  -
                    id: fi_w7hikcnvqf9k
                    file_size: 96355
                    mime_type: image/webp
                    cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                    serve_path: assets/itaque.webp
                    serve_mime_type: null
                    metadata:
                      width: 2108
                      height: 1015
                      is_animated: false
                      has_transparency: false
                    formats:
                      jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                      webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                    private: false
                    expires_at: null
                    namespace: null
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                    attachment_id: fat_gzu16lymnbzh
                    folder_id: null
                  -
                    id: fi_w7hikcnvqf9k
                    file_size: 96355
                    mime_type: image/webp
                    cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                    serve_path: assets/itaque.webp
                    serve_mime_type: null
                    metadata:
                      width: 2108
                      height: 1015
                      is_animated: false
                      has_transparency: false
                    formats:
                      jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                      webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                    private: false
                    expires_at: null
                    namespace: null
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                    attachment_id: fat_gzu16lymnbzh
                    folder_id: null
                meta:
                  current_page: 1
                  last_page: 5
                  per_page: 15
                  total: 73
                message: 'Files retrieved'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
    post:
      summary: 'Upload account files'
      operationId: postApiV1AccountFiles
      description: 'Uploads files to the account scope.'
      parameters: []
      responses:
        200:
          description: 'All files already existed (no new uploads). Items have `created: false` and `exists: true`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files uploaded'
        201:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files uploaded'
        207:
          description: 'Partial success - some uploads failed. Check individual item `success` and `error` fields.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files uploaded'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ScopedFileUploadRequest'
  /api/v1/account/files/archive:
    get:
      summary: 'Download files as zip'
      operationId: getApiV1AccountFilesArchive
      description: 'Streams the selected files as one uncompressed zip. Each file uses its lowest-ID attachment in the selected namespace. Entry paths are the folder path plus the serving path base name. Repeated paths get a number. Any missing, expired, or out-of-scope file returns 404 for the whole request.'
      parameters:
        -
          in: query
          name: 'ids[]'
          description: '1 to 100 unique file IDs in entry order.'
          required: true
          schema:
            type: array
            description: '1 to 100 unique file IDs in entry order.'
            items:
              type: string
              pattern: '^fi_[0-9a-z]{32}$'
            examples:
              -
                - fi_0123456789abcdef0123456789abcdef
            minItems: 1
            maxItems: 100
            uniqueItems: true
          style: form
          explode: true
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
            maxLength: 100
      responses:
        200:
          description: ''
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
  '/api/v1/account/files/{file}':
    get:
      summary: 'Get account file'
      operationId: getApiV1AccountFilesByFile
      description: 'Fetch file metadata.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
              example:
                success: true
                data:
                  id: fi_w7hikcnvqf9k
                  file_size: 96355
                  mime_type: image/webp
                  cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                  cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                  serve_path: assets/itaque.webp
                  serve_mime_type: null
                  metadata:
                    width: 2108
                    height: 1015
                    is_animated: false
                    has_transparency: false
                  formats:
                    jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                    webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                  private: false
                  expires_at: null
                  namespace: null
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
                  attachment_id: fat_gzu16lymnbzh
                  folder_id: null
                message: 'File retrieved'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
    put:
      summary: 'Update account file'
      operationId: putApiV1AccountFilesByFile
      description: 'Update serve path.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
              example:
                success: true
                data:
                  id: fi_w7hikcnvqf9k
                  file_size: 96355
                  mime_type: image/webp
                  cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                  cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                  serve_path: assets/itaque.webp
                  serve_mime_type: null
                  metadata:
                    width: 2108
                    height: 1015
                    is_animated: false
                    has_transparency: false
                  formats:
                    jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                    webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                  private: false
                  expires_at: null
                  namespace: null
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
                  attachment_id: fat_gzu16lymnbzh
                  folder_id: null
                message: 'File updated'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFileRequest'
    delete:
      summary: 'Delete account file'
      operationId: deleteApiV1AccountFilesByFile
      description: 'Detach or delete a file.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteFileResultResponse'
              example:
                success: true
                data:
                  id: fi_gzu16lymnbzh
                message: 'File deleted successfully'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
    parameters:
      -
        in: path
        name: file
        description: 'Prefixed file ID (fi_...)'
        required: true
        schema:
          type: string
          examples:
            - fi_01jk8mz3x9n7q2w4v6b5
  '/api/v1/account/files/{file}/download':
    get:
      summary: 'Download account file'
      operationId: getApiV1AccountFilesByFileDownload
      description: 'Stream file content.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
    parameters:
      -
        in: path
        name: file
        description: 'Prefixed file ID (fi_...)'
        required: true
        schema:
          type: string
          examples:
            - fi_01jk8mz3x9n7q2w4v6b5
  /api/v1/account/files/download-from:
    post:
      summary: 'Download from URL'
      operationId: postApiV1AccountFilesDownloadFrom
      description: 'Downloads files from URLs and stores them as account files.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files downloaded'
        207:
          description: 'Partial success - some downloads failed.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResultCollectionResponse'
              example:
                success: true
                data:
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                  -
                    filename: aspernatur.png
                    success: true
                    created: true
                    exists: false
                    file:
                      id: fi_7hikcnvqf9kx
                      file_size: 3767452
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/original/image.heic'
                      serve_path: assets/in.webp
                      serve_mime_type: null
                      metadata:
                        width: 1015
                        height: 1880
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_zu16lymnbzhq/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_zu16lymnbzhq
                      folder_id: null
                    error: null
                message: 'Files downloaded'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DownloadFilesFromUrlRequest'
  /api/v1/account/folders:
    get:
      summary: 'List folders'
      operationId: getApiV1AccountFolders
      description: 'Lists direct children by default. include_descendants=true returns all descendants as flat records, excluding the selected parent. Omitted namespace and parent select the default namespace root. Sorts by tree position, creation time, then ID and paginates the complete selection.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
            maxLength: 100
        -
          in: query
          name: parent_id
          description: 'Parent folder ID. Empty selects root.'
          required: false
          schema:
            type: string
            description: 'Parent folder ID. Empty selects root.'
            examples:
              - aspernatur
            maxLength: 35
        -
          in: query
          name: include_descendants
          description: 'Include all descendants. Accepts true, false, 1, or 0. Defaults to false. At root, includes every folder in the selected namespace.'
          required: false
          schema:
            type: boolean
            description: 'Include all descendants. Accepts true, false, 1, or 0. Defaults to false. At root, includes every folder in the selected namespace.'
            examples:
              - false
        -
          in: query
          name: page
          description: 'Page number.'
          required: false
          schema:
            type: integer
            description: 'Page number.'
            examples:
              - 1
        -
          in: query
          name: per_page
          description: 'Page size. Default 20, maximum 100.'
          required: false
          schema:
            type: integer
            description: 'Page size. Default 20, maximum 100.'
            examples:
              - 20
            default: 20
            maximum: 100
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFolderPaginatedResponse'
              example:
                success: true
                data:
                  -
                    id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    name: Photos
                    namespace: null
                    parent_id: null
                    tree_position: 1
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                  -
                    id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    name: Photos
                    namespace: null
                    parent_id: null
                    tree_position: 1
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                meta:
                  current_page: 1
                  last_page: 5
                  per_page: 15
                  total: 73
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
    post:
      summary: 'Create folder'
      operationId: postApiV1AccountFolders
      description: 'Creates a folder in the selected owner and namespace. Parent must share that scope.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFolderResponse'
              example:
                success: true
                data:
                  id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  name: Photos
                  namespace: null
                  parent_id: null
                  tree_position: 1
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFileFolderRequest'
  '/api/v1/account/folders/{folder}':
    get:
      summary: 'Get folder'
      operationId: getApiV1AccountFoldersByFolder
      description: 'Returns one folder in the selected owner and namespace.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFolderResponse'
              example:
                success: true
                data:
                  id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  name: Photos
                  namespace: null
                  parent_id: null
                  tree_position: 1
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
    put:
      summary: 'Update folder'
      operationId: putApiV1AccountFoldersByFolder
      description: 'Renames a folder. Use POST /folders/{folder}/move to change the parent or position.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFolderResponse'
              example:
                success: true
                data:
                  id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  name: Photos
                  namespace: null
                  parent_id: null
                  tree_position: 1
                  created_at: '2026-01-01T00:00:00+00:00'
                  updated_at: '2026-01-01T00:00:00+00:00'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFileFolderRequest'
    delete:
      summary: 'Delete folder tree'
      operationId: deleteApiV1AccountFoldersByFolder
      description: 'Deletes the complete subtree. By default attachments move to namespace root. delete_files=true also removes subtree attachments.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
        -
          in: query
          name: delete_files
          description: 'Optional. Accepts true, false, 1, or 0 once. Defaults to false.'
          required: false
          schema:
            type: boolean
            description: 'Optional. Accepts true, false, 1, or 0 once. Defaults to false.'
            examples:
              - false
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteFileFolderResultResponse'
              example:
                success: true
                data:
                  id: ff_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
    parameters:
      -
        in: path
        name: folder
        description: 'The folder.'
        required: true
        schema:
          type: string
          examples:
            - aspernatur
  /api/v1/account/attachments:
    get:
      summary: 'List attachments'
      operationId: getApiV1AccountAttachments
      description: 'Returns each matching attachment separately. Omitted namespace and folder select the default namespace root. Expired attachments are excluded.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
            maxLength: 100
        -
          in: query
          name: folder_id
          description: 'Folder ID. Empty selects root.'
          required: false
          schema:
            type: string
            description: 'Folder ID. Empty selects root.'
            examples:
              - aspernatur
            maxLength: 35
        -
          in: query
          name: serve_path
          description: 'Exact serving path.'
          required: false
          schema:
            type: string
            description: 'Exact serving path.'
            examples:
              - aspernatur
        -
          in: query
          name: 'filter[name]'
          description: 'Case-insensitive literal substring of the full serving path.'
          required: false
          schema:
            type: string
            description: 'Case-insensitive literal substring of the full serving path.'
            examples:
              - aspernatur
            maxLength: 500
        -
          in: query
          name: 'filter[mime_type]'
          description: 'Stored MIME or type/* family.'
          required: false
          schema:
            type: string
            description: 'Stored MIME or type/* family.'
            examples:
              - aspernatur
            maxLength: 100
        -
          in: query
          name: 'filter[mime_type][]'
          description: 'Stored MIME alternatives.'
          required: false
          schema:
            type: array
            description: 'Stored MIME alternatives.'
            items:
              type: string
              maxLength: 100
            examples:
              -
                - aspernatur
            minItems: 1
          style: form
          explode: true
        -
          in: query
          name: sort
          description: 'Comma-separated name, file_size, or created_at. Prefix with - for descending. Default -created_at, then attachment ID.'
          required: false
          schema:
            type: string
            description: 'Comma-separated name, file_size, or created_at. Prefix with - for descending. Default -created_at, then attachment ID.'
            examples:
              - aspernatur
            pattern: '^\s*(?:-?(?:name|file_size|created_at)(?:\s*,\s*-?(?:name|file_size|created_at))*)?\s*$'
        -
          in: query
          name: page
          description: 'Page number.'
          required: false
          schema:
            type: integer
            description: 'Page number.'
            examples:
              - 1
        -
          in: query
          name: per_page
          description: 'Page size. Default 20, maximum 100.'
          required: false
          schema:
            type: integer
            description: 'Page size. Default 20, maximum 100.'
            examples:
              - 20
            default: 20
            maximum: 100
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileAttachmentPaginatedResponse'
              example:
                success: true
                data:
                  -
                    id: fat_gzu16lymnbzh
                    file_id: fi_w7hikcnvqf9k
                    namespace: null
                    folder_id: null
                    file:
                      id: fi_w7hikcnvqf9k
                      file_size: 96355
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                      serve_path: assets/itaque.webp
                      serve_mime_type: null
                      metadata:
                        width: 2108
                        height: 1015
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_gzu16lymnbzh
                      folder_id: null
                  -
                    id: fat_gzu16lymnbzh
                    file_id: fi_w7hikcnvqf9k
                    namespace: null
                    folder_id: null
                    file:
                      id: fi_w7hikcnvqf9k
                      file_size: 96355
                      mime_type: image/webp
                      cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                      serve_path: assets/itaque.webp
                      serve_mime_type: null
                      metadata:
                        width: 2108
                        height: 1015
                        is_animated: false
                        has_transparency: false
                      formats:
                        jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                        webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                        avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                      private: false
                      expires_at: null
                      namespace: null
                      created_at: '2026-01-01T00:00:00+00:00'
                      updated_at: '2026-01-01T00:00:00+00:00'
                      attachment_id: fat_gzu16lymnbzh
                      folder_id: null
                meta:
                  current_page: 1
                  last_page: 5
                  per_page: 15
                  total: 73
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
  '/api/v1/account/folders/{folder}/move':
    post:
      summary: 'Move folder'
      operationId: postApiV1AccountFoldersByFolderMove
      description: 'Moves a folder under parent_id (null or omitted: namespace root) at the 1-based position among the new siblings. A position past the last sibling moves the folder last. Both sibling groups are renumbered. Serving paths and URLs remain stable.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
      responses:
        204:
          description: 'Folder moved.'
          content:
            application/json:
              schema:
                type:
                  - object
                  - 'null'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveFileFolderRequest'
    parameters:
      -
        in: path
        name: folder
        description: 'The folder.'
        required: true
        schema:
          type: string
          examples:
            - aspernatur
  '/api/v1/account/attachments/{attachment}':
    put:
      summary: 'Move attachment'
      operationId: putApiV1AccountAttachmentsByAttachment
      description: 'Changes only the selected attachment folder within its owner and namespace. Null moves it to root.'
      parameters:
        -
          in: query
          name: namespace
          description: 'Exact namespace. Empty selects the default.'
          required: false
          schema:
            type: string
            description: 'Exact namespace. Empty selects the default.'
            examples:
              - aspernatur
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileAttachmentResponse'
              example:
                success: true
                data:
                  id: fat_gzu16lymnbzh
                  file_id: fi_w7hikcnvqf9k
                  namespace: null
                  folder_id: null
                  file:
                    id: fi_w7hikcnvqf9k
                    file_size: 96355
                    mime_type: image/webp
                    cdn_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                    cdn_original_path: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/original/image.heic'
                    serve_path: assets/itaque.webp
                    serve_mime_type: null
                    metadata:
                      width: 2108
                      height: 1015
                      is_animated: false
                      has_transparency: false
                    formats:
                      jpg: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.jpg'
                      webp: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.webp'
                      avif: 'https://cdn.example.com/serve/fat_gzu16lymnbzh/assets/image.avif'
                    private: false
                    expires_at: null
                    namespace: null
                    created_at: '2026-01-01T00:00:00+00:00'
                    updated_at: '2026-01-01T00:00:00+00:00'
                    attachment_id: fat_gzu16lymnbzh
                    folder_id: null
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        422:
          $ref: '#/components/responses/ValidationFailed'
        500:
          $ref: '#/components/responses/InternalServerError'
      tags:
        - 'Account Files'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveFileAttachmentRequest'
    parameters:
      -
        in: path
        name: attachment
        description: 'The attachment.'
        required: true
        schema:
          type: string
          examples:
            - aspernatur
  '/so/{fileAttachable}/{path}':
    get:
      summary: 'Serve file'
      operationId: getSoByFileAttachableByPath
      description: "Serves files with optional on-demand image processing via Glide.\n\n**Format conversion**: Change the file extension to convert images (e.g., `.webp`, `.avif`, `.jpg`, `.png`).\n\n**Image manipulation**: Add query parameters to resize, crop, adjust colors, and apply effects to processable images (JPEG, PNG, GIF, WebP, BMP, TIFF, HEIC/HEIF).\n\n**Original files**: Use `/so/{fileAttachable}/{path}` to serve the pre-conversion original file without any processing.\n\nStatic SVG, raster images, fonts, and media remain usable as assets. Ordinary active documents, JavaScript/CSS, and PDFs download. Only qualified code from configured component publishers remains executable. Qualification requires the selected component attachment, an enabled extension, a matching content-versioned path, and a compatible MIME. Every file response includes a restrictive document security policy."
      parameters:
        -
          in: query
          name: w
          description: 'Width in pixels.'
          required: false
          schema:
            type: integer
            description: 'Width in pixels.'
            examples:
              - 800
        -
          in: query
          name: h
          description: 'Height in pixels.'
          required: false
          schema:
            type: integer
            description: 'Height in pixels.'
            examples:
              - 600
        -
          in: query
          name: fit
          description: 'Fit mode: contain, max, fill, stretch, crop.'
          required: false
          schema:
            type: string
            description: 'Fit mode: contain, max, fill, stretch, crop.'
            examples:
              - contain
        -
          in: query
          name: crop
          description: 'Crop position: top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right, or custom coordinates.'
          required: false
          schema:
            type: string
            description: 'Crop position: top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right, or custom coordinates.'
            examples:
              - center
        -
          in: query
          name: dpr
          description: 'Device pixel ratio (1-8).'
          required: false
          schema:
            type: integer
            description: 'Device pixel ratio (1-8).'
            examples:
              - 2
        -
          in: query
          name: q
          description: 'Quality (1-100). Only applies to lossy formats.'
          required: false
          schema:
            type: integer
            description: 'Quality (1-100). Only applies to lossy formats.'
            examples:
              - 85
        -
          in: query
          name: or
          description: 'Orientation: auto, 0, 90, 180, 270.'
          required: false
          schema:
            type: string
            description: 'Orientation: auto, 0, 90, 180, 270.'
            examples:
              - auto
        -
          in: query
          name: flip
          description: 'Flip: v (vertical), h (horizontal), both.'
          required: false
          schema:
            type: string
            description: 'Flip: v (vertical), h (horizontal), both.'
            examples:
              - h
        -
          in: query
          name: bri
          description: 'Brightness adjustment (-100 to 100).'
          required: false
          schema:
            type: integer
            description: 'Brightness adjustment (-100 to 100).'
            examples:
              - 10
        -
          in: query
          name: con
          description: 'Contrast adjustment (-100 to 100).'
          required: false
          schema:
            type: integer
            description: 'Contrast adjustment (-100 to 100).'
            examples:
              - 10
        -
          in: query
          name: gam
          description: 'Gamma correction (0.1 to 9.99).'
          required: false
          schema:
            type: number
            description: 'Gamma correction (0.1 to 9.99).'
            examples:
              - 1.2
        -
          in: query
          name: sharp
          description: 'Sharpen amount (0-100).'
          required: false
          schema:
            type: integer
            description: 'Sharpen amount (0-100).'
            examples:
              - 15
        -
          in: query
          name: blur
          description: 'Blur amount (0-100).'
          required: false
          schema:
            type: integer
            description: 'Blur amount (0-100).'
            examples:
              - 5
        -
          in: query
          name: pixel
          description: 'Pixelate amount (0-1000).'
          required: false
          schema:
            type: integer
            description: 'Pixelate amount (0-1000).'
            examples:
              - 10
        -
          in: query
          name: filt
          description: 'Filter: greyscale, sepia.'
          required: false
          schema:
            type: string
            description: 'Filter: greyscale, sepia.'
            examples:
              - greyscale
        -
          in: query
          name: bg
          description: 'Background color (hex). Used when fit creates padding.'
          required: false
          schema:
            type: string
            description: 'Background color (hex). Used when fit creates padding.'
            examples:
              - ffffff
        -
          in: query
          name: border
          description: 'Border: width,color,method (e.g., "5,ffffff,overlay").'
          required: false
          schema:
            type: string
            description: 'Border: width,color,method (e.g., "5,ffffff,overlay").'
            examples:
              - '5,000000,overlay'
        -
          in: query
          name: p
          description: 'Preset name (as configured in server).'
          required: false
          schema:
            type: string
            description: 'Preset name (as configured in server).'
            examples:
              - aspernatur
        -
          in: query
          name: s
          description: 'Signature for signed URLs (when signature validation is enabled).'
          required: false
          schema:
            type: string
            description: 'Signature for signed URLs (when signature validation is enabled).'
            examples:
              - aspernatur
      responses:
        200:
          description: 'Image served successfully.'
          content:
            text/plain:
              schema:
                type: string
                examples:
                  - '<<binary image data>>'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
        503:
          description: 'File storage unavailable.'
          content:
            application/json:
              schema:
                type:
                  - object
                  - 'null'
      tags:
        - 'File Serving'
    parameters:
      -
        in: path
        name: fileAttachable
        description: 'Prefixed file-attachable ID (fat_...).'
        required: true
        schema:
          type: string
          examples:
            - fat_abc123xyz
      -
        in: path
        name: path
        description: 'Serve path of the file. Change extension for format conversion.'
        required: true
        schema:
          type: string
          examples:
            - assets/logo.webp
  '/s/{fileAttachable}/{path}':
    get:
      summary: 'Serve file'
      operationId: getSByFileAttachableByPath
      description: "Serves files with optional on-demand image processing via Glide.\n\n**Format conversion**: Change the file extension to convert images (e.g., `.webp`, `.avif`, `.jpg`, `.png`).\n\n**Image manipulation**: Add query parameters to resize, crop, adjust colors, and apply effects to processable images (JPEG, PNG, GIF, WebP, BMP, TIFF, HEIC/HEIF).\n\n**Original files**: Use `/so/{fileAttachable}/{path}` to serve the pre-conversion original file without any processing.\n\nStatic SVG, raster images, fonts, and media remain usable as assets. Ordinary active documents, JavaScript/CSS, and PDFs download. Only qualified code from configured component publishers remains executable. Qualification requires the selected component attachment, an enabled extension, a matching content-versioned path, and a compatible MIME. Every file response includes a restrictive document security policy."
      parameters:
        -
          in: query
          name: w
          description: 'Width in pixels.'
          required: false
          schema:
            type: integer
            description: 'Width in pixels.'
            examples:
              - 800
        -
          in: query
          name: h
          description: 'Height in pixels.'
          required: false
          schema:
            type: integer
            description: 'Height in pixels.'
            examples:
              - 600
        -
          in: query
          name: fit
          description: 'Fit mode: contain, max, fill, stretch, crop.'
          required: false
          schema:
            type: string
            description: 'Fit mode: contain, max, fill, stretch, crop.'
            examples:
              - contain
        -
          in: query
          name: crop
          description: 'Crop position: top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right, or custom coordinates.'
          required: false
          schema:
            type: string
            description: 'Crop position: top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right, or custom coordinates.'
            examples:
              - center
        -
          in: query
          name: dpr
          description: 'Device pixel ratio (1-8).'
          required: false
          schema:
            type: integer
            description: 'Device pixel ratio (1-8).'
            examples:
              - 2
        -
          in: query
          name: q
          description: 'Quality (1-100). Only applies to lossy formats.'
          required: false
          schema:
            type: integer
            description: 'Quality (1-100). Only applies to lossy formats.'
            examples:
              - 85
        -
          in: query
          name: or
          description: 'Orientation: auto, 0, 90, 180, 270.'
          required: false
          schema:
            type: string
            description: 'Orientation: auto, 0, 90, 180, 270.'
            examples:
              - auto
        -
          in: query
          name: flip
          description: 'Flip: v (vertical), h (horizontal), both.'
          required: false
          schema:
            type: string
            description: 'Flip: v (vertical), h (horizontal), both.'
            examples:
              - h
        -
          in: query
          name: bri
          description: 'Brightness adjustment (-100 to 100).'
          required: false
          schema:
            type: integer
            description: 'Brightness adjustment (-100 to 100).'
            examples:
              - 10
        -
          in: query
          name: con
          description: 'Contrast adjustment (-100 to 100).'
          required: false
          schema:
            type: integer
            description: 'Contrast adjustment (-100 to 100).'
            examples:
              - 10
        -
          in: query
          name: gam
          description: 'Gamma correction (0.1 to 9.99).'
          required: false
          schema:
            type: number
            description: 'Gamma correction (0.1 to 9.99).'
            examples:
              - 1.2
        -
          in: query
          name: sharp
          description: 'Sharpen amount (0-100).'
          required: false
          schema:
            type: integer
            description: 'Sharpen amount (0-100).'
            examples:
              - 15
        -
          in: query
          name: blur
          description: 'Blur amount (0-100).'
          required: false
          schema:
            type: integer
            description: 'Blur amount (0-100).'
            examples:
              - 5
        -
          in: query
          name: pixel
          description: 'Pixelate amount (0-1000).'
          required: false
          schema:
            type: integer
            description: 'Pixelate amount (0-1000).'
            examples:
              - 10
        -
          in: query
          name: filt
          description: 'Filter: greyscale, sepia.'
          required: false
          schema:
            type: string
            description: 'Filter: greyscale, sepia.'
            examples:
              - greyscale
        -
          in: query
          name: bg
          description: 'Background color (hex). Used when fit creates padding.'
          required: false
          schema:
            type: string
            description: 'Background color (hex). Used when fit creates padding.'
            examples:
              - ffffff
        -
          in: query
          name: border
          description: 'Border: width,color,method (e.g., "5,ffffff,overlay").'
          required: false
          schema:
            type: string
            description: 'Border: width,color,method (e.g., "5,ffffff,overlay").'
            examples:
              - '5,000000,overlay'
        -
          in: query
          name: p
          description: 'Preset name (as configured in server).'
          required: false
          schema:
            type: string
            description: 'Preset name (as configured in server).'
            examples:
              - aspernatur
        -
          in: query
          name: s
          description: 'Signature for signed URLs (when signature validation is enabled).'
          required: false
          schema:
            type: string
            description: 'Signature for signed URLs (when signature validation is enabled).'
            examples:
              - aspernatur
      responses:
        200:
          description: 'Image served successfully.'
          content:
            text/plain:
              schema:
                type: string
                examples:
                  - '<<binary image data>>'
        401:
          $ref: '#/components/responses/Unauthenticated'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        500:
          $ref: '#/components/responses/InternalServerError'
        503:
          description: 'File storage unavailable.'
          content:
            application/json:
              schema:
                type:
                  - object
                  - 'null'
      tags:
        - 'File Serving'
    parameters:
      -
        in: path
        name: fileAttachable
        description: 'Prefixed file-attachable ID (fat_...).'
        required: true
        schema:
          type: string
          examples:
            - fat_abc123xyz
      -
        in: path
        name: path
        description: 'Serve path of the file. Change extension for format conversion.'
        required: true
        schema:
          type: string
          examples:
            - assets/logo.webp
