Get metrics SQL schema
Get metrics SQL schema: getMessageMetricsSqlSchema in the TypeScript, Python, Rust and Go clients.
GET /v1/projects/{projectId}/metrics/query
Returns the message_events and call_events SQL schema, supported queries, and limits for the selected API version.
photon.projects.getMessageMetricsSqlSchema(input: GetMessageMetricsSqlSchemaInput, options?: RequestOptions): Promise<GetMessageMetricsSqlSchemaOutput>photon.projects.get_message_metrics_sql_schema(input: GetMessageMetricsSqlSchemaInput, *, options: RequestOptions | None = None) -> models.GetMessageMetricsSqlSchemaResponseclient.get_message_metrics_sql_schema(project_id: String, params: Option<GetMessageMetricsSqlSchemaParams>).await -> Result<ResponseValue<types::GetMessageMetricsSqlSchemaResponse>, Error<GetMessageMetricsSqlSchemaError>>client.Projects.GetMessageMetricsSqlSchema(ctx context.Context, params *GetMessageMetricsSqlSchemaParams, opts ...RequestOption) (*GetMessageMetricsSqlSchemaResponse, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.getMessageMetricsSqlSchema({
path: {
projectId: "projectId",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import GetMessageMetricsSqlSchemaInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.get_message_metrics_sql_schema(
GetMessageMetricsSqlSchemaInput.model_validate({
"path": {
"projectId": "projectId",
},
})
)use photon_ai_api::{Credential, PhotonClientBuilder, SecretString};
let token = std::env::var("PHOTON_API_TOKEN")?;
let client = PhotonClientBuilder::new()
.credential("accountServiceKey", Credential::Bearer(SecretString::from(token)))
.build()?;
let result = client
.get_message_metrics_sql_schema("projectId".to_owned(), None)
.await
.map_err(|error| format!("{error:?}"))?
.into_inner();import (
"context"
"os"
photonapi "github.com/photon-hq/api/packages/go"
)
ctx := context.Background()
client := photonapi.NewClient(photonapi.WithAPIKey(os.Getenv("PHOTON_API_TOKEN")))
result, err := client.Projects.GetMessageMetricsSqlSchema(ctx, &photonapi.GetMessageMetricsSqlSchemaParams{
ProjectID: "projectId",
})
if err != nil {
return err
}
_ = result{
"capabilities": {
"arrayJoin": true,
"ctes": true,
"joins": true,
"parameters": true,
"selectWithoutFrom": true,
"subqueries": true,
"unions": true
},
"dialect": "string",
"limits": {
"maximumParameterValueBytes": 1,
"maximumParameters": 1,
"maximumSqlBytes": 1,
"maximumTotalParameterBytes": 1
},
"projectScoped": true,
"tables": [
{
"columns": [
{
"description": "string",
"json": {},
"name": "string",
"type": "string"
}
],
"currentState": "string",
"description": "string",
"name": "message_events"
}
],
"version": "2026-01-01"
}Parameters
API schema date. Defaults to the latest served version; resolves to the latest served date on or before this value.
Returns
200 The Project-scoped SQL surface of the resolved contracts date. GetMessageMetricsSqlSchemaResponse