Skip to content
OvertCMS Docs

Agent API (AI & Automation) Entries & Batch

Publish an entry

POST /agent/v1/collections/{postType}/entries/{id}/publish

Validates draftData in publish mode, promotes it to publishedData, invalidates CDN surrogate keys, and emits entry.published. Requires entries:publish scope.

Authentication

  • Bearer token BearerApiKey

    Scoped Agent API key (Authorization: Bearer ocms_...). Human JWTs and browser cookies are rejected on the Agent Plane.

Path parameters

  • postType string required
    Post type slug.
  • id string required
    Entry UUID.

Headers

  • If-Match string
    Optimistic locking ETag precondition (alternative to expectedVersion / expectedEtag in body).
  • If-Schema-Fingerprint string
    Optional precondition header with the caller's cached schema fingerprint. Exact match proceeds silently; non-breaking capability gain proceeds with X-Schema-Warning; breaking drift returns 409 schema_drift_detected.
  • Idempotency-Key string
    Unique client-generated key (max 128 chars) for atomic mutation deduplication and safe retries (24h receipt retention, scoped per actor).

Request body application/json

  • commitMessage string

    Example Publish article

  • expectedEtag string
  • expectedVersion integer

    min 1, Example 2

  • unpublishAt string, date-time

Responses

  • 200 Entry published.

    application/json

    • entry Entry required
      Content entry with dual draft/published snapshots and optimistic locking metadata.
      Show 25 fields
      • 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

      • displayLabel string required

        Example Introducing OvertCMS

      • draftData object required
      • etag string required

        Example sha256:9f86d081884c7d659a2feaa0c55ad015

      • id string, uuid required

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

      • labelKey string required

        Example introducing overtcms

      • locale string required

        Example en

      • postTypeId string, uuid required
      • postTypeSlug string required

        Example posts

      • publicUrl string required

        Example https://example.com/blog/introducing-overtcms

      • publishedAt string, date-time nullable
      • publishedData object
      • scheduledAt string, date-time nullable
      • schemaVersionAtWrite integer required

        Example 2

      • searchKey string required

        Example introducing overtcms

      • siteId string, uuid required
      • slug string required

        Example introducing-overtcms

      • status string required

        Allowed: draftscheduledpublishedarchivedtrashed

        Example draft

      • translationGroupId string
      • trashedAt string, date-time nullable
      • unpublishAt string, date-time nullable
      • updatedAt string, date-time required
      • updatedBy 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

      • version integer required

        min 1, Example 3

  • 401 Missing, invalid, expired, or revoked Agent API key (cookies and human JWTs 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 API key lacks required scope, post-type access, or IP allowlist match.

    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

  • 404 Entry not found.

    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 Version conflict, schema drift detected, idempotency key conflict, or breaking change confirmation 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

  • 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

  • 429 Per-key RPM rate limit, daily write cap, or daily media byte quota exceeded.

    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

  • 503 Agent writes are currently paused by site kill switch.

    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