You can update user information.
PUT
https://api.asleep.ai/ai/v1/users/{user_id}
Field | Type | Required | Description |
---|
x-api-key | String | O | API Key |
Field | Type | Required | Description |
---|
metadata | Metadata Object or null | O | user metadata |
Field | Type | Required | Description |
---|
birth_year | Int? | X | birth year (1900 to the current year) |
birth_month | Int? | X | birth month (1 ~ 12 ) |
birth_day | Int? | X | birth day (1 ~ 31 , actual effective range varies by month/leap year) |
gender | String (male , female , non_binary , other , prefer_not_to_say )? | X | gender |
height | Float? | X | height (0 ~ 300 cm, allow up to one decimal place) |
weight | Float? | X | weight (0 ~ 1000 kg, allow up to one decimal place) |
curl "https://api.asleep.ai/ai/v1/users/<USER_ID>" -X PUT \
-H "x-api-key: <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"birth_year": 2001,
"birth_month": 1,
"birth_day": 1,
"gender": "male",
"height": 178.6,
"weight": 62.1
}
}'
Field | Type | Description |
---|
user_id | String | user id |
metadata | Metadata Object | user metadata |
Field | Type | Description |
---|
birth_year | Int? | birth year (1900 to the current year) |
birth_month | Int? | birth month (1 ~ 12 ) |
birth_day | Int? | birth day (1 ~ 31 , actual effective range varies by month/leap year) |
gender | String (male , female , non_binary , other , prefer_not_to_say )? | gender |
height | Float? | height (0 ~ 300 cm, allow up to one decimal place) |
weight | Float? | weight (0 ~ 1000 kg, allow up to one decimal place) |
{
"detail": "sucess",
"result": {
"user_id": "<USER_ID>",
"metadata": {
"birth_year": 2001,
"birth_month": 1,
"birth_day": 1,
"gendar": "male",
"height": 178.6,
"weight": 62.1
}
}
}
{
"detail": "user not exist"
}