All API endpoints (except public ones like GET /events) require authentication. Include the session token in the request cookies or Authorization header.
- Base URL:
/api
Retrieve a list of all events.
- Query Parameters:
page: Page number (default: 1)category: Filter by category IDsearch: Search term for title/description
- Response:
{ "data": [ { "id": "cl...", "title": "Tech Conference 2026", "date": "2026-05-20T09:00:00Z", "price": 100, "organizerId": "user_123" } ], "meta": { "total": 50, "page": 1 } }
Create a new event (Organizer only).
- Body:
{ "title": "New Workshop", "description": "Learn Next.js", "date": "2026-06-01", "location": "Jakarta", "categoryId": "cat_123", "price": 50, "capacity": 100 } - Response:
201 Created
Book a ticket for an event.
- Body:
{ "eventId": "event_123", "quantity": 2 } - Response:
{ "bookingId": "book_456", "status": "PENDING", "totalAmount": 100 }
Register a new user.
- Body:
{ "email": "user@example.com", "password": "securepassword", "name": "John Doe" }
Add a review to an event.
- Body:
{ "eventId": "event_123", "rating": 5, "comment": "Amazing experience!" }
Get user notifications.
- Response: List of notification objects.
Mark a notification as read.
Standard HTTP status codes are used:
200: Success201: Created400: Bad Request (Validation Error)401: Unauthorized403: Forbidden404: Not Found500: Internal Server Error
Error Body Example:
{
"error": "Invalid input data",
"details": ["Title is required"]
}