Skip to main content
POST
/
users
/
{user_id}
/
facts
Create fact
curl --request POST \
  --url https://production.api.onvy.health/users/{user_id}/facts \
  --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)

Body

application/json

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 created 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