---
title: "Profile a table"
method: GET
path: "/v1/tables/{t}/profile"
tags: ["tables"]
---

# Profile a table

`GET /v1/tables/{t}/profile`

## Request

- Base URL: `https://data.thinair.co`
- URL: `https://data.thinair.co/v1/tables/{t}/profile`
- Auth: API key in header `x-api-key`

Return per-column distributions, null rates, cardinality, basic numeric / date stats, and PII classification for one table. Requires the Build plan or higher. Quota: 1 capability unit.

## Path parameters

- `t` string, required: Table name. Accepts `table`, `schema.table`, or `database.schema.table` forms — same wire shape the MCP `data_profile` tool accepts. Use `?connection=` to override the tenant's default connection rather than prefixing the path.

## Query parameters

- `connection` string: Connection name (display) or id (uuid). Resolved via name match first, then id match. Call /v1/connections to list available names.
- `sample_rows` integer: Advisory upper bound on rows to scan. Today the underlying profiler decides sampling internally based on table size; the value is reserved for the post-migration profile micro-spec.
- `columns` string: Comma-separated column allowlist. Today the profiler covers the first 50 columns; the value is reserved for the post-migration profile micro-spec.

## Response `200`

Profile result.

- TablesProfileResponse: Per-column profile + health insights for one table. Mirrors the MCP `data_profile` envelope shape.
  - `profiles` object[], required
    - `name` string, required
    - `type` string
    - `nullable` boolean
    - `isPrimaryKey` boolean
    - `null_pct` number
    - `cardinality` number
    - `min` union
      - number
      - string
    - `max` union
      - number
      - string
    - `avg` number
    - `earliest` string
    - `latest` string
    - `pii_risk` boolean
    - `pii_type` string
  - `summary` string
  - `insights` object[]
    - `severity` string, required
    - `message` string, required
    - `column` string
    - `value` unknown
  - `meta` object, required
    - `executionTimeMs` number, required
    - `rowCount` number, required
    - `connection` string, required
    - `dialect` 'postgres' | 'mysql' | 'mssql', required

## Other responses

- `400`: Invalid table name or query parameters.
- `401`: Authentication required or failed.
- `403`: The current plan does not include data_profile.
- `404`: Connection not found, no connections configured, or table missing from the connection's schema.
- `429`: Quota exceeded.

---

[API](https://skmtc.dev/thinair/apis/thinair-data-api.md) · [All operations](https://skmtc.dev/thinair/apis/thinair-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thinair/apis/thinair-data-api/revisions/8a2a2d1b2400?raw)
