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

> Judge scoped people against the criteria over their stored enrichment: must-haves gate, nice-to-haves rank, fit lands on each row. Await a sample to tune criteria.

# Judge scoped people against criteria (async run)



## OpenAPI

````yaml post /sequences/{sequenceId}/judge
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /sequences/{sequenceId}/judge:
    post:
      summary: Judge scoped people against criteria (async run)
      description: >-
        One LLM verdict per person per criterion over their STORED enrichment
        (enrich first). Must-haves gate, nice-to-haves rank; fit lands on each
        row, verdicts on their qualification record. Set `wait` to judge a
        sample (≤50) and read its completion aggregates in the same call — they
        show where fails/unsures concentrate, so a criterion can be fixed and
        re-judged immediately. Larger scopes return an immediate ack. Rows with
        no data at all (no enrichment and no extra_data) are skipped and
        counted.
      operationId: judgeSequenceContacts
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: sequenceId
          required: true
          description: The unique identifier of the sequence
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JudgeSequenceContactsDto'
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QualificationRunAckDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    JudgeSequenceContactsDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/JudgeSequenceContactsDtoInput'
      type: object
      properties:
        scope:
          oneOf:
            - type: object
              properties:
                kind:
                  type: string
                  const: batch_key
                batch_key:
                  type: string
                  minLength: 1
                  maxLength: 200
              required:
                - kind
                - batch_key
            - type: object
              properties:
                kind:
                  type: string
                  const: contact_ids
                contact_ids:
                  minItems: 1
                  maxItems: 10000
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - kind
                - contact_ids
            - type: object
              properties:
                kind:
                  type: string
                  const: all_candidates
              required:
                - kind
        criteria:
          description: >-
            Omitted: judge with the campaign's stored criteria. Provided: judge
            with these AND save them as the campaign's new current criteria.
          type: object
          properties:
            must:
              maxItems: 20
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                    minLength: 2
                    maxLength: 60
                    description: >-
                      A few words naming this criterion, shown in the dashboard
                      — "Recent invoicing complaint", "Business account". Not a
                      sentence.
                  text:
                    type: string
                    minLength: 3
                    maxLength: 500
                    description: >-
                      The full instruction the judge reads. Name the boundary
                      explicitly — what counts and what does not. Never shown in
                      the table.
                required:
                  - label
                  - text
            nice:
              maxItems: 20
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                    minLength: 2
                    maxLength: 60
                    description: >-
                      A few words naming this criterion, shown in the dashboard
                      — "Recent invoicing complaint", "Business account". Not a
                      sentence.
                  text:
                    type: string
                    minLength: 3
                    maxLength: 500
                    description: >-
                      The full instruction the judge reads. Name the boundary
                      explicitly — what counts and what does not. Never shown in
                      the table.
                  grade:
                    type: string
                    enum:
                      - high
                      - medium
                      - low
                required:
                  - label
                  - text
                  - grade
          required:
            - must
            - nice
        wait:
          description: >-
            Hold the response until the run finishes (up to ~50s) and return it,
            so a sample can be awaited instead of polled. IGNORED when the scope
            is larger than 50 people — dispatch those and let the dashboard show
            progress.
          type: boolean
      required:
        - scope
    QualificationRunAckDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/QualificationRunAckDto'
      type: object
      properties:
        run_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        scoped_count:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        run:
          anyOf:
            - $ref: '#/components/schemas/QualificationRunDto'
            - type: 'null'
          description: >-
            The finished run (counts + aggregates) when `wait` was set, the
            scope was small enough, and it settled in time. Null otherwise —
            read it with read_qualification_run.
      required:
        - run_id
        - scoped_count
        - run
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    QualificationRunDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/QualificationRunDto'
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        campaign_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        type:
          type: string
          enum:
            - enrich
            - judge
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
        scope:
          anyOf:
            - oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      const: batch_key
                    batch_key:
                      type: string
                      minLength: 1
                      maxLength: 200
                  required:
                    - kind
                    - batch_key
                  additionalProperties: false
                - type: object
                  properties:
                    kind:
                      type: string
                      const: contact_ids
                    contact_ids:
                      minItems: 1
                      maxItems: 10000
                      type: array
                      items:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  required:
                    - kind
                    - contact_ids
                  additionalProperties: false
                - type: object
                  properties:
                    kind:
                      type: string
                      const: all_candidates
                  required:
                    - kind
                  additionalProperties: false
            - type: 'null'
        criteria:
          anyOf:
            - type: object
              properties:
                must:
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                        minLength: 2
                        maxLength: 60
                        description: >-
                          A few words naming this criterion, shown in the
                          dashboard — "Recent invoicing complaint", "Business
                          account". Not a sentence.
                      text:
                        type: string
                        minLength: 3
                        maxLength: 500
                        description: >-
                          The full instruction the judge reads. Name the
                          boundary explicitly — what counts and what does not.
                          Never shown in the table.
                    required:
                      - label
                      - text
                    additionalProperties: false
                nice:
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                        minLength: 2
                        maxLength: 60
                        description: >-
                          A few words naming this criterion, shown in the
                          dashboard — "Recent invoicing complaint", "Business
                          account". Not a sentence.
                      text:
                        type: string
                        minLength: 3
                        maxLength: 500
                        description: >-
                          The full instruction the judge reads. Name the
                          boundary explicitly — what counts and what does not.
                          Never shown in the table.
                      grade:
                        type: string
                        enum:
                          - high
                          - medium
                          - low
                    required:
                      - label
                      - text
                      - grade
                    additionalProperties: false
              required:
                - must
                - nice
              additionalProperties: false
            - type: 'null'
        enrichers:
          anyOf:
            - type: array
              items:
                type: string
                enum:
                  - opencx
            - type: 'null'
        model:
          anyOf:
            - type: string
            - type: 'null'
        counts:
          type: object
          properties:
            scoped:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            processed:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            no_data:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            skipped_no_enrichment:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            skipped_unchanged:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            qualified:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            disqualified:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            errors:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
          required:
            - scoped
            - processed
            - no_data
            - skipped_no_enrichment
            - skipped_unchanged
            - qualified
            - disqualified
            - errors
          additionalProperties: false
        aggregates:
          anyOf:
            - type: object
              properties:
                criteria:
                  type: array
                  items:
                    type: object
                    properties:
                      kind:
                        type: string
                        enum:
                          - must
                          - nice
                      text:
                        type: string
                      pass:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      fail:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      unsure:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                    required:
                      - kind
                      - text
                      - pass
                      - fail
                      - unsure
                    additionalProperties: false
                fit_distribution:
                  type: object
                  properties:
                    qualified:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    not_qualified:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    near_miss:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - qualified
                    - not_qualified
                    - near_miss
                  additionalProperties: false
              required:
                - criteria
                - fit_distribution
              additionalProperties: false
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
        created_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        started_at:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        completed_at:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        updated_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - id
        - campaign_id
        - type
        - status
        - scope
        - criteria
        - enrichers
        - model
        - counts
        - aggregates
        - error
        - created_at
        - started_at
        - completed_at
        - updated_at
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````