[PUT] Update User

사용자 정보를 업데이트할 수 있습니다.

Request

URL

PUT https://api.asleep.ai/ai/v1/users/{userid}

Header

FieldTypeRequiredDescription
x-api-keyStringOAPI Key

Body

FieldTypeRequiredDescription
metadataMetadata ObjectO사용자 메타 정보

Metadata Object

FieldTypeRequiredDescription
birth_yearIntX출생 연도 (1900 년부터 현재 연도)
birth_monthIntX출생 달 (1 ~ 12 월)
birth_dayIntX출생 일 (1 ~ 31 일, 월/윤년에 따라 실제 유효 범위 상이)
genderString (male, female, non_binary, other, prefer_not_to_say)X성별
heightFloatX키 (0 ~ 300 cm, 소수점 한자리까지 허용)
weightFloatX체중 (0 ~ 1000 kg, 소수점 한자리까지 허용)

Example

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
    }
}'

Response

200 Ok

  • 사용자 업데이트 성공

Body (result field)

FieldTypeDescription
user_idStringuser id
metadataMetadata Object사용자 메타 정보

Metadata Object

FieldTypeDescription
birth_yearInt?출생 연도 (1900 년부터 현재 연도)
birth_monthInt?출생 달 (1 ~ 12 월)
birth_dayInt?출생 일 (1 ~ 31 일, 월/윤년에 따라 실제 유효 범위 상이)
genderString (male, female, non_binary, other, prefer_not_to_say)?성별
heightFloat?키 (0 ~ 300 cm, 소수점 한자리까지 허용)
weightFloat?체중 (0 ~ 1000 kg, 소수점 한자리까지 허용)
{
  "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  
    }
  }
}

404 Not Found

  • 사용자 없음
{
  "detail": "user not exist"
}