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) NEW — thresholds: an ordered severity-tiered set (empty array clears it); (b) LEGACY — threshold_cents: the single scalar. thresholds takes precedence when present; either write resets per-threshold and legacy dedup state.

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

New multi-threshold set. 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[]

Present on the multi-threshold write path: the normalized, stored threshold set.