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

# Preview an unsaved lifecycle on a bounded sample

> Evaluates an unsaved definition on a sample of entries and returns each entry's readiness. Nothing is saved, and every count describes the sample only. 503: evaluation is temporarily unavailable; retry.



## OpenAPI

````yaml /api-reference/openapi/configuration.json post /v1/card-definitions/{cardId}/lifecycles/preview
openapi: 3.2.0
info:
  title: Configuration API
  description: >-
    Manages applications, sources, source properties, source folders, managed
    tags and their values, card definitions, their segments and relation
    definitions; manages destinations, their versions and endpoints, and
    publishes versions; and authors, previews and activates card lifecycles.
    Card property changes are saved as pending changes and take effect when the
    card definition is activated. Source property changes and source deletion
    can finish asynchronously. The tenant comes from the access token.
    Successful responses return the resource itself; lists return a page with
    `items`, the `after` cursor for the next page and, when asked for,
    `totalCount` (`limit` default 50, max 200; lifecycle lists default 25, max
    100). Application updates replace the settings and need the latest `etag`;
    secrets are returned only when created. Errors are problem details
    (`application/problem+json`). Values are PascalCase in REST and UPPER_CASE
    in GraphQL.
  version: 1.0.0
servers:
  - url: https://api.occtoo.com
security: []
tags:
  - name: Applications
  - name: Card definitions
  - name: Card exports
  - name: Destination endpoints
  - name: Destination versions
  - name: Destinations
  - name: Languages
  - name: Lifecycles
  - name: Managed tag values
  - name: Managed tags
  - name: Relation definitions
  - name: Segments
  - name: Sources
paths:
  /v1/card-definitions/{cardId}/lifecycles/preview:
    post:
      tags:
        - Lifecycles
      summary: Preview an unsaved lifecycle on a bounded sample
      description: >-
        Evaluates an unsaved definition on a sample of entries and returns each
        entry's readiness. Nothing is saved, and every count describes the
        sample only. 503: evaluation is temporarily unavailable; retry.
      operationId: PreviewLifecycle
      parameters:
        - name: cardId
          in: path
          description: Raw id of the card definition (e.g. `products`).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreviewLifecycleRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LifecyclePreview'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/HttpValidationProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying.
              schema:
                minimum: 1
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '503':
          description: Service Unavailable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - kindeOAuth: []
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    PreviewLifecycleRequest:
      required:
        - definition
      type: object
      properties:
        definition:
          $ref: '#/components/schemas/LifecycleDefinitionDraft'
          description: Definition to preview. Nothing is saved.
        sampleSize:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: Number of entries to sample, 1 to 100. Default 25.
          format: int32
          default: 25
      description: Holds an unsaved definition to preview.
    LifecyclePreview:
      required:
        - samplingMethod
        - requestedSampleSize
        - actualSampleSize
        - evaluatedAt
        - definition
        - sampleDistribution
        - entries
      type: object
      properties:
        samplingMethod:
          $ref: '#/components/schemas/LifecycleSamplingMethod'
          description: >-
            How roots were selected before testing applicability. The sample is
            not random.
        requestedSampleSize:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: The requested upper bound on sampled entries.
          format: int32
        actualSampleSize:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: >-
            The number of entries in this sample, including inapplicable
            entries.
          format: int32
        evaluatedAt:
          type: string
          description: When the indexed read began. This is not a source-data timestamp.
          format: date-time
        definition:
          $ref: '#/components/schemas/LifecycleDefinition'
          description: >-
            The unsaved definition. Its step and rule ids belong to this preview
            only; use slugs to match input components.
        sampleDistribution:
          $ref: '#/components/schemas/LifecycleSampleDistribution'
          description: >-
            Readiness counts for this sample only, not for every entry of the
            card definition.
        entries:
          type: array
          items:
            $ref: '#/components/schemas/LifecyclePreviewEntry'
          description: Sampled entries in entry id order, including inapplicable entries.
      description: >-
        Holds an unsaved definition evaluated on a bounded sample of indexed
        entries.
    HttpValidationProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
    LifecycleDefinitionDraft:
      required:
        - name
        - steps
      type: object
      properties:
        name:
          type: string
          description: Display name of the lifecycle, up to 256 characters.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/LifecycleStepDraft'
          description: >-
            Steps in completion order, 1 to 64, with at most 256 rules in all.
            Earlier steps gate later ones.
        briefing:
          type:
            - 'null'
            - string
          description: >-
            Guidance for people completing the lifecycle, up to 16000
            characters.
        applicability:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: >-
                Only matching entries are assessed. Null means every entry of
                the card definition.
          description: >-
            Only matching entries are assessed. Null means every entry of the
            card definition.
      description: >-
        Defines a lifecycle to save or preview: ordered steps of rules, and
        which entries it applies to. Its conditions can't test segment
        membership or lifecycles.
    LifecycleSamplingMethod:
      enum:
        - EntryIdAscending
      description: Sets how a lifecycle preview picks its sample.
      x-enum-descriptions:
        EntryIdAscending: >-
          The first entries by entry id, ascending, before applicability is
          checked.
    LifecycleDefinition:
      required:
        - name
        - steps
        - briefing
        - applicability
      type: object
      properties:
        name:
          type: string
          description: The lifecycle's display name.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/LifecycleStep'
          description: Steps in completion order. Earlier steps gate later ones.
        briefing:
          type:
            - 'null'
            - string
          description: Guidance for people completing this lifecycle.
        applicability:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: >-
                Only matching entries are assessed. Null means every entry of
                the card definition.
          description: >-
            Only matching entries are assessed. Null means every entry of the
            card definition.
      description: Holds the conditions and ordered steps of a lifecycle.
    LifecycleSampleDistribution:
      required:
        - complete
        - incomplete
        - notApplicable
      type: object
      properties:
        complete:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: Sampled entries that completed every step.
          format: int32
        incomplete:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: Applicable sampled entries with an incomplete step.
          format: int32
        notApplicable:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: Sampled entries excluded by lifecycle applicability.
          format: int32
      description: Counts the readiness states of a lifecycle preview's sample.
    LifecyclePreviewEntry:
      required:
        - entryId
        - assessment
      type: object
      properties:
        entryId:
          type: string
          description: Id of the sampled entry.
        assessment:
          $ref: '#/components/schemas/LifecycleEvaluation'
          description: Readiness computed from indexed values under the unsaved definition.
      description: Describes one sampled entry of a lifecycle preview and its readiness.
    LifecycleStepDraft:
      required:
        - slug
        - name
        - rules
      type: object
      properties:
        slug:
          type: string
          description: >-
            Your id for the step, unique among the lifecycle's steps: up to 128
            ASCII letters, digits, `-` or `_`, starting with a letter. The step
            keeps its `id` while its slug stays the same.
        name:
          type: string
          description: Display name of the step, up to 256 characters.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/LifecycleRuleDraft'
          description: >-
            Rules of the step, at least one. Only failed applicable `Error`
            rules block completion.
        briefing:
          type:
            - 'null'
            - string
          description: Guidance for completing the step, up to 16000 characters.
      description: Groups rules at one position in a lifecycle definition.
    SearchPredicate:
      type: object
      properties:
        and:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/SearchPredicate'
          description: Every child condition must match.
        or:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/SearchPredicate'
          description: At least one child condition must match.
        not:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: The child condition must not match.
          description: The child condition must not match.
        text:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TextPredicate'
              description: >-
                A condition on text, including substring, RE2 regex and length
                checks.
          description: >-
            A condition on text, including substring, RE2 regex and length
            checks.
        integer:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/IntegerPredicate'
              description: A condition on an integer property.
          description: A condition on an integer property.
        decimal:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DecimalPredicate'
              description: A condition on a decimal property.
          description: A condition on a decimal property.
        timestamp:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimestampPredicate'
              description: A condition on a timestamp property.
          description: A condition on a timestamp property.
        boolean:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/BooleanPredicate'
              description: A condition on a boolean property.
          description: A condition on a boolean property.
        list:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ListPredicate'
              description: A condition on list elements or length.
          description: A condition on list elements or length.
        hasValue:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PropertyReference'
              description: >-
                True when a value exists. Empty text, whitespace and empty lists
                count as values.
          description: >-
            True when a value exists. Empty text, whitespace and empty lists
            count as values.
        segment:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SegmentPredicate'
              description: Membership in a segment.
          description: Membership in a segment.
        relation:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RelationPredicate'
              description: >-
                Tests distinct live related entries. All nested conditions apply
                to the same child.
          description: >-
            Tests distinct live related entries. All nested conditions apply to
            the same child.
        lifecycle:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecyclePredicate'
              description: Saved readiness of the entry under an active lifecycle.
          description: Saved readiness of the entry under an active lifecycle.
      description: >-
        Holds a typed condition on an entry. Set exactly one branch; `and` and
        `or` need at least one child.
    LifecycleStep:
      required:
        - id
        - slug
        - name
        - rules
        - briefing
      type: object
      properties:
        id:
          $ref: '#/components/schemas/LifecycleComponentId'
          description: Server-generated id of the step (a UUID), kept when the step moves.
        slug:
          $ref: '#/components/schemas/LifecycleSlug'
          description: Your id for the step, unique among this lifecycle's steps.
        name:
          type: string
          description: The step's display name.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/LifecycleRule'
          description: >-
            The step's rules. Only failed applicable error rules block
            completion.
        briefing:
          type:
            - 'null'
            - string
          description: Guidance for completing this step.
      description: Groups rules at one position in a lifecycle.
    LifecycleEvaluation:
      required:
        - applicable
        - firstIncompleteStepId
        - steps
      type: object
      properties:
        applicable:
          type: boolean
          description: Whether the lifecycle applies to this entry.
        firstIncompleteStepId:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleComponentId'
              description: >-
                The first incomplete step, or null when complete or not
                applicable.
          description: The first incomplete step, or null when complete or not applicable.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/LifecycleStepAssessment'
          description: >-
            Step results in definition order. Empty when the lifecycle does not
            apply.
        state:
          $ref: '#/components/schemas/LifecycleReadinessState'
          description: Complete, incomplete, or not applicable.
      description: Describes an entry's readiness under the previewed definition.
    LifecycleRuleDraft:
      required:
        - slug
        - severity
        - message
        - assertion
      type: object
      properties:
        slug:
          type: string
          description: >-
            Your id for the rule, unique among all rules of the lifecycle, in
            the same format as a step slug. The rule keeps its `id` while its
            slug stays the same.
        severity:
          $ref: '#/components/schemas/LifecycleRuleSeverity'
          description: >-
            `Error` blocks completion of the step; `Warning` and `Advisory`
            don't.
        message:
          type: string
          description: Guidance shown with the rule's outcome, up to 4000 characters.
        assertion:
          $ref: '#/components/schemas/SearchPredicate'
          description: Condition an applicable entry must satisfy.
        precondition:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: >-
                Condition that decides whether the rule applies; when it doesn't
                match, the rule is skipped. Null means the rule always applies.
          description: >-
            Condition that decides whether the rule applies; when it doesn't
            match, the rule is skipped. Null means the rule always applies.
      description: Holds a condition and the guidance shown when it fails.
    TextPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          type:
            - 'null'
            - string
          description: Equal to this value.
        neq:
          type:
            - 'null'
            - string
          description: Different from this value.
        in:
          type:
            - 'null'
            - array
          items:
            type: string
          description: Equal to any listed value.
        contains:
          type:
            - 'null'
            - string
          description: A literal substring.
        pattern:
          type:
            - 'null'
            - string
          description: A whole-value wildcard pattern using * and ?.
        ignoreCase:
          type: boolean
          description: Whether matching ignores case.
          default: false
        languages:
          type:
            - 'null'
            - array
          description: Every listed language must match. There is no language fallback.
        regex:
          type:
            - 'null'
            - string
          description: >-
            A substring pattern using the supported RE2 subset, validated
            locally.
        length:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CountBounds'
              description: Bounds on the number of Unicode code points.
          description: Bounds on the number of Unicode code points.
      description: Tests a text card property.
    IntegerPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Equal to this value.
          format: int64
        neq:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Different from this value.
          format: int64
        in:
          type:
            - 'null'
            - array
          items:
            pattern: ^-?(?:0|[1-9]\d*)$
            type:
              - integer
              - string
            format: int64
          description: Equal to any listed value.
        lt:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Less than this value.
          format: int64
        lte:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Less than or equal to this value.
          format: int64
        gt:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Greater than this value.
          format: int64
        gte:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Greater than or equal to this value.
          format: int64
      description: Tests an integer card property.
    DecimalPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Equal to this value.
          format: double
        neq:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Different from this value.
          format: double
        in:
          type:
            - 'null'
            - array
          items:
            pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
            type:
              - number
              - string
            format: double
          description: Equal to any listed value.
        lt:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Less than this value.
          format: double
        lte:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Less than or equal to this value.
          format: double
        gt:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Greater than this value.
          format: double
        gte:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Greater than or equal to this value.
          format: double
      description: Tests a decimal card property.
    TimestampPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          type:
            - 'null'
            - string
          description: Equal to this value.
          format: date-time
        neq:
          type:
            - 'null'
            - string
          description: Different from this value.
          format: date-time
        in:
          type:
            - 'null'
            - array
          items:
            type: string
            format: date-time
          description: Equal to any listed value.
        lt:
          type:
            - 'null'
            - string
          description: Less than this value.
          format: date-time
        lte:
          type:
            - 'null'
            - string
          description: Less than or equal to this value.
          format: date-time
        gt:
          type:
            - 'null'
            - string
          description: Greater than this value.
          format: date-time
        gte:
          type:
            - 'null'
            - string
          description: Greater than or equal to this value.
          format: date-time
      description: Tests a timestamp card property.
    BooleanPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          type:
            - 'null'
            - boolean
          description: Equal to this value.
        neq:
          type:
            - 'null'
            - boolean
          description: Different from this value.
        in:
          type:
            - 'null'
            - array
          items:
            type: boolean
          description: Equal to any listed value.
      description: Tests a boolean card property.
    ListPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        contains:
          type:
            - 'null'
            - string
          description: An exact list element to match.
        pattern:
          type:
            - 'null'
            - string
          description: A wildcard pattern applied to each element.
        ignoreCase:
          type: boolean
          description: Whether element matching ignores case.
          default: false
        languages:
          type:
            - 'null'
            - array
          description: Every listed language must match. There is no language fallback.
        length:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CountBounds'
              description: Bounds on list length, including duplicate and empty elements.
          description: Bounds on list length, including duplicate and empty elements.
        only:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Every list element must be one of these values. An empty or missing
            list doesn't match.
      description: Tests a list card property.
    PropertyReference:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        languages:
          type:
            - 'null'
            - array
          description: Every listed language must match. There is no language fallback.
      description: Tests that a card property has a value.
    SegmentPredicate:
      required:
        - definitionId
        - id
      type: object
      properties:
        definitionId:
          $ref: '#/components/schemas/SegmentDefinitionId'
          description: Raw id of the segment definition (e.g. `campaigns`).
        id:
          $ref: '#/components/schemas/SegmentId'
          description: Raw id of the segment within that segment definition.
      description: Describes membership in a segment.
    RelationPredicate:
      required:
        - id
      type: object
      properties:
        id:
          $ref: '#/components/schemas/RelationId'
          description: Id of the relation. The current card determines its direction.
        where:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: >-
                The condition each counted child must satisfy. Null includes all
                live children.
          description: >-
            The condition each counted child must satisfy. Null includes all
            live children.
        count:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CountBounds'
              description: >-
                Bounds on distinct matching children. Null requires at least one
                match.
          description: >-
            Bounds on distinct matching children. Null requires at least one
            match.
      description: Tests live related entries.
    LifecyclePredicate:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the lifecycle (a UUID).
          format: uuid
        state:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleReadinessState'
              description: Readiness of the whole lifecycle for the entry.
          description: Readiness of the whole lifecycle for the entry.
        step:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleStepPredicate'
              description: Condition on one step.
          description: Condition on one step.
        firstIncompleteStepId:
          type:
            - 'null'
            - string
          description: Id of the first step that's incomplete for the entry.
          format: uuid
      description: >-
        Matches entries by their saved readiness under an active lifecycle. Set
        exactly one of `state`, `step` or `firstIncompleteStepId`. Entries
        without a saved assessment stay unknown, even under `not`.
    LifecycleComponentId:
      type: string
      description: Identifies a lifecycle step or rule with a server-generated id (a UUID).
      format: uuid
    LifecycleSlug:
      maxLength: 128
      pattern: ^[A-Za-z][A-Za-z0-9_-]*$
      type: string
      description: >-
        Identifies a lifecycle step or rule with an id you choose: up to 128
        ASCII letters, digits, `-` or `_`, starting with a letter.
    LifecycleRule:
      required:
        - id
        - slug
        - severity
        - message
        - assertion
        - precondition
      type: object
      properties:
        id:
          $ref: '#/components/schemas/LifecycleComponentId'
          description: >-
            Server-generated id of the rule (a UUID), kept when the rule moves
            between steps.
        slug:
          $ref: '#/components/schemas/LifecycleSlug'
          description: Your id for the rule, unique among all rules in this lifecycle.
        severity:
          $ref: '#/components/schemas/LifecycleRuleSeverity'
          description: '`Error` blocks completion; `Warning` and `Advisory` don''t.'
        message:
          type: string
          description: Guidance shown with this rule's outcome.
        assertion:
          $ref: '#/components/schemas/SearchPredicate'
          description: The condition an applicable entry must satisfy.
        precondition:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: >-
                A false precondition skips this rule. Null means the rule always
                applies.
          description: >-
            A false precondition skips this rule. Null means the rule always
            applies.
      description: Holds a condition and the guidance shown when it fails.
    LifecycleStepAssessment:
      required:
        - stepId
        - slug
        - requirementsSatisfied
        - complete
        - locked
        - completionReason
        - rules
      type: object
      properties:
        stepId:
          $ref: '#/components/schemas/LifecycleComponentId'
          description: Id of the step in the evaluated definition.
        slug:
          $ref: '#/components/schemas/LifecycleSlug'
          description: Slug of the step within the lifecycle.
        requirementsSatisfied:
          type: boolean
          description: >-
            Whether all applicable error rules pass, regardless of earlier
            steps.
        complete:
          type: boolean
          description: Whether this step's requirements and all earlier steps are complete.
        locked:
          type: boolean
          description: Whether an earlier step is incomplete.
        completionReason:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleCompletionReason'
              description: Why the step completed. Null while incomplete or locked.
          description: Why the step completed. Null while incomplete or locked.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/LifecycleRuleAssessment'
          description: Every rule's local result, including rules in locked steps.
      description: Holds local rule results and cumulative completion for a step.
    LifecycleReadinessState:
      enum:
        - Complete
        - Incomplete
        - NotApplicable
        - null
      description: Saved readiness of an assessed entry. Missing assessments have no state.
      x-enum-descriptions:
        Complete: The lifecycle applies to the entry and every step is complete.
        Incomplete: >-
          The lifecycle applies to the entry and at least one step is
          incomplete.
        NotApplicable: The entry doesn't match the lifecycle's applicability.
    LifecycleRuleSeverity:
      enum:
        - Error
        - Warning
        - Advisory
      description: Sets whether a failed rule blocks its step.
      x-enum-descriptions:
        Error: Blocks the step until the rule is satisfied.
        Warning: Doesn't block the step.
        Advisory: Doesn't block the step.
    PropertyId:
      type: string
      description: Identifies a card property (e.g. `title`).
    CountBounds:
      type: object
      properties:
        eq:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Exactly this many.
          format: int64
        gt:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Greater than this value.
          format: int64
        gte:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Greater than or equal to this value.
          format: int64
        lt:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Less than this value.
          format: int64
        lte:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Less than or equal to this value.
          format: int64
      description: Sets an exact count or a range of nonnegative counts.
    SegmentDefinitionId:
      type: string
      description: Identifies a segment definition by its raw id (e.g. `campaigns`).
    SegmentId:
      type: string
      description: Identifies a segment by its raw id within its segment definition.
    RelationId:
      type: string
      description: Identifies a relation definition by its raw id.
    LifecycleStepPredicate:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the step in the active revision (a UUID).
          format: uuid
        requirements:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleRequirementsFilter'
              description: >-
                Whether the step's own blocking rules pass, whatever earlier
                steps say.
          description: >-
            Whether the step's own blocking rules pass, whatever earlier steps
            say.
        completion:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleCompletionFilter'
              description: Whether the step and every earlier step are complete.
          description: Whether the step and every earlier step are complete.
      description: >-
        Matches one step of a lifecycle. Set exactly one of `requirements` or
        `completion`.
    LifecycleCompletionReason:
      enum:
        - RequirementsSatisfied
        - NoApplicableBlockingRequirements
        - null
      description: Names why a step counts as complete.
      x-enum-descriptions:
        RequirementsSatisfied: Every applicable blocking (error) rule of the step is satisfied.
        NoApplicableBlockingRequirements: The step has no blocking (error) rule that applies to the entry.
    LifecycleRuleAssessment:
      required:
        - ruleId
        - slug
        - severity
        - message
        - outcome
        - skippedReason
      type: object
      properties:
        ruleId:
          $ref: '#/components/schemas/LifecycleComponentId'
          description: Id of the rule in the evaluated definition.
        slug:
          $ref: '#/components/schemas/LifecycleSlug'
          description: Slug of the rule within the lifecycle.
        severity:
          $ref: '#/components/schemas/LifecycleRuleSeverity'
          description: Only error rules block completion.
        message:
          type: string
          description: Guidance from the evaluated definition.
        outcome:
          $ref: '#/components/schemas/LifecycleRuleOutcome'
          description: >-
            Satisfied, failed, or skipped because the precondition did not
            match.
        skippedReason:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleRuleSkippedReason'
              description: Why the rule was skipped. Null for satisfied or failed rules.
          description: Why the rule was skipped. Null for satisfied or failed rules.
        evidence:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleRuleEvidence'
              description: Bounded evidence for a failed rule; null when not collected.
          description: Bounded evidence for a failed rule; null when not collected.
      description: Holds a rule's result for this entry.
    LifecycleRequirementsFilter:
      enum:
        - Satisfied
        - Failed
        - null
      description: >-
        Matches a step by its own blocking (error) rules, whatever earlier steps
        say.
      x-enum-descriptions:
        Satisfied: The step's applicable blocking (error) rules are satisfied.
        Failed: At least one applicable blocking (error) rule of the step failed.
    LifecycleCompletionFilter:
      enum:
        - Complete
        - Incomplete
        - null
      description: Matches a step by whether it and every earlier step are complete.
      x-enum-descriptions:
        Complete: The step and every earlier step are complete.
        Incomplete: The step or an earlier step is incomplete.
    LifecycleRuleOutcome:
      enum:
        - Satisfied
        - Failed
        - Skipped
      description: Reports the result of one rule for one entry.
      x-enum-descriptions:
        Satisfied: The entry meets the rule's assertion.
        Failed: The entry doesn't meet the rule's assertion.
        Skipped: >-
          The rule's precondition doesn't match the entry, so the rule wasn't
          checked.
    LifecycleRuleSkippedReason:
      enum:
        - PreconditionNotMet
        - null
      description: Names why a rule was skipped.
      x-enum-descriptions:
        PreconditionNotMet: The rule's precondition doesn't match the entry.
    LifecycleRuleEvidence:
      required:
        - predicates
        - truncated
      type: object
      properties:
        predicates:
          type: array
          items:
            $ref: '#/components/schemas/LifecyclePredicateEvidence'
          description: Bounded predicate observations from the evaluated inputs.
        truncated:
          type: boolean
          description: Whether observation or byte limits omitted evidence.
      description: >-
        Bounded observations explaining a failed rule under its evaluated
        inputs.
    LifecyclePredicateEvidence:
      required:
        - predicatePath
        - relationPath
        - cardDefinitionId
        - language
        - evaluatedCount
        - matchedCount
        - samples
        - samplesTruncated
      type: object
      properties:
        predicatePath:
          type: string
          description: JSON pointer into the assessed rule, beginning with /assertion.
        relationPath:
          type: array
          items:
            type: string
          description: Raw ids of the relations followed from the root card, in order.
        cardDefinitionId:
          type: string
          description: >-
            Raw id of the card definition whose distinct live entries were
            counted.
        language:
          type:
            - 'null'
            - string
          description: >-
            The explicit translation tested; null for a nonlocalized
            observation.
        evaluatedCount:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: Exact number of distinct live entries in this predicate's context.
          format: int64
        matchedCount:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: Exact number of those entries for which the predicate was true.
          format: int64
        samples:
          type: array
          items:
            $ref: '#/components/schemas/LifecycleEvidenceSample'
          description: Bounded examples, with nonmatches first and then in entry id order.
        samplesTruncated:
          type: boolean
          description: Whether more entries were evaluated than are shown in samples.
      description: >-
        Exact counts for distinct live entries at one predicate location and
        language.
    LifecycleEvidenceSample:
      required:
        - entryId
        - matched
      type: object
      properties:
        entryId:
          type: string
          description: >-
            Raw id of the entry at evaluation time; the entry may have been
            deleted since.
        matched:
          type: boolean
          description: Whether this entry satisfied the observed predicate.
      description: >-
        An entry observed during evaluation; it may no longer exist when read
        later.
  securitySchemes:
    kindeOAuth:
      type: oauth2
      description: >-
        Sign in with the existing Occtoo Studio identity and selected
        organization.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.occtoo.com/oauth2/auth?audience=https%3A%2F%2Fapi-weu.occtoo.com
          tokenUrl: https://auth.occtoo.com/oauth2/token
          scopes:
            openid: Authenticate the user with OpenID Connect.
            profile: Read the user's basic profile.
            email: Read the user's email address.
            offline: Refresh the access token without another interactive sign-in.
          x-usePkce: SHA-256
          x-scalar-redirect-uri: https://api.occtoo.com/docs/
    bearerAuth:
      type: http
      description: >-
        Tenant-scoped Occtoo access token, including Kinde machine-to-machine
        application tokens.
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      description: Occtoo organization API key.
      name: x-api-key
      in: header

````

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