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

# List CDN files

> Lists CDN files for the authenticated user. Supports cursor-based pagination (100 items per page), optional filtering to a single folder, and optional search filtering by filename. `folder` and `search` can be combined. Large uploads that are not finished yet are included with `status` set to `pending`.




## OpenAPI

````yaml /cdn/openapi.json get /cdn/files
openapi: 3.0.3
info:
  title: Shard Cloud CDN API
  version: 1.0.0
servers:
  - url: https://shardcloud.app/api
security:
  - BearerAuth: []
paths:
  /cdn/files:
    get:
      tags:
        - CDN
      summary: List CDN files
      description: >
        Lists CDN files for the authenticated user. Supports cursor-based
        pagination (100 items per page), optional filtering to a single folder,
        and optional search filtering by filename. `folder` and `search` can be
        combined. Large uploads that are not finished yet are included with
        `status` set to `pending`.
      operationId: listFiles
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: UUID cursor from a previous response to fetch the next page
        - name: folder
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 64
          description: >-
            Only list files inside this folder (exact folder name, same
            character rules as filenames: letters, numbers, underscores, and
            hyphens). Files in other folders, and files without a folder, are
            not returned.
        - name: search
          in: query
          required: false
          schema:
            type: string
            maxLength: 60
          description: Search filter by filename (max 60 chars, validated format)
      responses:
        '200':
          description: Paginated list of CDN files
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCDNFileResponse'
        '400':
          description: Invalid cursor, folder, or search parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
components:
  schemas:
    PaginatedCDNFileResponse:
      type: object
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/CDNFile'
        cursor:
          type: string
          description: >
            UUID of the last file in the current page. Pass as the `cursor`
            query parameter to fetch the next page. Empty string when there are
            no more results.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
    CDNFile:
      type: object
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        filename:
          type: string
          example: images/logo.png
        size:
          type: integer
          format: int64
          description: File size in KB
        mime_type:
          type: string
          example: image/png
        created_at:
          type: string
          format: date-time
        expire_at:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - pending
            - ready
          description: >-
            `pending` while a large file upload has not been finalized (no `url`
            yet), `ready` otherwise
        url:
          type: string
          description: Full CDN URL to access the file
          example: https://cdn.example.com/{user_id}/{filename}
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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