Skip to content

API quickstart

Use REST for scripts and applications. Use remote MCP to let an AI client act on your behalf. Both use your current Meal Space permissions.

Get access

  1. Sign in to TogetherMeals and open /settings/api-keys in the web app.
  2. You need your own Pro plan or active Pro trial. Another person's sponsorship of a shared Meal Space does not give your account programmatic access.
  3. Choose Create API key, give it a name, select scopes, and optionally set an expiry. Start with read. Add write to create or edit meals, delete for deletion, and admin for management operations you need. These scopes are independent.
  4. Copy the key when it appears. This is the only time TogetherMeals shows its secret. A trial allows one active key. Revoke a lost key and create another.

Keep the key in your script's environment or secret store. The shell examples below assume TOGETHERMEALS_API_KEY is already set. They use curl and, where JSON is inspected, jq.

export TOGETHERMEALS_API_URL='https://api.togethermeals.app'

For a running local stack, use http://localhost:3701 and a key created by that local instance. A tm_test_ prefix alone does not select a separate database.

Make your first request

curl --fail-with-body --silent --show-error \
  "$TOGETHERMEALS_API_URL/api/v1/me/preferences" \
  -H "Authorization: Bearer $TOGETHERMEALS_API_KEY"

The JSON response has data and meta. The latter contains a request_id and timestamp. There is currently no GET /api/v1/me profile endpoint. Preferences are a useful first authenticated read; they return your timezone and optional primary Meal Space ID.

A 401 can mean that the key is invalid, expired, or revoked, or that your own Pro/trial access has ended. A 403 can mean that the key lacks the route's exact scope. See authentication for the full rules.

Find your Meal Spaces

List the Meal Spaces your account can read:

curl --fail-with-body --silent --show-error \
  "$TOGETHERMEALS_API_URL/api/v1/meal-spaces" \
  -H "Authorization: Bearer $TOGETHERMEALS_API_KEY" \
  -o meal-spaces.json

jq '.data.meal_spaces[] | {meal_space_id, membership_id, name, effective_role, availability}' meal-spaces.json

Each entry has the space's meal_space_id and your membership_id in it. The latter identifies your current Membership period in that space. Many writes require both, so retain them together. An entry also has your effective_role, the space's availability, its planning_timezone and enabled_slots, and is_primary, which marks the primary Meal Space you chose in the app. Role and availability describe the space when you read it; every later request is authorized again.

A page holds up to 100 spaces, ordered by ID. If next_cursor is non-null, request the next page with --get --data-urlencode "after=$NEXT_CURSOR" on the same URL.

Choose a returned pair and set these variables. The example IDs below are placeholders:

export GROUP_ID='3f1a0000-0000-4000-8000-000000000001'
export MEMBERSHIP_ID='3f1a0000-0000-4000-8000-000000000002'

Presentation adds your private visibility and order and the space's current today. GET /api/v1/meal-spaces/{groupId}/access adds the Owner, Sponsor and recovery actions. A client that keeps data offline uses the access manifest instead: it lists the same spaces and Membership IDs under a revision, so a complete scan can prove that access ended.

Read a meal plan

curl --fail-with-body --silent --show-error --get \
  "$TOGETHERMEALS_API_URL/api/v1/meal-spaces/$GROUP_ID/entries" \
  -H "Authorization: Bearer $TOGETHERMEALS_API_KEY" \
  --data-urlencode 'from=2026-11-02' \
  --data-urlencode 'to=2026-11-09'

from includes its date and to excludes its date. These are calendar dates in the Meal Space's Planning timezone. The response contains data.items and data.next_after. Continue with after until it is null, retaining the date window. Pages are ordered by ID. Sort the assembled meals by date, slot, and position for display.

This endpoint reads one space. A merged plan currently requires one read per space.

Add a meal

Your key needs write, your current role must permit content writes, and the Meal Space must be writable. Pick a date and one of its enabled_slots. This example writes a Simple Entry. Replace membership_id with the Membership ID returned for your chosen space, and use a fresh id, Idempotency-Key, and current millisecond client_updated_at for each new operation.

{
  "id": "3f1a0000-0000-4000-8000-000000000003",
  "membership_id": "3f1a0000-0000-4000-8000-000000000002",
  "client_updated_at": "2026-10-27T18:00:00.000Z",
  "entry_date": "2026-11-02",
  "entry_type": "simple",
  "slot": "dinner",
  "title": "Vegetable tacos",
  "notes": "Use the roasted peppers",
  "leftover_of_entry_id": null,
  "status": "planned",
  "position_value": "a0"
}

Save your edited JSON as meal.json, then send it:

export COMMAND_ID='3f1a0000-0000-4000-8000-000000000004'

curl --fail-with-body --silent --show-error \
  "$TOGETHERMEALS_API_URL/api/v1/meal-spaces/$GROUP_ID/entries" \
  -H "Authorization: Bearer $TOGETHERMEALS_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: $COMMAND_ID" \
  --data-binary @meal.json

The result has data.outcome, data.entry_id, and nullable data.replacement_id. applied means the write took effect; unchanged means it needed no content change; stale means a newer value won. Fetch the Entry to read its current content.

For an uncertain response, retry the exact file with the same command key, Entry ID, Membership ID, and timestamp. Changing the content creates a different command. After leaving and rejoining, reacquire your Membership period rather than moving an old command to the new one. Recipe edits and AI calls have different conflict/retry rules; see conventions.

Search recipes

curl --fail-with-body --silent --show-error --get \
  "$TOGETHERMEALS_API_URL/api/v1/recipes" \
  -H "Authorization: Bearer $TOGETHERMEALS_API_KEY" \
  --data-urlencode 'q=tacos' \
  --data-urlencode 'limit=20'

The library searches every space you can read. Optional filters include meal_space_id, tag, category, uncategorized, and favorites. Follow data.next_after using after. There is no space-scoped GET /meal-spaces/{groupId}/recipes collection; filter this one.

Use the TypeScript client in this repository

@togethermeals/sdk is a private workspace package, not a published npm installation. Its generated paths already include /api/v1, so pass the API origin as baseUrl:

import { createTogetherMealsClient } from "@togethermeals/sdk";

const client = createTogetherMealsClient({
  baseUrl: "https://api.togethermeals.app",
  token: () => process.env.TOGETHERMEALS_API_KEY ?? null,
});

const { data, error, response } = await client.GET("/api/v1/me/preferences");
if (error) throw new Error(`${response.status}: ${error.error.code}`);
console.log(data?.data.timezone);

The token callback runs for each request. OAuth callers are responsible for refreshing their token; the SDK does not perform an OAuth flow. External clients can use ordinary HTTP today. See capabilities for the rest of the API, or open /api-docs for the interactive reference and /openapi.json for the generated schema.