SQL

Run Sql

Run one read-only SQL query scoped to the caller's project.

Args: auth (DualStampedAuth): Resolved credential context. Its project_id is the only project this query can ever see. body (SqlRequest): The query, optional parameter values, and an optional row cap that the service clamps down to the server ceiling.

Returns: SqlResponse: Columns, rows, and whether more rows matched than were returned.

Raises: HTTPException: 400 when the query breaks the read-only contract or asks for more than the server allows, 429 when no query slot is free, 500 when execution fails for a reason the caller cannot act on.

post/api/v1/public/sql

Request

  • Base URL
    https://app.traceroot.ai
  • URL
    https://app.traceroot.ai/api/v1/public/sql
  • Auth
    HTTP bearer

Query parameters

project_idstring nullable

Target project for the request. Required when authenticating with a user session token (a user credential is only meaningful scoped to a project); for an API key it is optional and, if given, must match the key's project.

Request body

max_rowsinteger nullable

Rows to return, clamped down to the server ceiling

parametersobject nullable

Values for {name:Type} placeholders in the query

querystring required

A single read-only SELECT over the public schema

Response

Successful Response

elapsed_msinteger required
row_countinteger required
statisticsobject
truncatedboolean required

True when more rows matched than were returned

Changes

No recorded changes to this operation across all 1 revision of this API.