GET /api/events
Retrieve a list of all events in Dzaleka Refugee Camp.
Query Parameters
This endpoint does not require any query parameters.
Status of the API response (“success” or “error”)
Total number of events returned
Container for the events dataArray of event objectsUnique identifier for the event
Collection name (“events”)
Event start date and time (ISO 8601 format)
Event end date (YYYY-MM-DD)
Event location (e.g., “Online”, “Dzaleka Community Center”)
Event category (e.g., “Zoom Meeting”, “Workshop”, “Conference”)
Whether the event is featured
Name of the organizing entity
Event status (“upcoming”, “ongoing”, “past”)
Registration detailsWhether registration is required
Registration deadline (YYYY-MM-DD)
Error Responses
Error message description
Detailed error information
Status Codes:
200 - Success
429 - Rate limit exceeded (60 requests per minute)
500 - Internal server error
Rate Limiting
All API endpoints are rate-limited to 60 requests per minute per IP address. Rate limit headers are included in responses:
X-RateLimit-Limit: Maximum requests per window
X-RateLimit-Remaining: Remaining requests in current window
X-RateLimit-Reset: Timestamp when the rate limit resets
Retry-After: Seconds to wait before retrying (only on 429 responses)
Example Request
curl -X GET "https://services.dzaleka.com/api/events" \
-H "Content-Type: application/json"
Example Response
{
"status": "success",
"count": 1,
"data": {
"events": [
{
"id": "Breaking Myths About Refugees",
"collection": "events",
"title": "Breaking Myths About Refugees: Truths That Change Perceptions",
"description": "Refugees and migrants face misconceptions worldwide, but in this session, we focus on Malawi and the broader sub-Saharan Africa region.",
"date": "2025-04-24T13:00:00.000Z",
"endDate": "2025-04-24",
"location": "Online",
"category": "Zoom Meeting",
"image": "https://alumni.creighton.edu/sites/default/files/externals/7fe45be3aa4b9a7e7698f971033cbcc6.jpg",
"featured": true,
"organizer": "Inua Advocacy",
"status": "past",
"contact": {
"email": "info@inuaadvocacy.org",
"phone": "+265 882 717 995",
"whatsapp": "+265 882 717 995"
},
"registration": {
"required": true,
"url": "https://us06web.zoom.us/meeting/register/4PrLQ4aMSK6gzSDff2shWw",
"deadline": "2025-04-24"
},
"tags": ["Refugees", "Malawi", "Laws", "Inua Advocacy"]
}
]
}
}
POST /api/events
Retrieve events data with optional metadata and statistics.
Request Body
Optional configuration for the responseInclude export metadata in response
Include statistics in response
Same as GET endpoint, with optional additional fields:
Export metadata (only if includeMetadata: true)ISO 8601 timestamp of export
Statistics (only if includeStats: true)
Example Request
curl -X POST "https://services.dzaleka.com/api/events" \
-H "Content-Type: application/json" \
-d '{
"options": {
"includeMetadata": true,
"includeStats": true
}
}'
Example Response
{
"status": "success",
"count": 28,
"data": {
"events": [
{
"id": "Breaking Myths About Refugees",
"title": "Breaking Myths About Refugees: Truths That Change Perceptions",
"date": "2025-04-24T13:00:00.000Z",
"location": "Online"
}
]
},
"metadata": {
"exportDate": "2025-03-09T12:00:00.000Z",
"collection": "events"
},
"stats": {
"totalItems": 28,
"collection": "events"
}
}
Implementation
The Events API is implemented using the createGetHandler and createPostHandler utility functions from src/utils/api-utils.ts:118.
Source code: src/pages/api/events.ts:5