Branch Statistics

https://{your-workspace-slug}.xata.sh/db/{db_branch_name}/stats/

This endpoint presents a number of statistics on a given database's branch.

Expected Parameters
NameDescriptionInRequiredSchema
db_branch_nameThe DBBranchName matches the pattern `{db_name}:{branch_name}`. pathstring

Branch Stats

GET  https://{your-workspace-slug}.xata.sh/db/{db_branch_name}/stats/

Get branch usage metrics.

Possible Responses
Status CodeDescriptionExample Response/Type Definition
200OK
type GetBranchStats = {
    timestamp: string;
    interval: string;
    resolution: string;
    numberOfRecords?: MetricsDatapoint[];
    writesOverTime?: MetricsDatapoint[];
    readsOverTime?: MetricsDatapoint[];
    readLatency?: MetricsLatency;
    writeLatency?: MetricsLatency;
    warning?: string;
};

type MetricsDatapoint = {
    timestamp: string;
    value: number;
};

type MetricsLatency = {
    p50?: MetricsDatapoint[];
    p90?: MetricsDatapoint[];
};
400Example response
type GetBranchStats = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
404Example response
type GetBranchStats = {
    id?: string;
    message: string;
};
5XXUnexpected Error