Set Metric Range
PUT
/users/{user_id}/summary-card/metrics/{slug}
const url = 'https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/summary-card/metrics/example';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"high":1,"low":1,"mode":"learned","promote":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/summary-card/metrics/example \ --header 'Content-Type: application/json' \ --data '{ "high": 1, "low": 1, "mode": "learned", "promote": true }'Set one metric’s normal range (learned vs manual bounds) + promote toggle.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”user_id
required
User Id
string format: uuid
slug
required
Slug
string
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
SummaryMetricRead
One metric as the “Today so far” card needs it — everything but the live value, which the
frontend already has from the /today fetch (read from value_field, or metrics[slug] when
that’s null).
object
baseline_ready
required
Baseline Ready
boolean
label
required
Label
string
mode
required
Mode
string
promote
required
Promote
boolean
sample_days
required
Sample Days
integer
slug
required
Slug
string
source
required
Source
string
unit
required
Unit
string
Examplegenerated
{ "baseline_ready": true, "high": 1, "label": "example", "learned_high": 1, "learned_low": 1, "low": 1, "manual_high": 1, "manual_low": 1, "mode": "example", "position": 1, "promote": true, "sample_days": 1, "slug": "example", "source": "example", "unit": "example", "value_field": "example"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}