---
title: "POST /api/ee/transform/extract-columns"
method: POST
path: "/api/ee/transform/extract-columns"
tags: ["/api/ee/transform"]
---

# POST /api/ee/transform/extract-columns

`POST /api/ee/transform/extract-columns`

Extract column names from an MBQL query without executing it.

  Compiles the query to native SQL using [[qp.compile/compile-with-inline-parameters]],
  which handles parameterized queries with template tags. Then extracts column names
  using PreparedStatement metadata.

  Returns a map with a :columns key containing a vector of column names (strings).
  If extraction fails, returns nil for :columns.

## Request body

- object
  - `query` MetabaseQueryProcessorSchemaAnyQuery, required — Schema for a map that is in the general shape of either a legacy MBQL or MBQL 5 query. Query may not be normalized yet! This schema is not very strict because we need to handle different types of queries (legacy MBQL, pMBQL, super-legacy MBQL, internal audit app queries, etc.) and it might not be normalized yet.
    - `database` union
      - integer — Valid Database ID
      - unknown

## Response `2XX`

Successful response

## Other responses

- `4XX` — Client error response
- `5XX` — Server error response

---

[API](https://skmtc.dev/metabase/apis/metabase-api.md) · [All operations](https://skmtc.dev/metabase/apis/metabase-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/metabase/metabase-api/revisions/bd1deee7eae2/schema)
