Skip to content

OAuth and public endpoints

The generated REST reference covers registered authenticated /api/v1 operations. These additional endpoints live outside that registry. Their handlers use the protocol formats described here; do not expect every response to have a REST data envelope.

Public API contract

GET /openapi.json returns raw OpenAPI 3.1 JSON without credentials. It permits cross-origin reads and sends Cache-Control: public, max-age=300. The web app exposes /openapi.json through its configured API proxy and renders it at /api-docs.

The reference uses the web origin for interactive API requests, so an API key stays on the same configured first-party request path rather than passing through an external request proxy. Scalar does not persist authentication between visits. Only use a key with the scopes needed for the operation you are trying.

OAuth discovery and registration

Method and API pathPurposeFormat
GET /.well-known/oauth-authorization-serverDiscover issuer, authorization endpoint, token/revocation/registration endpoints, supported client authentication, scopes and PKCERaw authorization-server metadata JSON
POST /oauth/registerRegister a client with reviewed name, redirect URIs and supported metadataJSON request and raw registration JSON; a confidential client's secret is shown once
POST /oauth/tokenExchange an authorization code with a PKCE verifier, or rotate a refresh tokenURL-encoded form; raw OAuth token response
POST /oauth/revokeRevoke a token held by the authenticated clientURL-encoded form; successful response is {}

Discover the actual endpoints instead of deriving the web consent URL from the issuer:

curl --fail-with-body --silent --show-error \
  'https://api.togethermeals.app/.well-known/oauth-authorization-server'

The API origin is the issuer. Its advertised authorization_endpoint is the web app's /oauth/authorize page. Public clients use authorization code with PKCE S256. Confidential clients additionally use their registered client_secret_basic or client_secret_post method. An access token can be a REST bearer; a refresh token and client secret cannot. OAuth errors use error and optional error_description, rather than REST error.code.

Token responses contain access_token, token_type, expires_in, refresh_token, and scope. Refresh rotates both tokens. Serialize refresh attempts; reusing an already rotated refresh token revokes the grant. Authorization codes are single-use and bound to the client, redirect, and PKCE verifier. See authentication for redirect rules, lifetimes, Pro requirements, registration trust, and revocation.

Method and API pathResult
GET /public/recipe-links/{token}REST success envelope whose data is the public Recipe projection
GET /public/recipe-links/{token}/image/{size}JPEG bytes for a current link image; size is master or card
GET /public/recipe-links/{token}/steps/{index}/image/{size}JPEG bytes for the photo of the Instructions row at index; 404 unless that row is a step with a photo

Anyone holding a live link token can read its published Recipe version without an account. The public projection contains cooking content, the published Variation name when present, and image metadata. It omits member identities and private Notes. A revoked or unavailable link returns 404; failed dependencies can return 503, and public reads are rate-limited. Responses are not cached. Treat the token as access to that Recipe, and avoid putting it in logs or sharing it beyond the intended recipients.

Creating, reading back, listing, or revoking the account's public link credentials requires first-party authentication. Saving a Recipe from an existing link into your own authorized Meal Space uses POST /api/v1/meal-spaces/{groupId}/recipes/import-share. See Recipe links for the complete rules.

MCP discovery

Remote MCP uses https://mcp.togethermeals.app/mcp and publishes /.well-known/oauth-protected-resource plus the /mcp metadata alias on that origin. The metadata identifies the API authorization server. A missing or expired bearer gets an HTTP 401 challenge pointing to that document. These MCP endpoints are not served through the web app's authenticated REST proxy. See MCP setup.

Operational and first-party discovery paths

GET /health reports API health. GET /metrics returns operational text and is not a per-account usage endpoint. POST /auth/login-method accepts an email address and returns raw {"method":"otp"} or {"method":"password"} to choose a first-party sign-in form; it does not issue a session. Integrations should obtain API keys or OAuth tokens through the documented access flows instead of building on that sign-in selector.