Skip to main content
PUT
Set budget alert threshold

Authorizations

Authorization
string
header
required

Supabase JWT token in Authorization: Bearer header

Body

application/json

Two accepted shapes: (a) LEGACY/ACTIVE — threshold_cents: the single scalar low-balance alert, the only shape still honored (fired by the mu-notifications cron); (b) DEPRECATED — thresholds: the ordered severity-tiered multi-threshold set, accepted for contract stability but no longer honored (its emitter was retired with the legacy plan model; the response carries multi_threshold_deprecated: true). thresholds still takes precedence when present; either write resets per-threshold and legacy dedup state.

threshold_cents
integer | null
Required range: x >= 0
thresholds
object[]
deprecated

DEPRECATED, DECLARED-BUT-NOT-HONORED (MNE-8422, BG-8). Accepted and persisted for contract stability, but nothing fires these levels anymore — the usage-alerts cron that fired them against PLAN overage cost was retired with the legacy plan model. The response carries multi_threshold_deprecated: true. Use the scalar threshold_cents low-balance alert instead. Each entry accepts level (warning|urgent|depleted, must be unique and rise in severity with value), value (non-negative number), an optional unit (cents, default, or mu — 1 µ = 1¢, exact conversion), and an optional message (<=500 chars). An empty array clears the configured set.

Maximum array length: 5

Response

Budget alert updated

updated
boolean
required
threshold_cents
integer | null

On the multi-threshold write path this mirrors the lowest configured thresholds[].value_cents (null if the set was cleared); on the legacy write path this echoes the submitted scalar.

thresholds
object[]
deprecated

Present on the (deprecated) multi-threshold write path: the normalized, persisted set. DECLARED-BUT-NOT-HONORED (MNE-8422, BG-8) — see multi_threshold_deprecated.

multi_threshold_deprecated
boolean

Present and true on the multi-threshold write path (MNE-8422, BG-8): the set was accepted and persisted for contract stability but is no longer honored — nothing fires these levels. The scalar threshold_cents low-balance alert remains active.