metrics
4 operations. Shapes are sketches of the declared schemas, bounded in depth — the authoritative document is linked from the index.
GET/orgs/{orgSlug}/projects/{projectSlug}/metrics/catalogue
Requires bearerAuth
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1 |
projectSlugrequired | path | string | min length 1 |
q | query | string | min length 1, max length 200 |
kind | query | "gauge" | "sum" | "histogram" | "exponential_histogram" | "summary" | one of "gauge" | "sum" | "histogram" | "exponential_histogram" | "summary" |
origin | query | "sdk" | "otlp" | "derived" | "semconv" | "declared" | one of "sdk" | "otlp" | "derived" | "semconv" | "declared" |
unit | query | string | min length 1, max length 40 |
owner | query | string | min length 1, max length 64 |
source | query | "derived" | one of "derived" |
orphan | query | "true" | "false" | one of "true" | "false" |
unqueried | query | "true" | "false" | one of "true" | "false" |
hasCodeRef | query | "true" | "false" | one of "true" | "false" |
limit | query | integer | default 20, min 1, max 50 |
Response 200
{
entries: {
name: string
kind: string
temporality: string | null
unit: string | null
unitDeclared: string | null
unitOverride: string | null
conventionUnit: string | null
unitDiffers: boolean
description: string | null
descriptionDraft: {
text: string
label: "model_drafted"
} | null
ownerTeamId: string | null
origin: string
semconvRef: string | null
aliases: string[]
firstSeenAt: string
lastSeenAt: string
seriesNow: integer
seriesMax7d: integer
pointsPerDay: number
attributeKeys: {
key: string
distinct: integer
}[]
readers: {
rules: object
widgets: object
savedQueries: object
total: integer
reads30d: object
}
lastQueriedAt: string | null
codeRef: {
repo: string
path: string
line: integer
commit: string
} | null
orphan: boolean
… 2 more
}[]
matched: integer
candidatesTruncated: boolean
facets: {
total: integer
kind: Record<string, integer>
origin: Record<string, integer>
orphan: integer
unqueried: integer
}
trust: {
untrustedFields: string[]
note: string
}
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl https://api.bucker.io/orgs/{orgSlug}/projects/{projectSlug}/metrics/catalogue \
-H "authorization: Bearer $BUCKER_TOKEN"GET/orgs/{orgSlug}/projects/{projectSlug}/metrics/catalogue/entry
Requires bearerAuth
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1 |
projectSlugrequired | path | string | min length 1 |
namerequired | query | string | min length 1, max length 256 |
include | query | string |
Response 200
{
entry: {
name: string
kind: string
temporality: string | null
unit: string | null
unitDeclared: string | null
unitOverride: string | null
conventionUnit: string | null
unitDiffers: boolean
description: string | null
descriptionDraft: {
text: string
label: "model_drafted"
} | null
ownerTeamId: string | null
origin: string
semconvRef: string | null
aliases: string[]
firstSeenAt: string
lastSeenAt: string
seriesNow: integer
seriesMax7d: integer
pointsPerDay: number
attributeKeys: {
key: string
distinct: integer
}[]
readers: {
rules: object
widgets: object
savedQueries: object
total: integer
reads30d: object
}
lastQueriedAt: string | null
codeRef: {
repo: string
path: string
line: integer
commit: string
} | null
orphan: boolean
… 2 more
}
latest: {
at: string
value: number | null
monotonic: boolean | null
environment: string
service: string | null
} | null
exemplarTraceIds: string[]
handles: {
dataset: "metrics"
fn: string
field: string
filters: {
key: string
op: "eq"
value: string
}[]
basis: string
}[]
change: {
status: "not_available"
reason: string
}
window: {
tier: "raw"
from: string
to: string
}
cardinality: Record<string, unknown> | null
trust: {
untrustedFields: string[]
note: string
}
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl https://api.bucker.io/orgs/{orgSlug}/projects/{projectSlug}/metrics/catalogue/entry \
-H "authorization: Bearer $BUCKER_TOKEN"PUT/orgs/{orgSlug}/projects/{projectSlug}/metrics/metadata
Requires bearerAuth
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1 |
projectSlugrequired | path | string | min length 1 |
Request body (required) · application/json
{
hypothesis?: {
primary: {
signal: string
direction: "up" | "down"
minEffect: number
windowMinutes: integer
}
guardrails?: string[]
probability?: number
}
metric: string
description?: string | null
unit?: string | null
owner?: string | null
acceptDraft?: true
reason: string
approvalRequestId?: string
}Response 200
{
status: "applied" | "input_required" | "inert_draft"
action: string
operationId: string | null
planDigest: string | null
riskClass: string | null
approvalRequestId: string | null
decisionPath: string | null
versionAfter: string | null
plan: Record<string, unknown> | null
trust: {
untrustedFields: string[]
note: string
}
}Response 202
{
status: "applied" | "input_required" | "inert_draft"
action: string
operationId: string | null
planDigest: string | null
riskClass: string | null
approvalRequestId: string | null
decisionPath: string | null
versionAfter: string | null
plan: Record<string, unknown> | null
trust: {
untrustedFields: string[]
note: string
}
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl -X PUT https://api.bucker.io/orgs/{orgSlug}/projects/{projectSlug}/metrics/metadata \
-H "authorization: Bearer $BUCKER_TOKEN" \
-H 'content-type: application/json' \
-d '{ … }'POST/orgs/{orgSlug}/projects/{projectSlug}/metrics/query
Requires bearerAuth
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1 |
projectSlugrequired | path | string | min length 1 |
Request body (required) · application/json
{
spec: unknown
maxScanRows?: integer
cache?: boolean
}Response 200
{
specVersion: integer
status: "ok" | "estimate_only" | "budget_paused"
spec: Record<string, unknown>
digest: string
resolvedRange: {
from: string
to: string
relative: boolean
}
intervalSeconds: number | null
tier: {
tier: "raw" | "rollup_5m" | "rollup_1h"
grainSeconds: number
reason: string
watermark: string | null
coverageFrom: string | null
coveredTo: string
complete: boolean
fallback: string | null
intervalSnappedSeconds: number | null
}
queryTiers: Record<string, {
tier: "raw" | "rollup_5m" | "rollup_1h"
grainSeconds: number
reason: string
watermark: string | null
coverageFrom: string | null
coveredTo: string
complete: boolean
fallback: string | null
intervalSnappedSeconds: number | null
}>
price: {
scanCost: "low" | "medium" | "high"
estimatedRows: integer | null
estimateBasis: string
maxScanRows: integer | null
withinCeiling: boolean
reason: string | null
}
buckets: string[]
series: {
ref: string
group: string | null
other: boolean
shifted: boolean
values: number | null[]
total: number | null
}[]
omittedGroups: integer
statements: {
query: string
shifted: boolean
engine: "printer" | "metric_builder"
sql: string
params: string[]
}[]
scanned: integer
truncated: boolean
capThatBit: {
kind: "scan_rows" | "group_limit"
limit: integer
} | null
sampling: {
basis: "exact" | "sampled" | "not_reported"
minRate: number | null
}
warnings: {
code: string
message: string
}[]
oldestAvailable: string | null
cache: {
hit: boolean
key: string | null
ttlSeconds: integer
computedAt: string | null
}
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl -X POST https://api.bucker.io/orgs/{orgSlug}/projects/{projectSlug}/metrics/query \
-H "authorization: Bearer $BUCKER_TOKEN" \
-H 'content-type: application/json' \
-d '{ … }'