Overview
The Events API allows you to create, retrieve, update, and delete events in your EcoEvents platform. All endpoints require authentication via API key.Authentication
All API requests require an API key to be included in the header:Create Event
POST /api/events
Create a new sustainable event with carbon tracking and eco-friendly options.
Request
The name of the event
A detailed description of the event
Event location details
Event start date and time (ISO 8601 format)
Event end date and time (ISO 8601 format)
Maximum number of attendees
Event category (e.g., “conference”, “workshop”, “festival”, “meetup”)
Sustainability targets for the event
Array of tags for categorization
Response
Unique identifier for the event
The name of the event
Event description
Event location details
Event start date and time
Event end date and time
Maximum attendee capacity
Event category
Sustainability targets
Event tags
Event status (“draft”, “published”, “cancelled”, “completed”)
Timestamp when the event was created
Timestamp when the event was last updated
Example
Response Example
Get Event
GET /api/events/:id
Retrieve a specific event by ID.
Path Parameters
The unique identifier of the event
Response
Returns the same event object structure as the Create Event endpoint.Example
Update Event
PUT /api/events/:id
Update an existing event. All fields are optional.
Path Parameters
The unique identifier of the event to update
Request
Accepts the same parameters as Create Event, but all fields are optional. Only include fields you want to update.Updated event name
Updated event description
Updated location details
Updated start date and time
Updated end date and time
Updated capacity
Updated category
Updated sustainability goals
Updated tags
Updated status (“draft”, “published”, “cancelled”, “completed”)
Response
Returns the updated event object.Example
Delete Event
DELETE /api/events/:id
Permanently delete an event. This action cannot be undone.
Path Parameters
The unique identifier of the event to delete
Response
Indicates whether the deletion was successful
Confirmation message
The ID of the deleted event
Example
Response Example
List Events
GET /api/events
Retrieve a paginated list of events with optional filtering.
Query Parameters
Page number for pagination
Number of events per page (max 100)
Filter by event status (“draft”, “published”, “cancelled”, “completed”)
Filter by event category
Filter events starting after this date (ISO 8601)
Filter events ending before this date (ISO 8601)
Search events by name or description
Comma-separated list of tags to filter by
Field to sort by (“createdAt”, “startDate”, “name”, “capacity”)
Sort order (“asc” or “desc”)
Response
Array of event objects
Pagination information
Example
Response Example
Error Responses
All endpoints may return the following error responses:Error details
Common Error Codes
| Status Code | Error Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Invalid request parameters or body |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | FORBIDDEN | Insufficient permissions |
| 404 | NOT_FOUND | Event not found |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests |
| 500 | INTERNAL_ERROR | Server error |