Skip to content

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>
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",
  },
});
{
  "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

projectIdstringrequired
x-photon-versionstring (date)

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

capabilitiesMessageMetricsSqlCapabilitiesrequired
dialectstringrequired
limitsMessageMetricsSqlLimitsrequired
projectScopedtruerequired
tablesarray of MessageMetricsSqlTablerequired
versionstring (date)required