Skip to content
OvertCMS Docs

Agent API (AI & Automation) Entries & Batch

Search valid target entries for a reference field

GET /agent/v1/collections/{postType}/fields/{fieldKey}/options

Searches accent/case-folded reference targets allowed by a reference field, filtered by the API key's allowedPostTypes. Includes suggestedOptions rescue suggestions when a query has 0 matches and totalEligible <= 50. Requires entries:read 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
    Source post type slug.
  • fieldKey string required
    Reference field key.

Query parameters

  • q string
    Search query matching display label or slug.
  • target string
    Restrict to a specific target post type slug (for polymorphic references).
  • limit integer
    Page size limit.

    min 1, max 100

  • cursor string
    Opaque reference pagination cursor.

Headers

  • 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.

Responses

  • 200 Matching reference options.

    application/json

    • field string required

      Example author

    • hasMore boolean required

      Example false

    • items array of ReferenceOption required
      Show 5 fields
      • displayLabel string required

        Example Ada Lovelace

      • id string, uuid required
      • postType string required

        Example authors

      • slug string required

        Example ada-lovelace

      • status string required

        Allowed: draftscheduledpublishedarchivedtrashed

        Example published

    • nextCursor string
    • suggestedOptions array of ReferenceOption
      Populated as empty-search rescue suggestions when a query returns 0 matches and totalEligible <= 50.
      Show 5 fields
      • displayLabel string required

        Example Ada Lovelace

      • id string, uuid required
      • postType string required

        Example authors

      • slug string required

        Example ada-lovelace

      • status string required

        Allowed: draftscheduledpublishedarchivedtrashed

        Example published

    • targets array of string required
    • totalEligible integer, int64 required

      Example 12

  • 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 Post type or reference field 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

  • 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

Documentation

Start here