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

# Validate a result

> The same verdict the sub-agent reaches on every query it runs, for a
caller writing its own queries: did these rows answer this question? A
refusal is diagnosed against the index, naming which of the question's
terms occur nowhere in the searched column.

Preview: this route may change between releases. It needs the agent APIs enabled on your account, and answers 403 until they are.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/validate/{database}
openapi: 3.1.0
info:
  title: Infino API
  description: >-
    The Infino hosted data-plane API: per-database table operations — create,
    ingest, search, and SQL.
  version: 0.1.0
servers:
  - url: https://api.platform.infino.ws
    description: Infino Cloud
security:
  - api_key: []
tags:
  - name: Databases
    description: Create, list, and delete the databases in your account.
  - name: Tables
    description: Create, drop, and list tables, and describe a table's schema.
  - name: Rows
    description: Append, update, and delete rows.
  - name: Search
    description: BM25, vector, and hybrid search, token and exact match, count, and SQL.
  - name: Agent
    description: >-
      Preview routes for agents: table cards, join keys, line search, result
      checks, graph lookups, and the retrieval sub-agent. They need the agent
      APIs enabled on your account.
  - name: Hydrate
    description: >-
      Preview routes for loading a dataset: start a load of files from object
      storage into a table, follow it, cancel or clear it, and run a sync pass.
paths:
  /v1/validate/{database}:
    post:
      tags:
        - Agent
      summary: Validate a result
      description: >-
        The same verdict the sub-agent reaches on every query it runs, for a

        caller writing its own queries: did these rows answer this question? A

        refusal is diagnosed against the index, naming which of the question's

        terms occur nowhere in the searched column.


        Preview: this route may change between releases. It needs the agent APIs
        enabled on your account, and answers 403 until they are.
      operationId: validate
      parameters:
        - name: database
          in: path
          description: Target database.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateRequest'
            example:
              table_name: code
              field_name: content
              statement: SELECT path FROM code WHERE content ILIKE '%write_pointer%'
              rows:
                - path: README.md
              question: Where is `write_pointer` called?
        required: true
      responses:
        '200':
          description: >-
            The verdict as JSON: `valid`, the `check` that decided, the
            question's `anchors`, and on a refusal the `reason` in the
            sub-agent's own words, the anchors `absent` from the searched column
            (no query over it will find them) and, for a line-window statement
            that matched nothing, the overlap `suggestion` to run instead. This
            route answers four of the five `check` values: `no_rows` (the
            statement returned nothing), `aggregate` (an aggregate, valid when
            it returned a non-zero number), `anchors` (the rows were held to the
            question's terms) and `unchecked` (rows came back and the question
            named nothing to hold them to). The fifth, `graded`, is a verdict a
            grading model reached; this route judges by the words alone and
            never returns it. For an aggregate over a search grouped by a
            column, `group_column`, `groups` and `note` add the facts about each
            group. Sent with empty `rows`, the check is the diagnosis alone,
            which of the question's terms the data holds, before any query is
            spent. `valid` means the result answers the question's terms, not
            that it is correct.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateResponse'
              example:
                valid: false
                reason: >-
                  the rows do not mention `write_pointer`, which the question
                  names
                check: anchors
                anchors:
                  - write_pointer
                rows: 1
        '400':
          description: >-
            Invalid request body (the table, column, statement and rows are
            required, and an unknown field is refused), or a database name that
            is not an identifier.
        '401':
          description: Missing or invalid API key.
        '402':
          description: >-
            The account is suspended for non-payment, or its free period has
            ended.
        '403':
          description: >-
            The agent APIs are not enabled for this account, or the API key
            lacks read access to this database.
        '404':
          description: The database or the table does not exist.
        '410':
          description: The database is being purged.
        '503':
          description: >-
            The database is still activating, or no capacity is free to serve
            it. Transient: retry after the `Retry-After` interval.
      security:
        - api_key: []
components:
  schemas:
    ValidateRequest:
      type: object
      description: |-
        `POST /v1/validate/{database}`: a result, the statement it came from and
        the question it is meant to answer. An unknown field is refused.
      required:
        - table_name
        - field_name
        - statement
        - rows
      properties:
        field_name:
          type: string
          description: |-
            The full-text-indexed column the question's terms are looked up in
            when the result is refused: the column the statement searched.
        question:
          type:
            - string
            - 'null'
          description: |-
            The question the rows are meant to answer. Its anchors (tokens
            holding a digit, quoted or backticked spans, capitalized words past
            the first, identifier-shaped tokens) are what a row-returning result
            must mention, and what is looked up in the index on a refusal.
            Omitted, or a question naming nothing of that shape, leaves a
            non-empty result standing on its own.
        rows:
          type: array
          items:
            type: object
          description: >-
            The rows the statement returned, each a JSON object of column name

            to cell value. An empty array is the query that answered nothing,
            or,

            sent on purpose before any query, the request to check the

            question's terms against the index alone.
        statement:
          type: string
          description: The statement that produced `rows`, as it ran.
        table_name:
          type: string
          description: The table the result came from.
      additionalProperties: false
    ValidateResponse:
      type: object
      description: |-
        The verdict. `valid` is the bar the sub-agent holds its own queries to;
        `reason` is what the sub-agent would have handed its model to query
        again after, so a caller can show or act on the same words. `valid`
        means the result answers the question's terms, not that it is correct.
      required:
        - valid
        - check
        - anchors
        - rows
      properties:
        absent:
          type: array
          items:
            type: string
          description: >-
            The anchors that occur nowhere in `field_name`: no query over it
            will

            find them. Filled only on a refusal about the anchors (no rows, or

            rows naming none); a result that stands is not diagnosed.
        anchors:
          type: array
          items:
            type: string
          description: >-
            The anchors read off the question, in order, each once; empty when
            no

            question was sent or it named nothing of that shape. Returned so a

            caller can see what the bar actually was.
        check:
          $ref: '#/components/schemas/ValidateCheck'
          description: Which check decided.
        group_column:
          type:
            - string
            - 'null'
          description: >-
            For an aggregate over a search grouped by a column: the column the

            statement groups by. With `groups`, it says what each total
            measures,

            so a total over the top k is not read as a size. Absent for any

            other statement, and when no facts were read about the groups.
        groups:
          type: array
          items:
            $ref: '#/components/schemas/GroupFacts'
          description: |-
            The facts about each group the rows name, under `group_column`: its
            whole length and its lines holding each search term. Absent when
            there are none.
        note:
          type:
            - string
            - 'null'
          description: |-
            What an aggregate's totals measure, in the sub-agent's wording.
            Absent for any other statement.
        reason:
          type:
            - string
            - 'null'
          description: |-
            Absent when valid; otherwise what is wrong, in the sub-agent's
            wording, including which anchors the data does not hold.
        rows:
          type: integer
          description: How many rows the request held.
          minimum: 0
        suggestion:
          type:
            - string
            - 'null'
          description: >-
            A statement to run instead of one that returned nothing because it

            asked for rows INSIDE a line window (the overlap predicate it
            meant).
        valid:
          type: boolean
          description: >-
            Whether this result would be accepted as the answer to this
            question.
    ValidateCheck:
      type: string
      description: Which check decided the verdict.
      enum:
        - no_rows
        - aggregate
        - anchors
        - unchecked
        - graded
    GroupFacts:
      type: object
      description: The facts about one group of such an aggregate.
      required:
        - value
      properties:
        file_lines:
          type:
            - integer
            - 'null'
          format: int64
          description: |-
            The source's whole length in lines (the greatest line any of its
            rows ends on), when the table's rows are spans over a source.
        term_lines:
          type: object
          description: |-
            Lines of the source holding each search term, by term; a term the
            source never mentions counts zero.
          additionalProperties:
            type: integer
            minimum: 0
          propertyNames:
            type: string
        value:
          description: |-
            The group's value of the group column, as the rows carry it: any
            JSON scalar (a string, a number, a boolean or null).
  securitySchemes:
    api_key:
      type: http
      scheme: bearer

````

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