Skip to main content
PATCH
/
users
/
{user_id}
/
facts
/
{fact_id}
Update fact (PATCH)
curl --request PATCH \
  --url https://production.api.onvy.health/users/{user_id}/facts/{fact_id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "text": "<string>",
  "type": "mind",
  "source": "survey"
}
'
{
  "text": "<string>",
  "type": "mind",
  "user_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "source": "survey",
  "id": "<string>",
  "certainty_on_creation": 0.5,
  "certainty_on_update": 0.5
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Path Parameters

user_id
string
required

User ID (e.g., google_104940819145861640201)

fact_id
string
required

Fact ID

Body

application/json

Partial fact data

text
string
required

Fact text content

Required string length: 1 - 1000
type
enum<string>
required

Fact category

Available options:
mind,
body,
activity,
nutrition,
sleep,
recovery,
goal
source
enum<string>

Source of the fact

Available options:
survey,
user_input,
coach,
integration

Response

Fact updated successfully

text
string
required

Fact text content

Required string length: 1 - 1000
type
enum<string>
required

Fact category

Available options:
mind,
body,
activity,
nutrition,
sleep,
recovery,
goal
user_id
string
required

User ID

created_at
string<date-time>
required
updated_at
string<date-time>
required
source
enum<string>

Source of the fact

Available options:
survey,
user_input,
coach,
integration
id
string

Unique fact identifier

certainty_on_creation
number

Initial certainty score when the fact was created.

Required range: 0 <= x <= 1
certainty_on_update
number | null

Most recent certainty score set during an update operation.

Required range: 0 <= x <= 1