Write Categories

PUT /categories

Request properties

  • categories: The array of category objects:
    • id: The category identifier
    • name: The category name

The application displays categories in the order of the array.

When adding new categories, the id has to fulfill the following regular expression: /^cat_[A-Za-z0-9_-]{10}$/

Categories can only be deleted if no items are associated with them.

Status codes

  • 200 on success
  • 400 if the request is invalid

Response properties

The new categories as returned by GET /categories.

Example request

{
  "categories": [
    {
      "id": "cat_KaNDv51Gh0",
      "name": "Spirits"
    },
    {
      "id": "cat_myTRpvnsNb",
      "name": "Food"
    }
  ]
}