Docs
HTTP API
Base URL https://wdj534go6k.execute-api.us-east-1.amazonaws.com/agent/v1. Bearer auth. JSON in, JSON out. Dates are calendar days in America/Detroit; weight in lb, calories in kcal, macros in g.
curl -H "Authorization: Bearer $PHYSIQUE_TOKEN" \
"https://wdj534go6k.execute-api.us-east-1.amazonaws.com/agent/v1/discovery"
Routes
| Route | Scope | Notes |
|---|---|---|
GET /discovery | any | Granted scopes, timezone, units, limits, freshness. |
GET /days?from=&to=&limit=&cursor= | fitness:read | limit ≤ 100. Follow cursor until null. |
GET /days/{date} | fitness:read | One day plus computed totals. |
PUT /days/{date} | fitness:write | Body needs requestId and expectedRevision. |
GET /foods | nutrition:read | Saved foods and recipes. |
PUT /foods/{slug} | nutrition:write | Versioned; slug must equal the normalized name. |
GET /export?from=&to=&limit=&cursor= | fitness:read + nutrition:read | limit ≤ 50. Versioned pages of days and foods. |
GET /photos?from=&to=&tag=&association=&search= | photos:metadata | Metadata only. |
GET /photos/{id}/content?thumbnail= | photos:content | Returns a URL that expires in 5 minutes. |
The day record
{
"date": "2026-09-09",
"revision": 7,
"weight": 198.4,
"workout": "barbell overhead press\n155 10\n135 10\n135 10",
"foodItems": [
{ "id": "…", "name": "Egg scramble", "portion": "6 eggs", "quantity": 6, "foodSlug": "egg-scramble",
"macros": { "calories": 613, "protein": 56, "carbs": 11, "fat": 37 },
"estimated": false, "source": "saved", "basis": "serving" }
],
"foodNotes": "handful of almonds",
"prepNotes": "batch: 5 lb chicken thighs, 4 cups rice, 2 jars butter chicken sauce, yield 8 boxes",
"steps": 11546
}
prepNotes is what was cooked in batch that day (ingredients, weights, yield), not food eaten: it is never itemized and never counted in totals.
Saved foods with scales: true carry per-unit macros and a fixed base that does not scale: portion = base + macros × quantity. Nutrients that are absent are unknown, never zero. Items from photos or the web are estimated: true with their source named.
Writes
curl -X PUT -H "Authorization: Bearer $PHYSIQUE_WRITE_TOKEN" -H "content-type: application/json" \
"https://wdj534go6k.execute-api.us-east-1.amazonaws.com/agent/v1/days/2026-09-09" \
-d '{"requestId":"agent-7f3c…","expectedRevision":7,"weight":198.4}'
- expectedRevision must match the live record. A stale value returns
409with the current record; show it to the user and retry with intent, never silently. - requestId is idempotent: replaying the same id returns the original receipt, so a lost response is safe to retry.
- Partial bodies are fine: send only the fields you are changing.
Errors
| Status | Meaning |
|---|---|
| 401 | Missing, expired or revoked credential. |
| 403 | Credential lacks the scope. Create a separate credential; do not look for another way in. |
| 409 | Revision conflict; body contains the live record. |
| 429 | Rate limited (5 requests/s, burst 10). Back off. |
Credentials
Created and revoked in the app under Agent access. Shown once; the server stores a SHA-256. Maximum lifetime one year. Bound to the owner: the API decides whose data a token reads, never the request.