> ## 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.

# Query graph facts

> The sweep a walk from a result cannot make: every fact about a subject,
a relation or a document, or matching some words, counted or listed. The
statement reads the `facts` table alone and names no table of the
database.

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/graph_facts/{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/graph_facts/{database}:
    post:
      tags:
        - Agent
      summary: Query graph facts
      description: >-
        The sweep a walk from a result cannot make: every fact about a subject,

        a relation or a document, or matching some words, counted or listed. The

        statement reads the `facts` table alone and names no table of the

        database.


        Preview: this route may change between releases. It needs the agent APIs
        enabled on your account, and answers 403 until they are.
      operationId: graph_facts
      parameters:
        - name: database
          in: path
          description: Target database.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphFactsRequest'
            example:
              sql: >-
                SELECT subject, relation, object, document FROM facts WHERE
                subject = 'Acme Corp' LIMIT 20
        required: true
      responses:
        '200':
          description: >-
            The statement's rows. `note` says why there are none when the
            deployment builds no knowledge graph.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraphFactsResponse'
              example:
                rows:
                  - subject: Acme Corp
                    relation: acquired
                    object: Globex
                    document: annual-report-2024
        '400':
          description: >-
            Invalid request body, a database name that is not an identifier, or
            a statement the engine refuses.
        '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 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:
    GraphFactsRequest:
      type: object
      description: |-
        `POST /v1/graph_facts/{database}`: one SQL statement over the facts the
        knowledge graph read from the database's text. It is the sweep a walk
        from a result cannot make: every fact of a party, a relation, a
        document, or matching some words, counted or listed. The facts are a
        `facts` table kept beside the database and never in its catalog; the
        statement reads that table and names no table of the database. An
        unknown field is refused.
      required:
        - sql
      properties:
        sql:
          type: string
          description: |-
            The statement, over `facts`: its columns are `subject`, `relation`,
            `object`, `object_is_value`, `qualifiers`, `subject_node`,
            `object_node`, `document`, `source_table`, `source_column`,
            `evidence_id`, `evidence_last_id` and `built_ms`, and its four text
            columns are full-text indexed for the search functions.
      additionalProperties: false
    GraphFactsResponse:
      type: object
      description: The statement's rows, and a note when the deployment builds no graph.
      required:
        - rows
      properties:
        note:
          type:
            - string
            - 'null'
          description: |-
            Why there are no rows, when the deployment builds no knowledge
            graph. Absent otherwise.
        rows:
          type: array
          items:
            type: object
          description: |-
            The statement's rows, each a JSON object of column name to cell
            value.
  securitySchemes:
    api_key:
      type: http
      scheme: bearer

````

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