Skip to content
Jupiter documentation
Menu

API reference

Every endpoint with its method, body fields and status codes.

All paths live under /api/v1. Every endpoint except POST /api/v1/register, POST /api/v1/login and GET /healthz needs an x-access-tokens header with a JWT. Requests and responses are JSON.

Authentication#

A failed login sends WWW-Authenticate: Basic realm="login required". The token expires after 30 minutes. Send it as x-access-tokens: <token>; a missing or invalid token gets 403 {message}.

Users and customers#

GET /api/v1/user returns {public_id, name, admin} per user. Customer entries add id and is_active. Password hashes never appear in a response.

Recipes#

Create fields: recipe_name (required), classification (required, a classification id), description, num_of_servings (default 2), cook_time (default 30), directions, is_publish (default false), nutrition (object of strings, default {}).

A recipe response carries classification (its id), nutrition (object), has_links (true when a Mapping references it) and ingredients (see below).

Ingredients#

ingredient_name plus recipe must be unique together.

Classifications#

name holds at most 35 characters.

Reviews#

Recipe reviews and menu reviews share one shape. The foreign key field is recipe (a recipe id) or menu (the id of a Weekly menu); customer is a customer id.

Replace recipe-review with weekly-menu-review and recipe with menu for menu reviews. A response entry names its recipe or menu and its customer, and carries score, summary, pub_date and is_publish.

Weekly menus#

A menu response carries recipes (its mappings) and score (the mean review score, 0 with no reviews).

Health#

Pagination and errors#

List endpoints return 10 rows per page. meta carries page, per_page and page_url. An empty list answers 404 with {status, url, error}, matching the 2021 API. Validation failures answer 400 or 422 with {error} and a details object naming each bad field. Unhandled failures answer 500 with {status, url, error}.

Source: belikh/hello-fresh-API HEAD