Skip to content
OvertCMS Docs

Admin API (Dashboard & Team) Media

Create a presigned upload intent for large media

POST /admin-api/v1/sites/{siteSlug}/media/upload-intent

Creates a pending_upload asset and returns a presigned PUT target (S3 SigV4 URL or HMAC-signed /admin-api/v1/sites/{siteSlug}/media/{id}/upload?token=...). Requires media:upload capability.

Authentication

  • overtcms_access cookie SessionCookie

    HttpOnly SameSite=Lax access token cookie issued by login/setup/refresh. State-changing requests (POST, PATCH, PUT, DELETE) authenticated via cookie must also send a matching same-origin Origin header for CSRF protection.

  • Bearer token BearerJWT

    Human Admin access JWT returned by login/setup/refresh/step-up. Agent API keys (ocms_...) are rejected on the Admin Plane.

Path parameters

  • siteSlug string required
    Site slug.

Headers

  • Origin string
    Same-origin header required by CSRF protection on state-changing requests authenticated via overtcms_access cookie.
  • Idempotency-Key string
    Optional unique key (max 128 chars) for atomic mutation deduplication.

Request body application/json required

  • alt string
  • byteSize integer, int64 required

    min 1, Example 52428800

  • caption string
  • contentType string required

    Example video/mp4

  • credit string
  • expiresAt string, date-time
  • filename string required

    Example product-demo.mp4

  • focalPoint FocalPoint
    Normalized [0, 1] focal coordinates for smart image cropping.
    Show 2 fields
    • x number required

      min 0, max 1, Example 0.5

    • y number required

      min 0, max 1, Example 0.35

  • isEphemeral boolean

    Default false

  • title string

Responses

  • 201 Upload intent created.

    application/json

    • asset MediaAsset required
      Stored media asset with magic-byte-verified MIME type, dimensions, and editorial metadata.
      Show 24 fields
      • byteSize integer, int64 required

        Example 184320

      • createdAt string, date-time required
      • createdBy Actor required
        Identifies the human user, API key, MCP client, or system process that initiated an action.
        Show 3 fields
        • id string required

          Example 0195c0a1-7e20-7000-8000-000000000042

        • kind string required

          Allowed: userapi_keymcpsystem

          Example api_key

        • name string required

          Example Content Automation Bot

      • credit string
      • defaultAlt string

        Example Architectural diagram of OvertCMS three planes

      • defaultCaption string
      • defaultTitle string
      • durationMs integer, int64
      • expiresAt string, date-time nullable
      • extension string required

        Example .webp

      • filename string required

        Example hero-banner.webp

      • focalPoint FocalPoint
        Normalized [0, 1] focal coordinates for smart image cropping.
        Show 2 fields
        • x number required

          min 0, max 1, Example 0.5

        • y number required

          min 0, max 1, Example 0.35

      • height integer

        Example 900

      • id string, uuid required
      • isEphemeral boolean required

        Example false

      • kind string required

        Allowed: imageaudiovideodocument

        Example image

      • mimeType string required

        Example image/webp

      • sha256 string

        Example e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

      • siteId string, uuid required
      • status string required

        Allowed: pending_uploadprocessingreadyfailed

        Example ready

      • storageKey string required
      • updatedAt string, date-time required
      • url string required

        Example /delivery/v1/media/0195c0a1-7e20-7000-8000-000000000077

      • width integer

        Example 1600

    • upload PresignedUpload required
      Show 4 fields
      • expiresAt string, date-time required
      • headers map of string
      • method string required

        Allowed: PUT

        Example PUT

      • url string required

        Example /agent/v1/media/0195c0a1-7e20-7000-8000-000000000077/upload?token=eyJ...

  • 401 Unauthenticated — missing or expired session cookie / JWT (API keys are rejected).

    application/json

    • error APIError required
      Canonical error payload returned across all OvertCMS planes.
      Show 6 fields
      • applied boolean required
        Always false on 4xx responses, guaranteeing the mutation was not applied.

        Example false

      • code string required

        Example validation_error

      • details object
      • issues array of ValidationIssue
        Show 7 fields
        • code string required

          Example max_length

        • constraint object
        • field string

          Example seoTitle

        • instruction string

          Example Keep SEO titles under 60 characters for search snippet display.

        • label string

          Example SEO Title

        • message string required

          Example field must be at most 60 graphemes

        • searchEndpoint string

          Example /agent/v1/collections/posts/fields/author/options

      • message string required

        Example entry validation failed

      • retryable boolean required

        Example false

  • 403 Forbidden — insufficient RBAC role capability, CSRF Origin mismatch, post-type restriction, or step-up MFA required.

    application/json

    • error APIError required
      Canonical error payload returned across all OvertCMS planes.
      Show 6 fields
      • applied boolean required
        Always false on 4xx responses, guaranteeing the mutation was not applied.

        Example false

      • code string required

        Example validation_error

      • details object
      • issues array of ValidationIssue
        Show 7 fields
        • code string required

          Example max_length

        • constraint object
        • field string

          Example seoTitle

        • instruction string

          Example Keep SEO titles under 60 characters for search snippet display.

        • label string

          Example SEO Title

        • message string required

          Example field must be at most 60 graphemes

        • searchEndpoint string

          Example /agent/v1/collections/posts/fields/author/options

      • message string required

        Example entry validation failed

      • retryable boolean required

        Example false

  • 409 Conflict — optimistic lock mismatch, uniqueness conflict, breaking change confirmation required, or strong references.

    application/json

    • error APIError required
      Canonical error payload returned across all OvertCMS planes.
      Show 6 fields
      • applied boolean required
        Always false on 4xx responses, guaranteeing the mutation was not applied.

        Example false

      • code string required

        Example validation_error

      • details object
      • issues array of ValidationIssue
        Show 7 fields
        • code string required

          Example max_length

        • constraint object
        • field string

          Example seoTitle

        • instruction string

          Example Keep SEO titles under 60 characters for search snippet display.

        • label string

          Example SEO Title

        • message string required

          Example field must be at most 60 graphemes

        • searchEndpoint string

          Example /agent/v1/collections/posts/fields/author/options

      • message string required

        Example entry validation failed

      • retryable boolean required

        Example false

  • 422 Validation error with field-level issues.

    application/json

    • error APIError required
      Canonical error payload returned across all OvertCMS planes.
      Show 6 fields
      • applied boolean required
        Always false on 4xx responses, guaranteeing the mutation was not applied.

        Example false

      • code string required

        Example validation_error

      • details object
      • issues array of ValidationIssue
        Show 7 fields
        • code string required

          Example max_length

        • constraint object
        • field string

          Example seoTitle

        • instruction string

          Example Keep SEO titles under 60 characters for search snippet display.

        • label string

          Example SEO Title

        • message string required

          Example field must be at most 60 graphemes

        • searchEndpoint string

          Example /agent/v1/collections/posts/fields/author/options

      • message string required

        Example entry validation failed

      • retryable boolean required

        Example false

Documentation

Start here