---
title: "Log sleep"
method: POST
path: "/api/sleep"
---

# Log sleep

`POST /api/sleep`

## Request

- Base URL: `https://healthpartner.shrynshjn.com`
- URL: `https://healthpartner.shrynshjn.com/api/sleep`
- Auth: none declared

Client must send startTime/endTime with timezone offset.

## Request body

- SleepRequest
  - `startTime` string, date-time, required: ISO with timezone offset.
  - `endTime` string, date-time, required: ISO with timezone offset.
  - `duration` number, required: milliseconds
  - `source` string, required
  - `idempotencyKey` string
  - `media` string[]
  - `naturalText` string

## Response `201`

Created

- SleepResponse
  - `message` string
  - `sleepId` string
  - `createdAt` string, date-time

---

[API](https://skmtc.dev/shrynshjn/apis/health-partner-api.md) · [All operations](https://skmtc.dev/shrynshjn/apis/health-partner-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shrynshjn/apis/health-partner-api/revisions/687e966e4267?raw)
