---
title: "Post a new sleep log"
method: POST
path: "/patients/{patient_id}/sleep"
tags: ["sleep"]
---

# Post a new sleep log

`POST /patients/{patient_id}/sleep`

## Path parameters

- `patient_id` integer, required

## Request body

- CreatePatientSleepRequest
  - `note` string, nullable — note that can be added to provide additional description Max 1024 char
  - `sleep_end_date_time` string, required — datetime in format YYYY-MM-DD HH:MM:SS
  - `sleep_start_date_time` string, required — datetime in format YYYY-MM-DD HH:MM:SS
  - `sleep_type` 'inBed' | 'asleepUnspecified' | 'awake' | 'asleepCore' | 'asleepDeep' | 'asleepREM', required
  - `source` string, nullable — source of sleep data
  - `source_id` string, nullable — id of sleep from source

## Response `200`

successful operation

- PatientSleepResponse
  - `id` integer, required
  - `note` string, nullable — note that can be added to provide additional description Max 1024 char
  - `sleep_end_date_time` string, required — datetime in format YYYY-MM-DD HH:MM:SS
  - `sleep_group_start_date_time` string — datetime in format YYYY-MM-DD HH:MM:SS
  - `sleep_start_date_time` string, required — datetime in format YYYY-MM-DD HH:MM:SS
  - `sleep_type` 'inBed' | 'asleepUnspecified' | 'awake' | 'asleepCore' | 'asleepDeep' | 'asleepREM', required
  - `source` string, nullable — source of sleep data
  - `source_id` string, nullable — id of sleep from source

## Other responses

- `404` — patient or sleep entry not found

---

[API](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server.md) · [All operations](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/llms.txt) · [OpenAPI document](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/revisions/750cc0d96a93?raw)
