Get Goals
const url = 'https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/goals';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/goalsThe user’s daily goals + the remaining goalable candidates. Live actuals are NOT here — the card reads them from the day summary it already has. RLS-scoped.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”Successful Response
The user’s goals config: the metrics they’ve set a goal on + the remaining candidates.
object
One goalable metric as the goals UI needs it. When target is None the metric has no goal
yet (a candidate the editor can offer); otherwise it’s the user’s active/paused goal. The live
actual is read on the client from the day summary (value_field, or metrics[slug] when
that’s null) — never here.
One goalable metric as the goals UI needs it. When target is None the metric has no goal
yet (a candidate the editor can offer); otherwise it’s the user’s active/paused goal. The live
actual is read on the client from the day summary (value_field, or metrics[slug] when
that’s null) — never here.
Examplegenerated
{ "around_tolerance": 1, "available": [ { "active": true, "category": "example", "direction": "example", "is_set": true, "label": "example", "slug": "example", "target": 1, "unit": "example", "value_field": "example" } ], "goals": [ { "active": true, "category": "example", "direction": "example", "is_set": true, "label": "example", "slug": "example", "target": 1, "unit": "example", "value_field": "example" } ]}Validation Error
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}