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

# Evaluate a decision against many contexts

> Evaluate many input contexts against one pinned version.

Every context runs against the same version, and one failing context
does not fail the batch — each result carries its own success flag.

**Required roles**: `simulator` or above



## OpenAPI

````yaml post /api/decisions/{workspace}/{key}/evaluate:batch
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/decisions/{workspace}/{key}/evaluate:batch:
    post:
      tags:
        - Decisions
      summary: Evaluate a decision against many contexts
      description: |-
        Evaluate many input contexts against one pinned version.

        Every context runs against the same version, and one failing context
        does not fail the batch — each result carries its own success flag.

        **Required roles**: `simulator` or above
      operationId: evaluate_batch_api_decisions__workspace___key__evaluate_batch_post
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
            maxLength: 64
            pattern: ^[a-z0-9][a-z0-9-]{0,63}$
            description: Workspace slug.
            title: Workspace
          description: Workspace slug.
        - name: key
          in: path
          required: true
          schema:
            type: string
            maxLength: 64
            pattern: ^[a-z0-9][a-z0-9-]{0,63}$
            description: Decision key — a flat slug, never a path.
            title: Key
          description: Decision key — a flat slug, never a path.
        - name: version
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            title: Version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchEvaluateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchEvaluateResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Content Too Large
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    BatchEvaluateRequest:
      properties:
        contexts:
          items:
            additionalProperties: true
            type: object
          type: array
          minItems: 1
          title: Contexts
          description: One input context per evaluation.
      type: object
      required:
        - contexts
      title: BatchEvaluateRequest
    BatchEvaluateResponse:
      properties:
        workspace:
          type: string
          title: Workspace
        key:
          type: string
          title: Key
        version:
          type: integer
          title: Version
        content_sha:
          type: string
          title: Content Sha
        results:
          items:
            $ref: '#/components/schemas/BatchEvaluateItem'
          type: array
          title: Results
        latency_ms:
          type: number
          title: Latency Ms
      type: object
      required:
        - workspace
        - key
        - version
        - content_sha
        - results
        - latency_ms
      title: BatchEvaluateResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    BatchEvaluateItem:
      properties:
        index:
          type: integer
          title: Index
        success:
          type: boolean
          title: Success
        result:
          anyOf:
            - {}
            - type: 'null'
          title: Result
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      required:
        - index
        - success
      title: BatchEvaluateItem
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````