API Reference
Performance
API endpoints for tracking Core Web Vitals, performance snapshots, and budgets.
performance.list
List performance snapshots with optional filtering.
| Type | Query |
| Auth | Protected |
Input:
{
projectId?: string;
limit?: number;
}performance.latest
Get the latest performance snapshot per URL for a project.
| Type | Query |
| Auth | Protected |
Input:
{
projectId: string;
}performance.history
Get performance history for a specific URL.
| Type | Query |
| Auth | Protected |
Input:
{
projectId: string;
url: string;
limit?: number;
}performance.record
Record a new performance snapshot with Core Web Vitals.
| Type | Mutation |
| Auth | Protected |
Input:
{
projectId: string;
url: string;
fcp?: number; // First Contentful Paint (ms)
lcp?: number; // Largest Contentful Paint (ms)
cls?: number; // Cumulative Layout Shift
tbt?: number; // Total Blocking Time (ms)
si?: number; // Speed Index (ms)
tti?: number; // Time to Interactive (ms)
ttfb?: number; // Time to First Byte (ms)
score: number; // Overall score (0-100)
device?: "mobile" | "desktop";
}Response:
{
snapshot: PerformanceSnapshot;
violations: BudgetViolation[]; // Any budget thresholds exceeded
}performance.stats
Get aggregate performance statistics.
| Type | Query |
| Auth | Protected |
| Input | None |
Response:
{
totalSnapshots: number;
averageScore: number;
urlsTracked: number;
latestScore: number;
}performance.delete
Delete a performance snapshot.
| Type | Mutation |
| Auth | Protected |
Input: { id: string }
Performance budgets
performance.listBudgets
List budgets for a project.
| Type | Query |
| Auth | Protected |
Input: { projectId: string }
performance.listAllBudgets
List all budgets across all projects.
| Type | Query |
| Auth | Protected |
performance.createBudget
Create a performance budget threshold.
| Type | Mutation |
| Auth | Protected |
Input:
{
projectId: string;
name: string;
url?: string;
metric: "fcp" | "lcp" | "cls" | "tbt" | "si" | "tti" | "ttfb" | "score";
threshold: number;
operator?: "lte" | "gte"; // Default: "lte"
}performance.updateBudget
| Type | Mutation |
| Auth | Protected |
Input:
{
id: string;
name?: string;
threshold?: number;
enabled?: boolean;
operator?: "lte" | "gte";
}performance.deleteBudget
| Type | Mutation |
| Auth | Protected |
Input: { id: string }