> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/faq/help-topics/data-api-sdk/data-model-fields-and-units/hypnogram-single-timestamp-reconstruction.md).

# How do I build sleep stage charts from hypnogram samples?

**Yes, you can build a sleep stage chart from single-timestamp hypnogram samples.** Each sample carries a single start timestamp and forms a continuous series, where the start of each sample is the end of the previous one.

To reconstruct stage intervals (and build an Apple-style sleep stage chart):

{% stepper %}
{% step %}
**Treat consecutive sample timestamps as segment boundaries.**
{% endstep %}

{% step %}
Run the final sleep stage from its start timestamp to the sleep session's metadata `end_time`.
{% endstep %}
{% endstepper %}

The `end_time` marks the end of the whole session and may include trailing awake time, denoted by a final awake hypnogram sample.

For the sleep payload structure, see the [data models reference](https://docs.tryterra.co/reference/health-and-fitness-api/data-models).
