Skip to main content
GET
/
data
/
projects
/
{projectId}
/
queries
/
{queryId}
Read Query
curl --request GET \
  --url https://partner.peaka.studio/api/v1/data/projects/{projectId}/queries/{queryId} \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "displayName": "<string>",
  "name": "<string>",
  "inputQuery": "<string>",
  "inputQueryRefId": "<string>",
  "schedule": {
    "type": "cron",
    "cronExpression": "0 0 * * *",
    "timezone": "UTC"
  },
  "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

ID of the Project

queryId
string
required

ID of the Query

Response

200 - application/json

Read Query

A saved query belonging to a project.

id
string

The ID of the query.

displayName
string

The display name of the query.

name
string

The name of the query used in SQL, e.g. SELECT * FROM "peaka"."query"."".

inputQuery
string

The SQL query.

inputQueryRefId
string | null

The reference id of the input query. For a MATERIALIZED query, the id of the original query it materializes.

queryType
enum<string>

The type of the query.

Available options:
PLAIN,
MATERIALIZED
schedule
object

Schedule configuration of a materialized query. Provide EITHER an interval schedule (type=interval with repeatDuration) OR a cron schedule (type=cron with cronExpression and optional timezone). Use type=none for no schedule. The fields that do not apply to the chosen type are omitted.

Example:
{
  "type": "cron",
  "cronExpression": "0 0 * * *",
  "timezone": "UTC"
}
path
string | null

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

folderId
string | null

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