Sleep Debt Recovery API¶
Estimate accumulated sleep debt across a 7-day window and return a recovery forecast for training and wellness workflows.
Endpoint¶
GET /api/v1/fitness/sleep-debt-recoveryPOST /api/v1/fitness/sleep-debt-recovery/post
Parameters¶
| Name | Type | Required | In | Description |
|---|---|---|---|---|
actual_sleep_hours_7d | string | Yes | Query/Body | Comma-separated list of exactly 7 sleep-hour values. |
baseline_sleep_need | number (4-12) | Yes | Query/Body | Daily baseline sleep need in hours. |
lang | string | No | Query | Response language (en,fr,es,de,pt,ja,hi,ar,bn,gu,id,it,ko,mr,nl,pa,pl,ro,ru,ta,te,th,tr,ur,vi,zh). |
Request Example¶
curl -X GET "https://api.hefitapi.com/api/v1/fitness/sleep-debt-recovery?actual_sleep_hours_7d=6.5,7,5.5,6,8,6,7&baseline_sleep_need=8&lang=en" \
-H "X-API-Key: YOUR_API_KEY"
curl -X POST "https://api.hefitapi.com/api/v1/fitness/sleep-debt-recovery/post?lang=en" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"actual_sleep_hours_7d":"6.5,7,5.5,6,8,6,7","baseline_sleep_need":8}'
Response Example¶
Info
The response example below is for demonstration purposes only. Make a live request to this endpoint to receive the full, real-time, and potentially richer JSON structure.
{
"actual_sleep_hours": [6.5, 7.0, 5.5, 6.0, 8.0, 6.0, 7.0],
"baseline_sleep_need": 8.0,
"sleep_debt": 10.0,
"recovery_days_estimate": 5.0,
"debt_level": "moderate",
"debt_level_label": "Moderate sleep debt",
"summary": "Moderate sleep debt detected. Sleep efficiency and recovery capability may be slightly impaired.",
"recommendations": [
"Consider a rest day or light technical session.",
"Implement a pre-sleep wind-down routine (no screens 45 minutes before bed)."
],
"language": "en",
"_api_metadata_": {"endpoint_name": "sleep_debt_recovery", "response_language": "en"}
}
Localization¶
This endpoint reads health_fitness_sleep_debt_recovery.json from the supported language catalogs.
Recommended Endpoints¶
GET /api/v1/fitness/recovery-score- Recovery Score APIGET /api/v1/fitness/sleep-optimizer- Sleep Optimizer APIGET /api/v1/fitness/deload-plan- Deload Plan API