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

# Apply corrections to a NER review item

> Submit per-entity corrections (confirm/reject/remap) for a pending item. Confirmed and remapped entities trigger the alias feedback loop (T3.7): the matched text is recorded as a known alias for future NER dictionary passes. Remapping (T3.6) allows the reviewer to link the detected text to a different entity than what the NER pipeline suggested.



## OpenAPI

````yaml /api-reference/memory-api.json patch /v1/memory/ner-review/{item_id}
openapi: 3.1.0
info:
  title: Strattum Memory API
  description: >-
    REST API that serves entity context — profile, timeline, graph, sources and
    formatted context — for agents and UIs. (PRD-003, Workstream 1.3)
  version: 1.0.0
servers: []
security: []
paths:
  /v1/memory/ner-review/{item_id}:
    patch:
      tags:
        - ner-review
        - ner-review-queue
      summary: Apply corrections to a NER review item
      description: >-
        Submit per-entity corrections (confirm/reject/remap) for a pending item.
        Confirmed and remapped entities trigger the alias feedback loop (T3.7):
        the matched text is recorded as a known alias for future NER dictionary
        passes. Remapping (T3.6) allows the reviewer to link the detected text
        to a different entity than what the NER pipeline suggested.
      operationId: patch_review_item_v1_memory_ner_review__item_id__patch
      parameters:
        - name: item_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Item Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchReviewItemRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NERReviewItem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PatchReviewItemRequest:
      properties:
        corrections:
          anyOf:
            - items:
                $ref: '#/components/schemas/EntityCorrection'
              type: array
            - type: 'null'
          title: Corrections
        status:
          type: string
          enum:
            - reviewed
            - skipped
          title: Status
          default: reviewed
        reviewed_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Reviewed By
      type: object
      title: PatchReviewItemRequest
      description: Body for PATCH /ner-review/{item_id}.
    NERReviewItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        source_type:
          $ref: '#/components/schemas/ReviewSourceType'
        source_id:
          type: string
          title: Source Id
        source_text:
          type: string
          title: Source Text
        detected_entities:
          items:
            $ref: '#/components/schemas/DetectedEntity'
          type: array
          title: Detected Entities
        status:
          $ref: '#/components/schemas/NERReviewStatus'
          default: pending
        reviewed_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Reviewed By
        reviewed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Reviewed At
        corrections:
          anyOf:
            - items:
                $ref: '#/components/schemas/EntityCorrection'
              type: array
            - type: 'null'
          title: Corrections
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - source_type
        - source_id
        - source_text
      title: NERReviewItem
      description: |-
        A single NER review queue entry (row in ner_review_queue).

        Attributes:
            id:                UUID primary key.
            source_type:       Origin data source type.
            source_id:         Identifier of the originating record (Slack message ID,
                               Confluence page ID, etc.).
            source_text:       Relevant text excerpt that triggered the NER detection.
            detected_entities: List of entities detected by the NER pipeline.
            status:            Current review lifecycle status.
            reviewed_by:       User who reviewed this item.
            reviewed_at:       UTC timestamp of review completion.
            corrections:       List of corrections applied by the reviewer.
            created_at:        UTC timestamp of item creation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EntityCorrection:
      properties:
        entity_id:
          type: string
          title: Entity Id
        action:
          $ref: '#/components/schemas/CorrectionAction'
        remap_entity_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Remap Entity Id
        remap_entity_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Remap Entity Name
        reviewed_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Reviewed By
      type: object
      required:
        - entity_id
        - action
      title: EntityCorrection
      description: |-
        A single correction recorded when a reviewer processes an item.

        Stored as an element of NERReviewItem.corrections (JSONB array).

        Attributes:
            entity_id:        Original detected entity_id being corrected.
            action:           confirm | reject | remap.
            remap_entity_id:  Target entity_id when action == "remap".
            remap_entity_name: Human-readable name of the remap target.
            reviewed_by:      User identifier of the reviewer.
    ReviewSourceType:
      type: string
      enum:
        - slack
        - confluence
        - gdrive
        - meeting_transcript
        - email
        - notion
      title: ReviewSourceType
      description: |-
        Unstructured-data source types that feed the review queue.

        Structured sources (CRM, ERP) use deterministic entity resolution and
        do not produce review queue items.
    DetectedEntity:
      properties:
        entity_id:
          type: string
          title: Entity Id
        entity_type:
          type: string
          title: Entity Type
        entity_name:
          type: string
          title: Entity Name
        confidence:
          type: number
          maximum: 1
          minimum: 0
          title: Confidence
        matched_text:
          type: string
          title: Matched Text
        source:
          type: string
          enum:
            - dictionary
            - llm
          title: Source
      type: object
      required:
        - entity_id
        - entity_type
        - entity_name
        - confidence
        - matched_text
        - source
      title: DetectedEntity
      description: |-
        A single entity detected by the NER pipeline in a source document.

        Stored as an element of NERReviewItem.detected_entities (JSONB array).

        Attributes:
            entity_id:    Graph entity identifier (e.g. "comp_techcorp").
            entity_type:  Canonical entity type (e.g. "Company").
            entity_name:  Human-readable canonical name.
            confidence:   NER confidence score 0.0 – 1.0.
            matched_text: The substring in source_text that triggered the match.
            source:       NER pass that produced this result ("dictionary" | "llm").
    NERReviewStatus:
      type: string
      enum:
        - pending
        - reviewed
        - skipped
      title: NERReviewStatus
      description: |-
        Lifecycle status of a review queue item.

        pending  → awaiting human review
        reviewed → all corrections applied (confirm/reject/remap)
        skipped  → reviewer chose to skip without corrections
    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
    CorrectionAction:
      type: string
      enum:
        - confirm
        - reject
        - remap
      title: CorrectionAction
      description: |-
        The action a reviewer takes on a detected entity.

        confirm → accept the NER link; tag created in knowledge_document_tags
        reject  → discard the NER link; no tag created
        remap   → link to a different entity than the one NER detected

````