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

# List media assets

> Retrieve media assets for the authenticated workspace.



## OpenAPI

````yaml https://api.marblecms.com/openapi.json get /v1/media
openapi: 3.1.0
info:
  title: Marble API
  version: 1.0.0
  description: A headless CMS API for managing and delivering content programmatically.
servers:
  - url: https://api.marblecms.com
    description: Production
security:
  - apiKey: []
paths:
  /v1/media:
    get:
      tags:
        - Media
      summary: List media assets
      description: Retrieve media assets for the authenticated workspace.
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
            example: '10'
            description: Number of items per page (1-100)
          required: false
          description: Number of items per page (1-100)
          name: limit
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            default: 1
            example: '1'
            description: Page number
          required: false
          description: Page number
          name: page
          in: query
        - schema:
            type: string
            example: hero
            description: Search media by name, alt text, URL, or MIME type
          required: false
          description: Search media by name, alt text, URL, or MIME type
          name: query
          in: query
        - schema:
            allOf:
              - $ref: '#/components/schemas/MediaType'
              - example: image
                description: Filter by inferred media type
          required: false
          description: Filter by inferred media type
          name: type
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
            example: desc
            description: Sort order by creation date
          required: false
          description: Sort order by creation date
          name: order
          in: query
      responses:
        '200':
          description: Media assets retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaListResponse'
        '400':
          description: Invalid query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Page number does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageNotFound'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
components:
  schemas:
    MediaType:
      type: string
      enum:
        - image
        - video
        - audio
        - document
    MediaListResponse:
      type: object
      properties:
        media:
          type: array
          items:
            $ref: '#/components/schemas/Media'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - media
        - pagination
    Error:
      type: object
      properties:
        error:
          type: string
          example: Invalid query parameters
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: limit
              message:
                type: string
                example: Expected number, received string
            required:
              - field
              - message
        message:
          type: string
          example: Validation failed
      required:
        - error
    PageNotFound:
      type: object
      properties:
        error:
          type: string
          enum:
            - Invalid page number
        details:
          type: object
          properties:
            message:
              type: string
              example: Page 10 does not exist.
            totalPages:
              type: integer
              example: 5
            requestedPage:
              type: integer
              example: 10
          required:
            - message
            - totalPages
            - requestedPage
      required:
        - error
        - details
    ServerError:
      type: object
      properties:
        error:
          type: string
          example: Internal server error
        message:
          type: string
          example: Failed to fetch resource
      required:
        - error
    Media:
      type: object
      properties:
        id:
          type: string
          example: cryitfjp1234jl04vdnycek8
        name:
          type: string
          example: Hero image
        url:
          type: string
          format: uri
          example: https://cdn.marblecms.com/media/hero.jpg
        alt:
          type: string
          nullable: true
          example: A dashboard screenshot
        size:
          type: integer
          example: 382019
          description: File size in bytes
        mimeType:
          type: string
          nullable: true
          example: image/jpeg
        width:
          type: integer
          nullable: true
          example: 1600
        height:
          type: integer
          nullable: true
          example: 900
        duration:
          type: integer
          nullable: true
          example: 12000
          description: Duration in milliseconds
        blurHash:
          type: string
          nullable: true
          example: LEHV6nWB2yk8pyo0adR*.7kCMdnj
        type:
          $ref: '#/components/schemas/MediaType'
        createdAt:
          type: string
          format: date-time
          example: '2024-01-15T10:00:00Z'
        updatedAt:
          type: string
          format: date-time
          example: '2024-01-16T12:00:00Z'
      required:
        - id
        - name
        - url
        - alt
        - size
        - mimeType
        - width
        - height
        - duration
        - blurHash
        - type
        - createdAt
        - updatedAt
    Pagination:
      type: object
      properties:
        limit:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 10
        currentPage:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 1
        nextPage:
          type: integer
          nullable: true
          example: 2
        previousPage:
          type: integer
          nullable: true
          example: null
        totalPages:
          type: integer
          example: 5
        totalItems:
          type: integer
          example: 42
      required:
        - limit
        - currentPage
        - nextPage
        - previousPage
        - totalPages
        - totalItems
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: Your Marble API key

````