iSleep Labs
PlatformHardwareAppsDevelopersBlogRead the docsAsk iSleep简体中文

DOCUMENTATION

Five-minute API Quickstart

Query the latest authorized sleep report from a Self-Hosted or managed iSleep endpoint.

01

Set the endpoint and token

Use a user token or delegated backend token with reports:read. Never embed a service credential in an app.

export ISLEEP_ENDPOINT=https://sleep.example.com
export ISLEEP_TOKEN=replace-with-a-short-lived-token
02

Choose an authorized member

List members available to this identity.

curl -H "Authorization: Bearer $ISLEEP_TOKEN" \
  "$ISLEEP_ENDPOINT/api/v1/members"
03

Read the latest report

Use the opaque member ID returned by the API.

curl -H "Authorization: Bearer $ISLEEP_TOKEN" \
  "$ISLEEP_ENDPOINT/api/v1/members/$MEMBER_ID/sleep-reports/latest"
Still have a question?Ask iSleep
Ask iSleep