# DailyGoal API > REST and MCP access to a DailyGoal user's weight, body fat, steps, food entries, custom foods, workouts and goals. Needs a paid plan or free trial; not available on Free. Authenticate with `Authorization: Bearer `. Create the token in DailyGoal settings. Call `get_context` first to learn today's Activity Day, timezone and units. ## Links - [OpenAPI 3.1 spec](https://api.dailygoal.fit/v1/openapi.json) - [MCP server](https://api.dailygoal.fit/v1/mcp): stateless streamable HTTP, JSON responses - [Developer docs](https://www.dailygoal.fit/developers) - [Error codes](https://www.dailygoal.fit/developers/errors) ## Operations - `get_context` (`GET /v1/me`): 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. - `list_body_metrics` (`GET /v1/body-metrics`): 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. - `set_body_metrics` (`PUT /v1/body-metrics`): 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. - `delete_body_metric` (`DELETE /v1/body-metrics`): 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. - `search_foods` (`GET /v1/foods`): 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. - `list_food_entries` (`GET /v1/food-entries`): 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. - `log_food_entry` (`POST /v1/food-entries`): 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. - `update_food_entry` (`PATCH /v1/food-entries`): 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. - `delete_food_entry` (`DELETE /v1/food-entries`): Delete one logged food entry by id. It leaves the food itself alone; to delete a custom food, use delete_custom_food. - `save_custom_food` (`POST /v1/custom-foods`): 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. - `delete_custom_food` (`DELETE /v1/custom-foods`): 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. - `search_exercises` (`GET /v1/exercises`): 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. - `list_workouts` (`GET /v1/workouts`): 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. - `get_workout` (`GET /v1/workouts/detail`): Get one finished workout with every exercise and set. Use list_workouts to browse workouts by date. - `log_workout` (`POST /v1/workouts`): 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. - `replace_workout` (`PUT /v1/workouts`): 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. - `delete_workout` (`DELETE /v1/workouts`): Delete a finished workout with all its exercises and sets. This cannot be undone. To correct a workout instead, use replace_workout. - `list_goals` (`GET /v1/goal-templates`): 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. - `save_goal` (`POST /v1/goal-templates`): 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. - `delete_goal` (`DELETE /v1/goal-templates`): 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. - `get_daily_goals` (`GET /v1/daily-goals`): 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. - `set_goal_progress` (`PUT /v1/daily-goals`): 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.