{"openapi":"3.1.0","info":{"title":"DailyGoal API","version":"1.0.0","description":"Read and change a DailyGoal user's fitness data. Needs a paid plan or free trial; not available on Free. The same operations are MCP tools at https://api.dailygoal.fit/v1/mcp. Guides: https://www.dailygoal.fit/developers."},"servers":[{"url":"https://api.dailygoal.fit"}],"security":[{"apiToken":[]}],"paths":{"/v1/me":{"get":{"operationId":"get_context","summary":"Get context","description":"Call this first. Returns today's Activity Day, the user's timezone, preferred units, API limits and paid status, so writes land on the right day in the right units. It returns no logged data; use list_body_metrics, list_food_entries, list_workouts, get_workout or get_daily_goals for that.","x-mcp-tool":"get_context","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"activityDay":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Today's Activity Day in the user's timezone, YYYY-MM-DD. Writes without a date land on this day."},"timezone":{"type":"string","description":"IANA timezone that defines the Activity Day."},"units":{"type":"object","properties":{"bodyWeight":{"type":"string","enum":["kg","lb"]},"strengthLoad":{"type":"string","enum":["kg","lb"]},"distance":{"type":"string","enum":["km","mi"]}},"required":["bodyWeight","strengthLoad","distance"],"additionalProperties":true,"description":"The user's preferred display units."},"paidAccess":{"type":"boolean","description":"Whether the user's subscription or free trial is active."},"limits":{"type":"object","properties":{"reads":{"type":"object","properties":{"perMinute":{"type":"integer","minimum":0},"burst":{"type":"integer","minimum":0}},"required":["perMinute","burst"],"additionalProperties":true},"writes":{"type":"object","properties":{"perMinute":{"type":"integer","minimum":0},"burst":{"type":"integer","minimum":0},"perDay":{"type":"integer","minimum":0}},"required":["perMinute","burst","perDay"],"additionalProperties":true},"bodyMetricBatch":{"type":"integer","minimum":0,"description":"Most readings accepted by one set_body_metrics call."},"goalTemplates":{"type":"integer","minimum":0,"description":"Most goal templates a user can hold."}},"required":["reads","writes","bodyMetricBatch","goalTemplates"],"additionalProperties":true,"description":"Per-user API limits, shared by every credential."}},"required":["activityDay","timezone","units","paidAccess","limits"],"additionalProperties":true}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/body-metrics":{"get":{"operationId":"list_body_metrics","summary":"List body metrics","description":"Lists the user's weight, body fat or steps readings (at most one per day) for a date range of up to 366 days, oldest first, with no paging. Omit `to` for today and `from` for 29 days before `to`, a 30-day range that includes both ends. Values come in canonical units with the user's display unit beside them. This reads measurements only: for meals use list_food_entries, for training use list_workouts, and for goal progress use get_daily_goals.","x-mcp-tool":"list_body_metrics","parameters":[{"name":"metric","in":"query","required":true,"schema":{"type":"string","enum":["weight","body_fat","steps"],"description":"`weight` (kg or lb), `body_fat` (percent) or `steps` (whole steps)."}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`, so the default range covers 30 days including both ends."}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Last day, YYYY-MM-DD. Defaults to today's Activity Day."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"metric":{"type":"string","enum":["weight","body_fat","steps"],"description":"`weight` (kg or lb), `body_fat` (percent) or `steps` (whole steps)."},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string","description":"IANA timezone that defines the user's Activity Day."},"readings":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"value":{"type":"number","description":"Canonical value: kilograms, percent or steps."},"unit":{"type":"string","enum":["kg","percent","steps"]},"display":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["kg","lb","percent","steps"]}},"required":["value","unit"],"additionalProperties":true,"description":"The same reading in the user's preferred unit."}},"required":["date","value","unit","display"],"additionalProperties":true},"description":"One reading per day that has one, oldest first. There is no cursor: the range is complete."}},"required":["metric","from","to","timezone","readings"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"put":{"operationId":"set_body_metrics","summary":"Set body metrics","description":"Records weight, body fat or steps readings: one metric per call, up to 100 days per call, for example to backfill history. Each reading replaces the day's existing value for that metric. Weight needs `unit` `kg` or `lb`. Omit `date` for today's Activity Day; the response echoes each resolved date and the timezone. Updates the user's latest weight or body fat, steps goals, streak and badges as the app does. To remove a reading use delete_body_metric; to log meals use log_food_entry.","x-mcp-tool":"set_body_metrics","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"metric":{"type":"string","enum":["weight","body_fat","steps"],"description":"`weight` (kg or lb), `body_fat` (percent) or `steps` (whole steps)."},"readings":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD in the user's timezone. Defaults to today's Activity Day. Future dates are rejected."},"value":{"type":"number","description":"Weight 20-500 kg (or the same in lb), body fat 2-80 percent, or steps 0-100,000."},"unit":{"type":"string","enum":["kg","lb","percent","steps"],"description":"Required for weight: `kg` or `lb`. Optional for body fat (`percent`) and steps (`steps`)."}},"required":["value"],"additionalProperties":true},"minItems":1,"maxItems":100,"description":"1 to 100 readings. A later reading for the same day wins."}},"required":["metric","readings"],"additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"metric":{"type":"string","enum":["weight","body_fat","steps"],"description":"`weight` (kg or lb), `body_fat` (percent) or `steps` (whole steps)."},"timezone":{"type":"string","description":"IANA timezone that defines the user's Activity Day."},"readings":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"value":{"type":"number","description":"Canonical value: kilograms, percent or steps."},"unit":{"type":"string","enum":["kg","percent","steps"]},"display":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["kg","lb","percent","steps"]}},"required":["value","unit"],"additionalProperties":true,"description":"The same reading in the user's preferred unit."},"changed":{"type":"boolean","description":"False when the day already held this value."}},"required":["date","value","unit","display","changed"],"additionalProperties":true},"description":"Each stored reading with its resolved date."}},"required":["metric","timezone","readings"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"delete":{"operationId":"delete_body_metric","summary":"Delete body metric","description":"Deletes one day's weight, body fat or steps reading. Omit `date` for today's Activity Day. Returns not_found when that day has no reading. To change a value instead of removing it, use set_body_metrics.","x-mcp-tool":"delete_body_metric","parameters":[{"name":"metric","in":"query","required":true,"schema":{"type":"string","enum":["weight","body_fat","steps"],"description":"`weight` (kg or lb), `body_fat` (percent) or `steps` (whole steps)."}},{"name":"date","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD in the user's timezone. Defaults to today's Activity Day."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"metric":{"type":"string","enum":["weight","body_fat","steps"],"description":"`weight` (kg or lb), `body_fat` (percent) or `steps` (whole steps)."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string","description":"IANA timezone that defines the user's Activity Day."},"deleted":{"type":"boolean","enum":[true]}},"required":["metric","date","timezone","deleted"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/foods":{"get":{"operationId":"search_foods","summary":"Search foods","description":"Search the DailyGoal food catalogue, the user's custom foods and their saved meals, optionally filtered by kind. Returns the ids and per-serving nutrition that log_food_entry needs. It does not return what the user ate; use list_food_entries for that.","x-mcp-tool":"search_foods","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","maxLength":100,"description":"Food name, optionally with a brand. Required unless kind is custom_food or saved_meal, which then lists the user's own items."}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["food","custom_food","saved_meal"],"description":"food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry."}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"description":"Most results to return. Default 20."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"foods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["food","custom_food","saved_meal"],"description":"food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry."},"name":{"type":"string"},"brandName":{"type":"string"},"serving":{"type":"object","properties":{"size":{"type":"number"},"unit":{"type":"string"},"text":{"type":"string"}},"required":["size","unit"],"additionalProperties":true},"perServing":{"type":"object","properties":{"calories":{"type":"number","description":"kcal"},"protein":{"type":"number","description":"grams"},"carbs":{"type":"number","description":"grams"},"fat":{"type":"number","description":"grams"},"alcohol":{"type":"number","description":"grams"}},"required":["calories","protein","carbs","fat","alcohol"],"additionalProperties":true},"per100g":{"type":"object","properties":{"calories":{"type":"number","description":"kcal"},"protein":{"type":"number","description":"grams"},"carbs":{"type":"number","description":"grams"},"fat":{"type":"number","description":"grams"},"alcohol":{"type":"number","description":"grams"}},"required":["calories","protein","carbs","fat","alcohol"],"additionalProperties":true}},"required":["id","kind","name","serving","perServing","per100g"],"additionalProperties":true}}},"required":["foods"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/food-entries":{"get":{"operationId":"list_food_entries","summary":"List food entries","description":"List the food entries the user logged between two Activity Days, oldest first, in pages. To find a food to log, use search_foods instead.","x-mcp-tool":"list_food_entries","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"First Activity Day, YYYY-MM-DD. Defaults to today."}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Last Activity Day, YYYY-MM-DD, inclusive. Defaults to today."}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Most entries per page. Default 50."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","description":"nextCursor from the previous page. Only valid with the same from and to."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mealType":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"servings":{"type":"number"},"food":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["food","custom_food","saved_meal"],"description":"food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry."},"name":{"type":"string"},"brandName":{"type":"string"}},"required":["id","kind","name"],"additionalProperties":true},"nutrition":{"type":"object","properties":{"calories":{"type":"number","description":"kcal"},"protein":{"type":"number","description":"grams"},"carbs":{"type":"number","description":"grams"},"fat":{"type":"number","description":"grams"},"alcohol":{"type":"number","description":"grams"}},"required":["calories","protein","carbs","fat","alcohol"],"additionalProperties":true,"description":"Totals for this entry's servings."}},"required":["id","date","mealType","servings","food","nutrition"],"additionalProperties":true}},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string","description":"IANA timezone that defines the Activity Day."},"hasMore":{"type":"boolean","description":"True when more entries exist in the window. Pass nextCursor to get them."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["entries","from","to","timezone","hasMore","nextCursor"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"post":{"operationId":"log_food_entry","summary":"Log food entry","description":"Log what the user ate as a new food entry. Pass exactly one of foodId, customFoodId or savedMealId, using an id from search_foods. It always creates a separate entry; to change an existing entry use update_food_entry. To add a food the catalogue lacks, use save_custom_food first.","x-mcp-tool":"log_food_entry","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Retry-safe create: a repeated key with the same body within 24 hours returns the first response.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"foodId":{"type":"string","minLength":1,"maxLength":128,"description":"A catalogue food id (kind food) from search_foods."},"customFoodId":{"type":"string","minLength":1,"maxLength":128,"description":"One of the user's custom food ids (kind custom_food) from search_foods."},"savedMealId":{"type":"string","minLength":1,"maxLength":128,"description":"One of the user's saved meal ids (kind saved_meal) from search_foods."},"servings":{"type":"number","exclusiveMinimum":0,"description":"Number of servings. One serving is the food's serving.size in serving.unit."},"mealType":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Activity Day, YYYY-MM-DD. Defaults to today in the user's timezone."}},"required":["servings","mealType"],"additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mealType":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"servings":{"type":"number"},"food":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["food","custom_food","saved_meal"],"description":"food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry."},"name":{"type":"string"},"brandName":{"type":"string"}},"required":["id","kind","name"],"additionalProperties":true},"nutrition":{"type":"object","properties":{"calories":{"type":"number","description":"kcal"},"protein":{"type":"number","description":"grams"},"carbs":{"type":"number","description":"grams"},"fat":{"type":"number","description":"grams"},"alcohol":{"type":"number","description":"grams"}},"required":["calories","protein","carbs","fat","alcohol"],"additionalProperties":true,"description":"Totals for this entry's servings."}},"required":["id","date","mealType","servings","food","nutrition"],"additionalProperties":true},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The Activity Day the entry is on."},"timezone":{"type":"string","description":"IANA timezone that defines the Activity Day."}},"required":["entry","date","timezone"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"409":{"description":"`idempotency_conflict`: this Idempotency-Key was already used with a different body.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["idempotency_conflict"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"patch":{"operationId":"update_food_entry","summary":"Update food entry","description":"Change the servings, meal type or date of one existing food entry. Omitted fields keep their value. To record something newly eaten, use log_food_entry instead.","x-mcp-tool":"update_food_entry","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"description":"Food entry id from list_food_entries or log_food_entry."},"servings":{"type":"number","exclusiveMinimum":0,"description":"Number of servings. One serving is the food's serving.size in serving.unit."},"mealType":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Move the entry to this Activity Day, YYYY-MM-DD."}},"required":["id"],"additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mealType":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"servings":{"type":"number"},"food":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["food","custom_food","saved_meal"],"description":"food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry."},"name":{"type":"string"},"brandName":{"type":"string"}},"required":["id","kind","name"],"additionalProperties":true},"nutrition":{"type":"object","properties":{"calories":{"type":"number","description":"kcal"},"protein":{"type":"number","description":"grams"},"carbs":{"type":"number","description":"grams"},"fat":{"type":"number","description":"grams"},"alcohol":{"type":"number","description":"grams"}},"required":["calories","protein","carbs","fat","alcohol"],"additionalProperties":true,"description":"Totals for this entry's servings."}},"required":["id","date","mealType","servings","food","nutrition"],"additionalProperties":true},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The Activity Day the entry is on."},"timezone":{"type":"string","description":"IANA timezone that defines the Activity Day."}},"required":["entry","date","timezone"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"delete":{"operationId":"delete_food_entry","summary":"Delete food entry","description":"Delete one logged food entry by id. It leaves the food itself alone; to delete a custom food, use delete_custom_food.","x-mcp-tool":"delete_food_entry","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Food entry id from list_food_entries or log_food_entry."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string","description":"IANA timezone that defines the Activity Day."}},"required":["id","date","timezone"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/custom-foods":{"post":{"operationId":"save_custom_food","summary":"Save custom food","description":"Create a custom food, or update one by passing its id. Replaces every field, with macros in grams per 100 g (or 100 ml) and one serving's size. Use it for foods search_foods cannot find. It records nothing eaten: call log_food_entry with the returned id to log the food.","x-mcp-tool":"save_custom_food","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Retry-safe create: a repeated key with the same body within 24 hours returns the first response.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The custom food to update, from a previous save_custom_food or search_foods. Omit it to create a new custom food."},"name":{"type":"string","pattern":"\\S","description":"Food name, for example 'Greek yoghurt 2%'."},"brandName":{"type":"string","description":"Brand, if any. Blank or omitted means no brand."},"protein":{"type":"number","minimum":0,"description":"Protein in grams per 100 g, or per 100 ml when servingSizeUnit is ml."},"carbs":{"type":"number","minimum":0,"description":"Carbohydrate in grams per 100 g or 100 ml."},"fat":{"type":"number","minimum":0,"description":"Fat in grams per 100 g or 100 ml."},"alcohol":{"type":"number","minimum":0,"description":"Alcohol in grams per 100 g or 100 ml. Defaults to 0."},"servingSize":{"type":"number","exclusiveMinimum":0,"description":"Size of one serving, in servingSizeUnit, for example 150."},"servingSizeUnit":{"type":"string","enum":["g","ml"],"description":"Unit of servingSize and of the per-100 macro values."},"servingSizeText":{"type":"string","description":"Label for one serving, for example '1 pot'. Blank or omitted means '1 serving'."}},"required":["name","protein","carbs","fat","servingSize","servingSizeUnit"],"additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean","description":"True when this call created the custom food, false when it updated one."},"customFood":{"type":"object","properties":{"id":{"type":"string","description":"Custom food id. Pass it to log_food_entry as the custom food id."},"name":{"type":"string"},"brandName":{"type":"string"},"protein":{"type":"number","description":"Grams per 100 g or 100 ml."},"carbs":{"type":"number","description":"Grams per 100 g or 100 ml."},"fat":{"type":"number","description":"Grams per 100 g or 100 ml."},"alcohol":{"type":"number","description":"Grams per 100 g or 100 ml."},"calories":{"type":"number","description":"Kilocalories per 100 g or 100 ml, calculated from the macros."},"servingSize":{"type":"number"},"servingSizeUnit":{"type":"string","description":"g or ml. Foods created by the in-app assistant can also use count units such as item."},"servingSizeText":{"type":"string"}},"required":["id","name","protein","carbs","fat","alcohol","calories","servingSize","servingSizeUnit","servingSizeText"],"additionalProperties":true}},"required":["created","customFood"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"409":{"description":"`conflict`: the item's current state blocks this change. `hint` says what to do first. `idempotency_conflict`: this Idempotency-Key was already used with a different body. `limit_exceeded`: the user already holds the most items of this kind.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["conflict","idempotency_conflict","limit_exceeded"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"delete":{"operationId":"delete_custom_food","summary":"Delete custom food","description":"Delete one of the user's custom foods from their library. It fails with conflict while diary entries or saved meals still use the food. To remove something the user logged, use delete_food_entry instead.","x-mcp-tool":"delete_custom_food","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"The custom food to delete: an id from search_foods with kind custom_food, or from save_custom_food."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"409":{"description":"`conflict`: the item's current state blocks this change. `hint` says what to do first.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["conflict"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/exercises":{"get":{"operationId":"search_exercises","summary":"Search exercises","description":"Search the exercise catalogue by name or category and return exercise ids to use in log_workout and replace_workout. Give query, category or both. It returns no logged workouts; use list_workouts for those.","x-mcp-tool":"search_exercises","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","pattern":"\\S","description":"Words in the exercise name, for example 'bench press'."}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["strength","cardio","flexibility","bodyweight"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"description":"Defaults to 20."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"exercises":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Exercise id to pass as exerciseId to log_workout or replace_workout."},"name":{"type":"string"},"category":{"type":"string","enum":["strength","cardio","flexibility","bodyweight"]},"trackingType":{"type":"string","description":"What a set records, for example weight_reps, reps, distance_duration, duration or hold."},"muscleGroups":{"type":"array","items":{"type":"string"}},"equipment":{"type":"string"}},"required":["id","name","category","trackingType","muscleGroups"],"additionalProperties":true}}},"required":["exercises"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/workouts":{"get":{"operationId":"list_workouts","summary":"List workouts","description":"List finished workouts as summaries, newest first, with pagination. Omit from and to to list every workout, or give either to bound the date window. Summaries have no sets; use get_workout for one workout's exercises and sets.","x-mcp-tool":"list_workouts","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"First Activity Day to include, YYYY-MM-DD. Omit for no lower bound."}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Last Activity Day to include, YYYY-MM-DD, inclusive. Omit for no upper bound."}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Page size. Defaults to 50."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","description":"nextCursor from the previous page, with the same from and to."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"workouts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Workout id for get_workout, replace_workout and delete_workout."},"name":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Activity Day the workout counts toward, YYYY-MM-DD."},"startTime":{"type":"string","description":"ISO 8601 timestamp."},"endTime":{"type":"string","description":"ISO 8601 timestamp."},"durationSeconds":{"type":"integer","minimum":0},"notes":{"type":"string"},"estimatedCalories":{"type":"number","minimum":0,"description":"Estimated kcal burned. Absent when the user has no known body weight."},"exerciseCount":{"type":"integer","minimum":0}},"required":["id","name","date","exerciseCount"],"additionalProperties":true}},"hasMore":{"type":"boolean","description":"True when more workouts match. Pass nextCursor to get them."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["workouts","hasMore","nextCursor"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"post":{"operationId":"log_workout","summary":"Log workout","description":"Log a workout that is already finished, with its exercises and sets. Get exercise ids from search_exercises. Each call adds a new workout; to correct an existing one use replace_workout.","x-mcp-tool":"log_workout","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Retry-safe create: a repeated key with the same body within 24 hours returns the first response.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"\\S","maxLength":120},"durationSeconds":{"type":"integer","minimum":60,"maximum":43200,"description":"Length of the whole session in seconds. Optional. Record a run's or set's own time on the set's durationSeconds."},"notes":{"type":"string","maxLength":2000},"exercises":{"type":"array","items":{"type":"object","properties":{"exerciseId":{"type":"string","description":"Exercise id from search_exercises. Preferred."},"name":{"type":"string","pattern":"\\S","description":"Exact catalogue name, used when exerciseId is absent."},"sets":{"type":"array","items":{"type":"object","properties":{"setType":{"type":"string","enum":["warmup","working"],"description":"Defaults to working."},"weight":{"type":"object","properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["kg","lb"]}},"required":["value","unit"],"additionalProperties":true,"description":"A load with its unit. Stored as kilograms."},"loadIntent":{"type":"string","enum":["bar_total","per_hand","plates_each_side","assistance","added_bodyweight","machine_stack","custom"],"description":"What the weight means, for example per_hand for dumbbells. Omit for a plain total load."},"reps":{"type":"integer","minimum":0,"maximum":1000},"durationSeconds":{"type":"number","minimum":0,"maximum":21600,"description":"Time this set took, in seconds. For a timed effort such as 5 km in 28 minutes, put 1680 here with distanceMeters 5000."},"distanceMeters":{"type":"number","minimum":0,"maximum":500000},"holdSeconds":{"type":"number","minimum":0,"maximum":3600},"intensity":{"type":"number","minimum":0,"maximum":10,"description":"Effort from 0 to 10."}},"additionalProperties":true},"minItems":1,"maxItems":30}},"required":["sets"],"additionalProperties":true,"description":"One exercise with its sets. Give exerciseId or name; an unknown exercise fails with suggestions."},"minItems":1,"maxItems":30},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Activity Day, YYYY-MM-DD. Defaults to today in the user's timezone."}},"required":["name","exercises"],"additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The Activity Day the workout was saved to."},"timezone":{"type":"string","description":"IANA timezone that defines that Activity Day."},"estimatedCalories":{"type":"number","minimum":0}},"required":["id","date","timezone"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"409":{"description":"`idempotency_conflict`: this Idempotency-Key was already used with a different body.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["idempotency_conflict"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"put":{"operationId":"replace_workout","summary":"Replace workout","description":"Replace a finished workout's name, date, duration, notes and its whole list of exercises and sets in one call. Exercises and sets you leave out are removed, and omitted notes are cleared. To add a new workout use log_workout.","x-mcp-tool":"replace_workout","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Workout id to replace."},"name":{"type":"string","pattern":"\\S","maxLength":120},"durationSeconds":{"type":"integer","minimum":60,"maximum":43200,"description":"Length of the whole session in seconds. Optional. Record a run's or set's own time on the set's durationSeconds."},"notes":{"type":"string","maxLength":2000},"exercises":{"type":"array","items":{"type":"object","properties":{"exerciseId":{"type":"string","description":"Exercise id from search_exercises. Preferred."},"name":{"type":"string","pattern":"\\S","description":"Exact catalogue name, used when exerciseId is absent."},"sets":{"type":"array","items":{"type":"object","properties":{"setType":{"type":"string","enum":["warmup","working"],"description":"Defaults to working."},"weight":{"type":"object","properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["kg","lb"]}},"required":["value","unit"],"additionalProperties":true,"description":"A load with its unit. Stored as kilograms."},"loadIntent":{"type":"string","enum":["bar_total","per_hand","plates_each_side","assistance","added_bodyweight","machine_stack","custom"],"description":"What the weight means, for example per_hand for dumbbells. Omit for a plain total load."},"reps":{"type":"integer","minimum":0,"maximum":1000},"durationSeconds":{"type":"number","minimum":0,"maximum":21600,"description":"Time this set took, in seconds. For a timed effort such as 5 km in 28 minutes, put 1680 here with distanceMeters 5000."},"distanceMeters":{"type":"number","minimum":0,"maximum":500000},"holdSeconds":{"type":"number","minimum":0,"maximum":3600},"intensity":{"type":"number","minimum":0,"maximum":10,"description":"Effort from 0 to 10."}},"additionalProperties":true},"minItems":1,"maxItems":30}},"required":["sets"],"additionalProperties":true,"description":"One exercise with its sets. Give exerciseId or name; an unknown exercise fails with suggestions."},"minItems":1,"maxItems":30},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Activity Day, YYYY-MM-DD. Defaults to the workout's current date."}},"required":["id","name","exercises"],"additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The Activity Day the workout was saved to."},"timezone":{"type":"string","description":"IANA timezone that defines that Activity Day."},"estimatedCalories":{"type":"number","minimum":0}},"required":["id","date","timezone"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"409":{"description":"`conflict`: the item's current state blocks this change. `hint` says what to do first.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["conflict"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"delete":{"operationId":"delete_workout","summary":"Delete workout","description":"Delete a finished workout with all its exercises and sets. This cannot be undone. To correct a workout instead, use replace_workout.","x-mcp-tool":"delete_workout","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Workout id from list_workouts or log_workout."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The Activity Day the workout was on."},"timezone":{"type":"string"}},"required":["id","deleted","date","timezone"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"409":{"description":"`conflict`: the item's current state blocks this change. `hint` says what to do first.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["conflict"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/workouts/detail":{"get":{"operationId":"get_workout","summary":"Get workout","description":"Get one finished workout with every exercise and set. Use list_workouts to browse workouts by date.","x-mcp-tool":"get_workout","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Workout id from list_workouts or log_workout."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Workout id for get_workout, replace_workout and delete_workout."},"name":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Activity Day the workout counts toward, YYYY-MM-DD."},"startTime":{"type":"string","description":"ISO 8601 timestamp."},"endTime":{"type":"string","description":"ISO 8601 timestamp."},"durationSeconds":{"type":"integer","minimum":0},"notes":{"type":"string"},"estimatedCalories":{"type":"number","minimum":0,"description":"Estimated kcal burned. Absent when the user has no known body weight."},"exercises":{"type":"array","items":{"type":"object","properties":{"exerciseId":{"type":"string"},"name":{"type":"string"},"sets":{"type":"array","items":{"type":"object","properties":{"setNumber":{"type":"integer","minimum":0},"setType":{"type":"string","enum":["warmup","working"]},"weight":{"type":"object","properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["kg","lb"]}},"required":["value","unit"],"additionalProperties":true,"description":"Load in the user's preferred strength unit."},"weightKg":{"type":"number","minimum":0,"description":"Canonical load in kilograms."},"reps":{"type":"integer","minimum":0},"durationSeconds":{"type":"number","minimum":0},"distanceMeters":{"type":"number","minimum":0},"holdSeconds":{"type":"number","minimum":0},"intensity":{"type":"number","description":"Effort from 0 to 10."}},"required":["setNumber","setType"],"additionalProperties":true}}},"required":["exerciseId","name","sets"],"additionalProperties":true}}},"required":["id","name","date","exercises"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/goal-templates":{"get":{"operationId":"list_goals","summary":"List goals","description":"Lists every goal template the user tracks, active and inactive, with its target, comparison and schedule. It returns no progress; use get_daily_goals for one day's progress and completion.","x-mcp-tool":"list_goals","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"goals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Goal template id, from list_goals or get_daily_goals."},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["numeric","boolean"],"description":"`numeric` goals have a target number; `boolean` goals are yes/no habits."},"metric":{"anyOf":[{"type":"string","enum":["calories","protein","fat","carbs","alcohol","steps","hydration","custom"],"description":"What a numeric goal measures. Every metric except `custom` is calculated from logged data (food entries, steps, hydration), so its progress cannot be set directly."},{"type":"null"}]},"targetValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"comparison":{"anyOf":[{"type":"string","enum":["min","max","equals"],"description":"`min`: reach at least the target. `max`: stay at or under it. `equals`: hit it exactly."},{"type":"null"}]},"daysOfWeek":{"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"description":"Days the goal is scheduled. An empty list means every day. Only boolean and custom numeric goals can have a schedule."},"active":{"type":"boolean","description":"Inactive goals keep their history but do not appear in daily goals."},"calculated":{"type":"boolean","description":"True when progress is calculated from logged data. set_goal_progress refuses calculated goals."}},"required":["id","name","description","type","metric","targetValue","comparison","daysOfWeek","active","calculated"],"additionalProperties":true}}},"required":["goals"],"additionalProperties":true}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"post":{"operationId":"save_goal","summary":"Save goal","description":"Creates a goal template when called without an id, or updates the named goal with an id, including pausing it with active: false. Only the fields you pass change. A user can hold a limited number of goals (see get_context limits.goalTemplates). To record today's progress on a goal, use set_goal_progress instead.","x-mcp-tool":"save_goal","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Retry-safe create: a repeated key with the same body within 24 hours returns the first response.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Omit to create a goal. Pass a goal template id to update that goal."},"name":{"type":"string","pattern":"^\\S(?:[\\s\\S]*\\S)?$","maxLength":100,"description":"Required when creating."},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Null clears it."},"type":{"type":"string","enum":["numeric","boolean"],"description":"Required when creating."},"metric":{"type":"string","enum":["calories","protein","fat","carbs","alcohol","steps","hydration","custom"],"description":"Numeric goals only. Defaults to `custom` when creating a numeric goal."},"targetValue":{"type":"number","minimum":0,"description":"Numeric goals only. Required when creating a numeric goal."},"comparison":{"type":"string","enum":["min","max","equals"],"description":"Numeric goals only. Defaults to `min` when creating a numeric goal."},"daysOfWeek":{"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"description":"Days the goal is scheduled. An empty list means every day. Only boolean and custom numeric goals can have a schedule."},"active":{"type":"boolean","description":"Defaults to true when creating. Set false to pause a goal without deleting it."}},"additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"goal":{"type":"object","properties":{"id":{"type":"string","description":"Goal template id, from list_goals or get_daily_goals."},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["numeric","boolean"],"description":"`numeric` goals have a target number; `boolean` goals are yes/no habits."},"metric":{"anyOf":[{"type":"string","enum":["calories","protein","fat","carbs","alcohol","steps","hydration","custom"],"description":"What a numeric goal measures. Every metric except `custom` is calculated from logged data (food entries, steps, hydration), so its progress cannot be set directly."},{"type":"null"}]},"targetValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"comparison":{"anyOf":[{"type":"string","enum":["min","max","equals"],"description":"`min`: reach at least the target. `max`: stay at or under it. `equals`: hit it exactly."},{"type":"null"}]},"daysOfWeek":{"type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"description":"Days the goal is scheduled. An empty list means every day. Only boolean and custom numeric goals can have a schedule."},"active":{"type":"boolean","description":"Inactive goals keep their history but do not appear in daily goals."},"calculated":{"type":"boolean","description":"True when progress is calculated from logged data. set_goal_progress refuses calculated goals."}},"required":["id","name","description","type","metric","targetValue","comparison","daysOfWeek","active","calculated"],"additionalProperties":true},"created":{"type":"boolean","description":"True when this call created the goal, false when it updated one."}},"required":["goal","created"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"409":{"description":"`idempotency_conflict`: this Idempotency-Key was already used with a different body. `limit_exceeded`: the user already holds the most items of this kind.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["idempotency_conflict","limit_exceeded"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"delete":{"operationId":"delete_goal","summary":"Delete goal","description":"Permanently deletes a goal template and all its daily progress history. To stop tracking a goal but keep its history, use save_goal with active: false instead.","x-mcp-tool":"delete_goal","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Goal template id, from list_goals or get_daily_goals."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Goal template id, from list_goals or get_daily_goals."},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}},"/v1/daily-goals":{"get":{"operationId":"get_daily_goals","summary":"Get daily goals","description":"Returns the progress and completion of each active goal scheduled on one date, as the app's daily goals screen shows it. To see goal settings, including inactive goals, use list_goals instead.","x-mcp-tool":"get_daily_goals","parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD. Defaults to today's Activity Day."}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"},"goals":{"type":"array","items":{"type":"object","properties":{"goalId":{"type":"string","description":"Goal template id, from list_goals or get_daily_goals."},"name":{"type":"string"},"type":{"type":"string","enum":["numeric","boolean"],"description":"`numeric` goals have a target number; `boolean` goals are yes/no habits."},"metric":{"anyOf":[{"type":"string","enum":["calories","protein","fat","carbs","alcohol","steps","hydration","custom"],"description":"What a numeric goal measures. Every metric except `custom` is calculated from logged data (food entries, steps, hydration), so its progress cannot be set directly."},{"type":"null"}]},"targetValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"comparison":{"anyOf":[{"type":"string","enum":["min","max","equals"],"description":"`min`: reach at least the target. `max`: stay at or under it. `equals`: hit it exactly."},{"type":"null"}]},"currentValue":{"anyOf":[{"type":"number"},{"type":"boolean"}],"description":"A number for numeric goals, true or false for boolean goals."},"completed":{"type":"boolean"},"calculated":{"type":"boolean","description":"True when progress is calculated from logged data. set_goal_progress refuses calculated goals."}},"required":["goalId","name","type","metric","targetValue","comparison","currentValue","completed","calculated"],"additionalProperties":true}}},"required":["date","timezone","goals"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}},"put":{"operationId":"set_goal_progress","summary":"Set goal progress","description":"Sets one day's progress on a custom numeric goal or a boolean (yes/no) goal, replacing the previous value. Calculated goals such as calories, protein or steps refuse this: log the food entry or steps instead. To change a goal's target or schedule, use save_goal instead.","x-mcp-tool":"set_goal_progress","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"goalId":{"type":"string","description":"Goal template id, from list_goals or get_daily_goals."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD. Defaults to today's Activity Day."},"value":{"anyOf":[{"type":"number","minimum":0},{"type":"boolean"}],"description":"A number of at least 0 for a custom numeric goal, or true or false for a boolean goal."}},"required":["goalId","value"],"additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"goalId":{"type":"string","description":"Goal template id, from list_goals or get_daily_goals."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"},"currentValue":{"anyOf":[{"type":"number"},{"type":"boolean"}]},"completed":{"type":"boolean"}},"required":["goalId","date","timezone","currentValue","completed"],"additionalProperties":true}}}},"400":{"description":"`validation_failed`: `details.fields` names each invalid field.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["validation_failed"]}}}}}]}}}},"401":{"description":"`unauthorized`: the API token is missing, malformed, revoked, or from the other environment.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unauthorized"]}}}}}]}}}},"403":{"description":"`origin_not_allowed`: a browser sent the request from an origin that is not allowed. Call the API from a server, script or agent. `subscription_required`: paid access has lapsed, so API access is paused. `details.resubscribeUrl` links to pricing.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["origin_not_allowed","subscription_required"]}}}}}]}}}},"404":{"description":"`not_found`: no item with this id belongs to the user.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["not_found"]}}}}}]}}}},"409":{"description":"`calculated_goal_readonly`: the goal is calculated from logged data, so log the underlying data instead.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["calculated_goal_readonly"]}}}}}]}}}},"421":{"description":"`misdirected_request`: the request did not come through https://api.dailygoal.fit.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["misdirected_request"]}}}}}]}}}},"429":{"description":"`rate_limited`: the per-user rate limit is spent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["rate_limited"]}}}}}]}}}},"500":{"description":"`internal_error`: retry after a short wait.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorEnvelope"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["internal_error"]}}}}}]}}}}}}}},"components":{"securitySchemes":{"apiToken":{"type":"http","scheme":"bearer","description":"Your DailyGoal API token (dg_live_…), created in DailyGoal settings."}},"schemas":{"ErrorEnvelope":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","hint","retryable","docsUrl"],"properties":{"code":{"type":"string","enum":["unauthorized","insufficient_scope","origin_not_allowed","misdirected_request","subscription_required","rate_limited","validation_failed","not_found","conflict","idempotency_conflict","limit_exceeded","calculated_goal_readonly","internal_error"]},"message":{"type":"string"},"hint":{"type":"string","description":"What to do next."},"retryable":{"type":"boolean"},"details":{"type":"object","description":"Field paths, suggestions or links. Never credential material."},"docsUrl":{"type":"string","format":"uri"}}}}}}}}