Skip to content

Get Goals

GET
/users/{user_id}/goals
curl --request GET \
--url https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/goals

The 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.

user_id
required
User Id
string format: uuid

Successful Response

Media typeapplication/json
GoalsConfigRead

The user’s goals config: the metrics they’ve set a goal on + the remaining candidates.

object
around_tolerance
required
Around Tolerance
number
available
required
Available
Array<object>
GoalMetricRead

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.

object
active
required
Active
boolean
category
required
Category
string
direction
required
Direction
string
is_set
required
Is Set
boolean
label
required
Label
string
slug
required
Slug
string
target
required
Any of:
number
unit
required
Unit
string
value_field
required
Any of:
string
goals
required
Goals
Array<object>
GoalMetricRead

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.

object
active
required
Active
boolean
category
required
Category
string
direction
required
Direction
string
is_set
required
Is Set
boolean
label
required
Label
string
slug
required
Slug
string
target
required
Any of:
number
unit
required
Unit
string
value_field
required
Any of:
string
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

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}