DOCUMENTATION
Five-minute API Quickstart
Query the latest authorized sleep report from a Self-Hosted or managed iSleep endpoint.
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-tokenChoose an authorized member
List members available to this identity.
curl -H "Authorization: Bearer $ISLEEP_TOKEN" \
"$ISLEEP_ENDPOINT/api/v1/members"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