curl --request POST \
--url https://partner.peaka.studio/api/v1/data/projects/{projectId}/queries/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": [
{
"catalogName": "peaka",
"schemaName": "query",
"tableName": "samplequery"
}
]
}
'{
"columns": [
{
"catalogName": "peaka",
"schemaName": "query",
"tableName": "samplequery",
"columnName": "event"
},
{
"catalogName": "peaka",
"schemaName": "query",
"tableName": "samplequery",
"columnName": "distinct_id"
}
],
"data": [
[
{
"name": "event",
"displayName": "event",
"dataType": "varchar",
"order": 0,
"value": "$mp_web_page_view"
},
{
"name": "distinct_id",
"displayName": "distinct_id",
"dataType": "varchar",
"order": 1,
"value": "$device:916806fd-8a6c-425b-b5f9-b76b5d6f9d55"
}
]
]
}Data -- Queries
Execute Query
Executes a query and returns the result. Accepts a query builder object, a query ID, a query name, or a raw SQL statement.
The format query parameter controls the shape of the data array in the response:
| Value | Description |
|---|---|
CELL_TYPED (default) | Each cell is an object with name, displayName, dataType, order, and value. |
SIMPLE | Each row is a flat JSON object whose keys are the column names. |
COMPACT | Each row is a plain array of values ordered by column position. |
POST
/
data
/
projects
/
{projectId}
/
queries
/
execute
curl --request POST \
--url https://partner.peaka.studio/api/v1/data/projects/{projectId}/queries/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": [
{
"catalogName": "peaka",
"schemaName": "query",
"tableName": "samplequery"
}
]
}
'{
"columns": [
{
"catalogName": "peaka",
"schemaName": "query",
"tableName": "samplequery",
"columnName": "event"
},
{
"catalogName": "peaka",
"schemaName": "query",
"tableName": "samplequery",
"columnName": "distinct_id"
}
],
"data": [
[
{
"name": "event",
"displayName": "event",
"dataType": "varchar",
"order": 0,
"value": "$mp_web_page_view"
},
{
"name": "distinct_id",
"displayName": "distinct_id",
"dataType": "varchar",
"order": 1,
"value": "$device:916806fd-8a6c-425b-b5f9-b76b5d6f9d55"
}
]
]
}

Authorizations
Use the Authorization header with the value 'Bearer ' to authenticate. Partner API Keys have full access; Project API Keys are limited to their project scope. Learn more: https://docs.peaka.com/api-reference/authentication
Query Parameters
Body
application/json
Execute Query Request
- Option 1
- Option 2
- Option 3
- Option 4
Executes a query using the query builder. The from field is required.
Minimal example:
{ "from": [ { "catalogName": "peaka", "schemaName": "query", "tableName": "samplequery" } ] }
With columns, filters, limit, offset, and orderBy:
{ "columns": ["amount"], "from": [ { "catalogName": "wilderman_green", "schemaName": "payment", "tableName": "charges" } ], "filters": { "and": [ [ { "column": { "catalogName": "wilderman_green", "schemaName": "payment", "tableName": "charges", "columnName": "amount" } }, ">", [150] ] ] }, "limit": 50, "offset": 0, "orderBy": ["amount DESC"] }
Response
200 - application/json
Query Result