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

# Fetch entity rows by IDs, with optional relational expand



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/query/{entity}/fetch
openapi: 3.0.0
info:
  title: Tempo API
  description: >-
    The Tempo API gives you programmatic access to Deal Brain over HTTP.


    Authenticate with an API key passed as a Bearer token in the `Authorization`
    header.


    If you are building an AI agent rather than a traditional integration, the
    [MCP server](/integrations/mcp) exposes a richer surface and handles auth
    over OAuth.
  version: '1.0'
  contact: {}
servers:
  - url: https://findtempo.co
    description: Production
security: []
tags: []
paths:
  /api/v1/query/{entity}/fetch:
    post:
      tags:
        - Query
      summary: Fetch entity rows by IDs, with optional relational expand
      operationId: queryFetch
      parameters:
        - name: entity
          required: true
          in: path
          description: >-
            Curated entity name — see GET /query/describe for the set the host
            exposes.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryFetchRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryFetchResponseDto'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - api-key: []
components:
  schemas:
    QueryFetchRequestDto:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
          maxItems: 500
        expand:
          type: array
          items:
            type: string
        filter:
          type: object
          additionalProperties: {}
        include_sql:
          type: boolean
        scope:
          type: object
          properties:
            as:
              default: org
              type: string
              enum:
                - org
                - user
            user:
              type: string
              minLength: 1
              description: 'When as=user: a user id (uuid) or email.'
      required:
        - ids
    QueryFetchResponseDto:
      type: object
      properties:
        entity:
          type: string
        rows:
          type: array
          items:
            type: object
            additionalProperties: {}
        count:
          type: integer
        sql:
          type: string
        params:
          type: array
          items: {}
      required:
        - entity
        - rows
        - count
    ErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        error:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - statusCode
        - message
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: Authorization
      description: API key passed as Bearer token (e.g. "Bearer your-api-key")

````