Skip to main content
POST
/
data
/
projects
/
{projectId}
/
queries
curl --request POST \
  --url https://partner.peaka.studio/api/v1/data/projects/{projectId}/queries \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "displayName": "sampleQuery",
  "inputQuery": "SELECT * from \"mycatalog\".payment.customers"
}
'
{
  "id": "<string>",
  "displayName": "<string>",
  "name": "<string>",
  "inputQuery": "<string>",
  "inputQueryRefId": "<string>",
  "queryType": "<string>",
  "schedule": {
    "expression": "<string>"
  },
  "path": "<string>",
  "folderId": "<string>"
}

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

Query Parameters

checkSchemaExists
boolean
default:true

Body

application/json

Query Request

displayName
string

The display name of the query.

inputQuery
string

The sql query.

queryType
string

The type of the query: PLAIN or MATERIALIZED

Default is PLAIN.

schedule
object

This class represents a schedule for a materialized query.

Response

200 - application/json

Query created

id
string

The ID of the query.

displayName
string

The display name of the query.

name
string

The name of the query.

This is the name of the query which will be used in the sql query. e.g. SELECT * FROM "peaka"."query".""

inputQuery
string

The sql query.

inputQueryRefId
string

The reference id of the input query.

queryType
string

The type of the query: PLAIN or MATERIALIZED

schedule
object

This class represents a schedule for a materialized query.

path
string

The path of the query (e.g. "/analytics/dashboards"). Null if the query is not in any folder.

folderId
string

The ID of the folder containing this query. Null if the query is not in any folder.