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/seedendpoint 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#
| Method | URL | Auth |
|---|---|---|
GET | /allergens | KITCHEN_STAFF |
GET | /allergens/{id} | KITCHEN_STAFF |
GET | /allergens/search/{query} | KITCHEN_STAFF |
POST | /allergens | HEAD_CHEF |
POST | /allergens/seed | HEAD_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/allergensResponse 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/1Response 200 — allergen object.
Errors
| Status | Cause |
|---|---|
404 | Allergen not found |
GET /allergens/search/{query}#
Searches allergens by name in both Danish and English. Returns partial matches.
Path parameters
| Parameter | Type | Description |
|---|---|---|
query | String | Search term |
Example Request#
curl -H "Authorization: Bearer <token>" \
https://miseos.corral.dk/api/v1/allergens/search/glutenResponse 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
| Status | Cause |
|---|---|
409 | Name 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
| Status | Cause |
|---|---|
400 | Allergens 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
| Status | Cause |
|---|---|
400 | Allergen is in use by one or more dishes |
404 | Allergen not found |