API reference

Photographs

The photographs on a recipe: adding them, choosing a cover, taking them away.

Paths below are relative to https://recipejam.com/api/v1

GET /recipes/{recipe}/images

List a recipe's photographs

Every photograph on the recipe, in the order they are shown.

Parameters

Field Type Notes
recipe string · path The recipe.

Response

200 with the image objects under a `data` key. No pagination on this one.

POST /recipes/{recipe}/images

Add a photograph

Upload one photograph. The only endpoint that takes multipart/form-data rather than JSON.

Parameters

Field Type Notes
recipe string · path The recipe to add it to.

Request body

Field Type Notes
photo required file image, max 12MB The image file, as multipart/form-data.

Response

201 with a single image object under a `data` key.

  • Adding a photograph counts as editing the recipe, so it is the recipe's permission that decides.
  • The first photograph on a recipe becomes its cover automatically.
  • Location, camera make and model are stripped on the server. The app's uploader also strips them on the device, but a client calling this API does not — so it is done here regardless. Orientation is read and applied before anything is removed.
  • Every image starts unmoderated. Nothing identified as prohibited is served publicly.
  • Every size is rendered on upload, so the `links` on the response work immediately.
PUT /recipes/{recipe}/images/{image}/cover

Make a photograph the cover

Choose which of a recipe's photographs represents it.

Parameters

Field Type Notes
recipe string · path The recipe.
image string · path One of that recipe's photographs.

Response

200 with a single image object under a `data` key.

  • An image belonging to a different recipe answers 404, the same as one that does not exist.
DELETE /recipes/{recipe}/images/{image}

Remove a photograph

Detaches it. The rendered files stay on disk until the recovery window closes, so a restored recipe still has its photographs.

Parameters

Field Type Notes
recipe string · path The recipe.
image string · path The photograph to remove.

Response

204 with an empty body.

  • If it was the cover, another photograph takes over rather than the recipe being left without one.

Try these

The endpoints on this page, sent from your browser with your own token. Nothing is proxied through us.

Kept in this browser only, so it survives a reload. It is never sent to RecipeJam except as the header on the request you ask for.

The same request, as curl

The image object

Field Type Notes
id string Opaque identifier.
width integer Of the stored original, in pixels.
height integer Of the stored original, in pixels.
links object One URL per size: `thumbnail`, `strip`, `small`, `medium`, `large`, plus `download`. Each is an application URL, authorised per request — not a storage URL, and never public because you hold it.