Skip to main content

Allergens

This section documents the allergen management endpoints of the MiseOS API, which allow for retrieving, creating, updating, and deleting allergens.

The MiseOS platform maintains a standardized list of food allergens used when creating dishes and dish suggestions.

The system supports the 14 EU allergen categories, which must be declared in professional food service environments. These allergens can be associated with dishes to ensure proper dietary and regulatory information is available.

Allergens can be added in two ways:

  • Using the /allergens/seed endpoint to populate the database with the 14 predefined EU allergens
  • Creating allergens manually through the API for custom or organization-specific use cases

This allows kitchens to either rely on the standard EU allergen list or extend it with additional allergens if required.

Allergens Endpoints
#

MethodURLAuth
GET/allergensKITCHEN_STAFF
GET/allergens/{id}KITCHEN_STAFF
GET/allergens/search/{query}KITCHEN_STAFF
POST/allergensHEAD_CHEF
POST/allergens/seedHEAD_CHEF
PUT/allergens/{id}HEAD_CHEF
DELETE/allergens/{id}HEAD_CHEF

Allergen response object
#

The allergen object has the following structure:

{
  "id": 1,
  "nameDA": "Gluten",
  "nameEN": "Gluten",
  "descriptionDA": "Indeholder hvede, rug eller byg",
  "descriptionEN": "Contains wheat, rye or barley",
  "displayNumber": 1
}

GET /allergens
#

Returns all 14 EU allergens sorted by display number.

Example Request
#

curl -H "Authorization: Bearer <token>" \
https://miseos.corral.dk/api/v1/allergens

Response 200 — array of allergen objects.

[
  {
    "id": 1,
    "nameDA": "Gluten",
    "nameEN": "Gluten",
    "descriptionDA": "Indeholder hvede, rug eller byg",
    "descriptionEN": "Contains wheat, rye or barley",
    "displayNumber": 1
  },
  {
    "id": 2,
    "nameDA": "Skaldyr",
    "nameEN": "Crustaceans",
    "descriptionDA": "Indeholder krebsdyr som rejer, krabber eller hummere",
    "descriptionEN": "Contains crustaceans such as shrimp, crab or lobster",
    "displayNumber": 2
  },
  ...
]

GET /allergens/{id}
#

Returns an allergen object by ID.

Example Request
#

curl -H "Authorization: Bearer <token>" \
https://miseos.corral.dk/api/v1/allergens/1

Response 200 — allergen object.

Errors

StatusCause
404Allergen not found

GET /allergens/search/{query}
#

Searches allergens by name in both Danish and English. Returns partial matches.

Path parameters

ParameterTypeDescription
queryStringSearch term

Example Request
#

curl -H "Authorization: Bearer <token>" \
https://miseos.corral.dk/api/v1/allergens/search/gluten

Response 200 — array of matching allergen objects. Empty array if none found.


POST /allergens
#

Creates a new allergen.

Request body

{
  "nameDA": "Sennep",
  "nameEN": "Mustard",
  "descriptionDA": "Indeholder sennepsfrø",
  "descriptionEN": "Contains mustard seeds",
  "displayNumber": 10
}

Response 201 — created allergen object.

Errors

StatusCause
409Name or display number already in use

POST /allergens/seed
#

Seeds the database with the 14 standard EU allergens used in food labeling regulations.

This endpoint is intended for initial system setup and should only be called once on an empty database.

The allergens are predefined in the application and include both Danish and English names and descriptions.

Response 201 — array of all seeded allergen objects.

Errors

StatusCause
400Allergens already seeded

PUT /allergens/{id}
#

Updates an allergen. Only checks uniqueness if the name or display number has changed.

Request body — same shape as create.

Response 200 — updated allergen object.


DELETE /allergens/{id}
#

Deletes an allergen.

Deletion is blocked if the allergen is currently referenced by any dish or dish suggestion.

Response 204 — no content.

Errors

StatusCause
400Allergen is in use by one or more dishes
404Allergen not found