Documentation

Health

Create measurement

Creates a new health measurement (weight or height)

ProductionStagingUAT
POSThttps://ankiren.com/api/me/health

Request Body

Bắt buộc.

  • type"height" | "weight"Required

    Type of health measurement

  • valuenumberRequired

    Measurement value with validation:

    • Weight: 10-500 kg
    • Height: 50-300 cm
    format: float
  • unitstringRequired

    Unit of measurement (kg, lb for weight; cm, in for height)

  • measuredAtstring<date-time>

    When the measurement was taken (cannot be in future)

    format: date-time
  • notestring

    Optional note

application/json
{
  "type": "weight",
  "value": 70.5,
  "unit": "kg",
  "measuredAt": "2025-12-31T10:30:00Z",
  "note": "After breakfast"
}

Responses

201 · Measurement created

  • measurementHealthMeasurement
    • idintegerRequired

      Measurement ID

    • userIdstringRequired

      User ID (CUID)

    • type"height" | "weight"Required

      Type of health measurement

    • valuenumberRequired

      Measurement value

      format: float
    • unitstringRequired

      Unit of measurement (kg, lb, cm, in)

    • measuredAtstring<date-time>Required

      When the measurement was taken

      format: date-time
    • notestring?

      Optional note

    • createdAtstring<date-time>Required

      Record creation timestamp

      format: date-time
application/json
{
  "measurement": {
    "id": 1,
    "userId": "clxyz123",
    "type": "weight",
    "value": 70.5,
    "unit": "kg",
    "measuredAt": "2025-12-31T10:30:00Z",
    "note": "After breakfast",
    "createdAt": "2025-12-31T10:30:00Z"
  }
}

Sample Code

Đổi ngôn ngữ ở ô Language trên thanh Documentation.

cURL
curl -X POST 'https://ankiren.com/api/me/health' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "weight",
  "value": 70.5,
  "unit": "kg",
  "measuredAt": "2025-12-31T10:30:00Z",
  "note": "After breakfast"
}'