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

# Correct a monitor judgment

> Record, undo, or restore one correction of a monitor judgment.



## OpenAPI

````yaml https://api.uselemma.ai/openapi.json post /monitors/{monitor_id}/corrections
openapi: 3.1.0
info:
  title: Lemma Platform API
  description: Lemma Platform HTTP API for AI observability and workspace operations.
  version: 0.1.0
servers:
  - url: https://api.uselemma.ai
    description: Lemma production API
security:
  - bearerAuth: []
paths:
  /monitors/{monitor_id}/corrections:
    post:
      tags:
        - Monitors / Judgments
      summary: Correct a monitor judgment
      description: Record, undo, or restore one correction of a monitor judgment.
      operationId: correct_monitor_judgment
      parameters:
        - name: monitor_id
          in: path
          required: true
          description: Monitor ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    idempotency_key:
                      type: string
                      minLength: 1
                      maxLength: 200
                    action:
                      type: string
                      const: record
                    trace_id:
                      type: string
                      format: uuid
                    verdict:
                      type: string
                      enum:
                        - exclude
                        - include
                    reason:
                      type: string
                      maxLength: 2000
                  required:
                    - idempotency_key
                    - action
                    - trace_id
                    - verdict
                  additionalProperties: false
                - type: object
                  properties:
                    idempotency_key:
                      type: string
                      minLength: 1
                      maxLength: 200
                    action:
                      type: string
                      const: undo
                    correction_id:
                      type: string
                      format: uuid
                  required:
                    - idempotency_key
                    - action
                    - correction_id
                  additionalProperties: false
                - type: object
                  properties:
                    idempotency_key:
                      type: string
                      minLength: 1
                      maxLength: 200
                    action:
                      type: string
                      const: restore
                    correction_id:
                      type: string
                      format: uuid
                  required:
                    - idempotency_key
                    - action
                    - correction_id
                  additionalProperties: false
      responses:
        '200':
          description: Saved correction and effective judgment
          content:
            application/json:
              schema:
                type: object
                properties:
                  correction:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      monitor_id:
                        type: string
                        format: uuid
                      trace_id:
                        type: string
                        format: uuid
                      verdict:
                        type: string
                        enum:
                          - exclude
                          - include
                      reason:
                        type:
                          - string
                          - 'null'
                      active:
                        type: boolean
                      created_at:
                        type: string
                        format: date-time
                    required:
                      - id
                      - monitor_id
                      - trace_id
                      - verdict
                      - reason
                      - active
                      - created_at
                    additionalProperties: false
                  effective_verdict:
                    type:
                      - string
                      - 'null'
                    enum:
                      - exclude
                      - include
                      - null
                required:
                  - correction
                  - effective_verdict
                additionalProperties: false
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                  retryable:
                    type: boolean
                  retry_after_seconds:
                    type: number
                    minimum: 0
                required:
                  - detail
                  - code
                  - retryable
                additionalProperties: false
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                  retryable:
                    type: boolean
                  retry_after_seconds:
                    type: number
                    minimum: 0
                required:
                  - detail
                  - code
                  - retryable
                additionalProperties: false
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                  retryable:
                    type: boolean
                  retry_after_seconds:
                    type: number
                    minimum: 0
                required:
                  - detail
                  - code
                  - retryable
                additionalProperties: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                  retryable:
                    type: boolean
                  retry_after_seconds:
                    type: number
                    minimum: 0
                required:
                  - detail
                  - code
                  - retryable
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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