Skip to Content
MySagra 1.4.0 is released 🎉
API ReferenceOverview

API Reference

The MySagra REST API allows you to manage all aspects of your sagra (food festival) event — from menus and orders to printers and cash registers.

Base URL

https://your-domain.com

URL Structure

PathDescription
/auth/*Authentication endpoints (unversioned)
/events/*Server-Sent Events channels (unversioned)
/v1/*Versioned API resources

Authentication

Most endpoints require a Bearer token (JWT) sent in the Authorization header:

Authorization: Bearer <accessToken>

Obtain tokens via the Authentication endpoints. Access tokens expire after 15 minutes; use the refresh endpoint to obtain new ones.

The default credentials are admin / admin. For security reasons, change your password immediately after the first login using the Users endpoints.

Common Response Codes

StatusDescription
200Success
201Resource created
204Resource deleted (no content)
400Bad request / validation error
401Unauthorized — missing or invalid token
403Forbidden — insufficient permissions
404Resource not found
409Conflict — duplicate resource
500Internal server error

Error Format

All errors return a JSON object:

{ "message": "Error description" }

or

{ "error": "Error description" }

Resources

ResourceDescription
AuthenticationLogin, logout and token refresh
UsersUser management (admin only)
CategoriesMenu category management
FoodsFood item management
IngredientsIngredient management
OrdersOrder lifecycle management
PrintersThermal printer management
Cash RegistersCash register management
Events (SSE)Real-time Server-Sent Events
Last updated on