Skip to main content

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

string
required
The name of the event
string
A detailed description of the event
object
required
Event location details
string
required
Event start date and time (ISO 8601 format)
string
required
Event end date and time (ISO 8601 format)
integer
required
Maximum number of attendees
string
required
Event category (e.g., “conference”, “workshop”, “festival”, “meetup”)
object
Sustainability targets for the event
array
Array of tags for categorization

Response

string
Unique identifier for the event
string
The name of the event
string
Event description
object
Event location details
string
Event start date and time
string
Event end date and time
integer
Maximum attendee capacity
string
Event category
object
Sustainability targets
array
Event tags
string
Event status (“draft”, “published”, “cancelled”, “completed”)
string
Timestamp when the event was created
string
Timestamp when the event was last updated

Example

Response Example


Get Event

GET /api/events/:id

Retrieve a specific event by ID.

Path Parameters

string
required
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

string
required
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.
string
Updated event name
string
Updated event description
object
Updated location details
string
Updated start date and time
string
Updated end date and time
integer
Updated capacity
string
Updated category
object
Updated sustainability goals
array
Updated tags
string
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

string
required
The unique identifier of the event to delete

Response

boolean
Indicates whether the deletion was successful
string
Confirmation message
string
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

integer
default:"1"
Page number for pagination
integer
default:"20"
Number of events per page (max 100)
string
Filter by event status (“draft”, “published”, “cancelled”, “completed”)
string
Filter by event category
string
Filter events starting after this date (ISO 8601)
string
Filter events ending before this date (ISO 8601)
Search events by name or description
string
Comma-separated list of tags to filter by
string
default:"createdAt"
Field to sort by (“createdAt”, “startDate”, “name”, “capacity”)
string
default:"desc"
Sort order (“asc” or “desc”)

Response

array
Array of event objects
object
Pagination information

Example

Response Example


Error Responses

All endpoints may return the following error responses:
object
Error details

Common Error Codes