Recipes
Recipes endpoints for the Smart Recipe Book
Some of these are authenticated endpoints. You can visit authentication to register an account.
These endpoints allow you to create, read, update and delete recipes. Recipes are the core resource of the Smart Recipe Book — anyone can browse and read them, but creating, updating and deleting requires authentication and ownership.
These endpoints support pagination and sorting. Read more about these features here.
The Recipe model
| Prop | Type | Default |
|---|---|---|
id | string | - |
title | string | - |
description | string | - |
prepTime | integer | - |
cookTime | integer | - |
servings | integer | - |
difficulty | string | - |
category | string | - |
ingredients | Array<object> | - |
instructions | Array<string> | - |
tags | Array<string> | - |
image | object | - |
owner | Profile | - |
comments | Array<Comment> | - |
_count | object | - |
created | Date | - |
updated | Date | - |
The Recipe Comment model
| Prop | Type | Default |
|---|---|---|
id | string | - |
text | string | - |
recipeId | string | - |
author | Profile | - |
created | Date | - |
updated | Date | - |
Query parameters
The following optional query parameters can be used to filter recipes.
| Prop | Type | Default |
|---|---|---|
search | string | - |
category | string | - |
difficulty | string | - |
Get all recipes
Retrieve all recipes. Supports filtering by search, category, and difficulty query parameters.
Get single recipe
Retrieve a single recipe by its id, including all associated comments and favorite count.
Create recipe
Create a new recipe. Only authenticated users can create recipes.
Please note that the image.url property must be a fully formed URL that links to a live and publicly accessible image. The API will check the provided URL and if it cannot be accessed publicly you will receive a 400 Bad Request error response.
Update recipe
Update a recipe by its id. Only the owner of the recipe can update it. You must provide at least one field to update.
Please note that the image.url property must be a fully formed URL that links to a live and publicly accessible image. The API will check the provided URL and if it cannot be accessed publicly you will receive a 400 Bad Request error response.
Delete recipe
Delete a recipe by its id. Only the owner of the recipe can delete it. This will also delete all associated comments, favorites, and meal plan entries.
Returns an empty 204 No Content response on success.
Get recipe comments
Retrieve all comments for a specific recipe. This endpoint does not require authentication.
Create recipe comment
Add a comment to a recipe. Only authenticated users can create comments.