---
title: "Set the night's sleep (day = wake-up date); replaces earlier values"
method: PUT
path: "/days/{day}/sleep"
tags: ["records"]
---

# Set the night's sleep (day = wake-up date); replaces earlier values

`PUT /days/{day}/sleep`

## Request

- Base URL: `https://nutri.coghorizon.com/api/v1`
- URL: `https://nutri.coghorizon.com/api/v1/days/{day}/sleep`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://nutri.coghorizon.com/oauth/authorize`, token URL `https://nutri.coghorizon.com/oauth/token`, scopes: `records:write`)

## Path parameters

- `day` string, required

## Query parameters

- `profile_id` string

## Request body

- SleepInput
  - `bedtime` string: HH:MM, 24 h
  - `wake_time` string: HH:MM, 24 h
  - `in_bed_minutes` integer
  - `asleep_minutes` integer
  - `deep_minutes` integer
  - `rem_minutes` integer
  - `light_minutes` integer
  - `awake_minutes` integer
  - `score` integer: Sleep score as the tracker shows it
  - `efficiency_pct` number
  - `avg_hr` integer
  - `hrv_ms` number
  - `source_app` string
  - `confidence` number

## Response `200`

Sleep

- object

## Other responses

- `400`: Validation failed
- `401`: Missing or invalid token
- `403`: Token lacks the scope
- `404`: Not found
- `429`: Rate limited

---

[API](https://skmtc.dev/coghorizon/apis/top-nutritionist-api.md) · [All operations](https://skmtc.dev/coghorizon/apis/top-nutritionist-api/llms.txt) · [OpenAPI document](https://skmtc.dev/coghorizon/apis/top-nutritionist-api/revisions/928f04d72f8c?raw)
