Skip to main content
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": [
    {
      "catalogId": "2",
      "catalogName": "peaka",
      "schemaName": "query",
      "tableName": "samplequery",
      "columnName": "amount"
    }
  ],
  "data": [
    [
      {
        "name": "amount",
        "displayName": "amount",
        "dataType": "bigint",
        "value": "75",
        "order": 0
      }
    ],
    [
      {
        "name": "amount",
        "displayName": "amount",
        "dataType": "bigint",
        "value": "75",
        "order": 0
      }
    ],
    [
      {
        "name": "amount",
        "displayName": "amount",
        "dataType": "bigint",
        "value": "75",
        "order": 0
      }
    ]
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

projectId
string
required

Body

application/json

Execute Query Request

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"]
 }
 
columns
string[]

Columns to select. If omitted, all columns (*) are returned.

from
object[]

Tables to query from. At least one entry is required.

limit
integer<int64>

Maximum number of rows to return.

offset
integer<int64>

Number of rows to skip before returning results.

orderBy
string[]

Ordering specifications. Each entry is a column name optionally followed by ASC or DESC. Example: ["amount DESC", "created_at ASC"].

filters
object

Filter conditions. Supports and/or logic with column comparisons.

timeout
integer<int32>

Query timeout in seconds.

Response

200 - application/json

Query Result

Represents the result of a query.

columns
object[]

The columns of the query result.

data
object[][]

The data of the query result.