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

# Regrade an evaluation

> Matches the exact same capture with another ready evaluator of the same test version. No agent rerun, new capture or model call; the prior evaluation is kept.



## OpenAPI

````yaml https://api.twinbay.ai/openapi.json post /evaluations/{evaluation_id}/regrade
openapi: 3.1.0
info:
  title: Twinbay
  description: Backend API
  version: 0.1.0
servers:
  - url: https://api.twinbay.ai
    description: Production
security: []
tags:
  - name: healthchecks
    description: Healthcheck endpoints
  - name: users
    description: >-
      The current user. Sign-up and sign-in happen in WorkOS AuthKit, which
      issues the access tokens this API accepts.
  - name: organizations
    description: >-
      Organizations the caller belongs to. Every authenticated request acts
      inside exactly one organization — the one its access token names — so
      these routes address it as `current`.
  - name: api-keys
    description: >-
      Long-lived credentials for callers that cannot hold an AuthKit session —
      agents, SDKs, CI. A key is accepted wherever an access token is, and acts
      with the role its creator holds when the request arrives.
  - name: environments
    description: >-
      Create and edit isolated provider environments. Each environment contains
      behavioural twins from the `twins` package.
  - name: twins
    description: Manage provisioned twins by their IDs.
  - name: catalog
    description: Browse the digital twins available for new environments.
  - name: scenarios
    description: Reusable starting setups of provider twins and optional seeds.
  - name: seeds
    description: >-
      Starting states for a twin. Describe the data you want in your own words,
      and a worker expands it into rows once; pass the seed's id when you create
      an environment to start a twin holding it.
  - name: tests
    description: >-
      Outcomes described in natural language, compiled once into request
      matchers, and evaluated deterministically against the traffic an attempt
      was served.
paths:
  /evaluations/{evaluation_id}/regrade:
    post:
      tags:
        - tests
      summary: Regrade an evaluation
      description: >-
        Matches the exact same capture with another ready evaluator of the same
        test version. No agent rerun, new capture or model call; the prior
        evaluation is kept.
      operationId: regrade_evaluation
      parameters:
        - name: evaluation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Evaluation Id
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
                minLength: 1
                maxLength: 255
              - type: 'null'
            description: >-
              Replaying the same key and payload returns the same evaluation;
              reusing it with a different payload answers 409.
            title: Idempotency-Key
          description: >-
            Replaying the same key and payload returns the same evaluation;
            reusing it with a different payload answers 409.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegradeRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluationResponse'
        '401':
          description: The credential is missing, malformed, expired, or not trusted
        '403':
          description: The credential does not act inside an organization
        '404':
          description: Evaluation or evaluator version not found
        '409':
          description: The capture or evaluator is not ready or compatible
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Access token: []
        - Organization API key: []
components:
  schemas:
    RegradeRequest:
      properties:
        evaluator_version_id:
          type: string
          format: uuid
          title: Evaluator Version Id
      additionalProperties: false
      type: object
      required:
        - evaluator_version_id
      title: RegradeRequest
    EvaluationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        input_id:
          type: string
          format: uuid
          title: Input Id
        evaluator_version_id:
          type: string
          format: uuid
          title: Evaluator Version Id
        regraded_from_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Regraded From Id
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - error
          title: Status
        phase:
          type: string
          enum:
            - checkpoint
            - final
          title: Phase
        coverage_status:
          type: string
          enum:
            - complete
            - incomplete
            - unknown
          title: Coverage Status
        verdict:
          type: string
          enum:
            - pending
            - passed
            - failed
            - inconclusive
            - error
          title: Verdict
        results:
          items:
            $ref: '#/components/schemas/ResultResponse'
          type: array
          title: Results
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - input_id
        - evaluator_version_id
        - status
        - phase
        - coverage_status
        - verdict
        - results
        - created_at
      title: EvaluationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResultResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        outcome_id:
          type: string
          format: uuid
          title: Outcome Id
        verdict:
          type: string
          enum:
            - met
            - not_met
            - inconclusive
            - error
          title: Verdict
        explanation:
          type: string
          title: Explanation
        evidence:
          items:
            $ref: '#/components/schemas/EvidenceResponse'
          type: array
          title: Evidence
      type: object
      required:
        - id
        - outcome_id
        - verdict
        - explanation
        - evidence
      title: ResultResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    EvidenceResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        source_kind:
          type: string
          enum:
            - request
            - scope
          title: Source Kind
        source_locator:
          type: string
          title: Source Locator
        summary:
          type: string
          title: Summary
      type: object
      required:
        - id
        - source_kind
        - source_locator
        - summary
      title: EvidenceResponse
  securitySchemes:
    Access token:
      type: http
      description: Access token issued by WorkOS AuthKit.
      scheme: bearer
    Organization API key:
      type: apiKey
      description: >-
        An organization API key. Create one at
        https://console.twinbay.ai/api-keys
      in: header
      name: X-API-Key

````