Recipe Book

Pantry

Pantry endpoints for the Smart Recipe Book

These endpoints allow you to manage your personal pantry — items you have on hand. All endpoints are scoped to the currently authenticated user.

These endpoints support pagination and sorting. Read more about these features here.

The Pantry Item model

PropTypeDefault
id
string
-
name
string
-
quantity
number
-
unit
string
-
category
string
-
owner
Profile
-
created
Date
-
updated
Date
-

Get all pantry items

GET/recipe-book/pantry

Retrieve all pantry items for the currently authenticated user.

Response
{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Chicken breast",
      "quantity": 2,
      "unit": "pieces",
      "category": "Protein",
      "owner": {
        "name": "jane_doe",
        "email": "jane@stud.noroff.no",
        "bio": null,
        "avatar": null,
        "banner": null
      },
      "created": "2026-03-12T08:00:00.000Z",
      "updated": "2026-03-12T08:00:00.000Z"
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 1
  }
}

Create pantry item

POST/recipe-book/pantry

Add a new item to your pantry.

Request
{
  "name": "Chicken breast",
  "quantity": 2,
  "unit": "pieces",
  "category": "Protein"
}
Response
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Chicken breast",
    "quantity": 2,
    "unit": "pieces",
    "category": "Protein",
    "owner": {
      "name": "jane_doe",
      "email": "jane@stud.noroff.no",
      "bio": null,
      "avatar": null,
      "banner": null
    },
    "created": "2026-03-12T08:00:00.000Z",
    "updated": "2026-03-12T08:00:00.000Z"
  },
  "meta": {}
}

Update pantry item

PUT/recipe-book/pantry/<id>

Update a pantry item by its id. Only the owner can update it. You must provide at least one field to update.

Request
// You can update any combination of the properties.
{
  "quantity": 5
}
Response
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Chicken breast",
    "quantity": 5,
    "unit": "pieces",
    "category": "Protein",
    "owner": {
      "name": "jane_doe",
      "email": "jane@stud.noroff.no",
      "bio": null,
      "avatar": null,
      "banner": null
    },
    "created": "2026-03-12T08:00:00.000Z",
    "updated": "2026-03-12T08:30:00.000Z"
  },
  "meta": {}
}

Delete pantry item

DELETE/recipe-book/pantry/<id>

Delete a pantry item by its id. Only the owner can delete it.

Returns an empty 204 No Content response on success.

On this page