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

# Match an ingest item

> Manually match one ingest item to a schema.

Route one item to a participating schema (review-queue equivalent). Auth0 + allowlist. Filing bills `black_hole` to the **uploader**, not the reviewer.


## OpenAPI

````yaml POST /api/v2/ingest/items/{item_id}/match/
openapi: 3.1.0
info:
  title: Abacus Docs API
  version: 1.0.0
  description: |
    REST + SSE surface for Abacus Docs on the same host as the web app
    (`https://abacusdocs.com`). Paths are `/api/v2/…`.

    Authenticate with an organisation API key (`sk-abacus-*`) as a Bearer
    token, or an Auth0 access token. Cross-tenant reads return **404**, not
    403. Page-based lists use `?page=` and `?page_size=`.

    Extraction, reprocess, schema tests, and chat turns spend credits.
    See the help centre Credits pages for rates.
  contact:
    name: Abacus Docs
    url: https://abacusdocs.com/contact
servers:
  - url: https://abacusdocs.com
    description: Production (Extract)
security: []
paths:
  /api/v2/ingest/items/{item_id}/match/:
    post:
      tags:
        - v2/ingest
      summary: Pin or clear an item's schema match
      description: >-
        Pins ``struct_slug`` to the item (→ CLASSIFIED) or clears any pin with
        ``struct_slug: null`` (→ UNMATCHED) — no batch, no extraction (CONTRACT
        §2.6). Allowed from ``UNMATCHED`` / ``NEEDS_REVIEW`` / ``CLASSIFIED``;
        matching a non-enabled struct auto-enables ``black_hole_enabled``.
        Requires ``ingest:write``.
      operationId: v2_ingest_items_match_create
      parameters:
        - in: path
          name: item_id
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemMatchRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemMatchResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '403':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '409':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '426':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    ItemMatchRequestRequest:
      type: object
      description: |-
        POST /api/v2/ingest/items/<item_id>/match/ body (CONTRACT §2.6).

        ``struct_slug=null`` clears any pin (→ UNMATCHED); a slug pins the
        struct's current published version (→ CLASSIFIED).
      properties:
        struct_slug:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 200
      required:
        - struct_slug
    ItemMatchResponse:
      type: object
      description: 200 body of POST /api/v2/ingest/items/<item_id>/match/.
      properties:
        item_id:
          type: string
        state:
          type: string
          description: '"CLASSIFIED" (pinned) or "UNMATCHED" (cleared).'
        struct:
          oneOf:
            - $ref: '#/components/schemas/MatchedStruct'
            - type: 'null'
      required:
        - item_id
        - state
        - struct
    MatchedStruct:
      type: object
      description: >-
        ``{slug, name, version}`` of a pinned target — mirrors
        ``IngestItemSerializer.get_struct``.
      properties:
        slug:
          type: string
        name:
          type: string
        version:
          type: integer
      required:
        - name
        - slug
        - version
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Auth0 access token for a signed-in user. Send `Authorization: Bearer
        <token>`.

        The SPA and desktop agent use this. Prefer an organisation API key for

        server-to-server integrations.

````