Overview
API for managing events. Supports destination-based and route-based events. When sending a route, provide it as GeoJSON; the API derives the encoded polyline automatically.Authentication & Permissions
All endpoints require Auth0 authentication. Permission Model:- Regular Users: Can create, view, update, and delete their own events
- Admin Users: Can create, view, update, and delete all events
List Events
Query Parameters
Filter by active status
Filter events with routes
Filter events with destinations
Filter by city name
Response
Total number of events
Array of event objects
Example
cURL
Get Event
Path Parameters
Event ID
Response
Returns the event object with all details.Example
cURL
Create Event
Request Body
Event name
Event description (defaults to empty string)
Event emoji
Public URL for the event image
Destination ID for destination-based events
Route geometry as a GeoJSON LineString or MultiLineString in EPSG:4326
Array of category IDs
ISO 8601 start time (null for leisure routes)
ISO 8601 end time (null for leisure routes)
Active status
URL-friendly alias; if omitted, generated from the name
Validation Rules
- At least one of:
destination_idorroute_geojsonmust be provided. route_geojsonmust be a LineString or MultiLineString in EPSG:4326.aliasmust be unique across all events.
Response
Returns the created event object (201 Created).Example
cURL
Update Event (Full)
Path Parameters
Event ID
Request Body
Same fields as POST (Create Event), but all fields should be included for a full update.Response
Returns the updated event object.Example
cURL
Update Event (Partial)
Path Parameters
Event ID
Request Body
Any subset of the fields from POST (Create Event). All fields are optional for PATCH.Event name
Event description
Event emoji
Public URL for the event image
Destination ID (set to null to clear)
Route geometry (set to null to clear)
Array of category IDs
ISO 8601 start time
ISO 8601 end time
Active status
URL-friendly alias (must be unique)
Auth0 user ID of the event owner (admin only)Admin Only: Only admin users can change the event owner. Regular users cannot modify this field.
Response
Returns the updated event object.Example
cURL
Delete Event
Path Parameters
Event ID
Response
Returns a success message (200 OK).Confirmation message with event name
Example
cURL
Event Response Object
All endpoints that return event data include the following fields:Event ID
Event name
Event alias
Event description
Event emoji
Event image URL
Start time (ISO 8601) or null
End time (ISO 8601) or null
Event creator information (non-PII)
Created timestamp
Updated timestamp
Active status
Unique users who completed the event
True if permanent route with no times
City name (auto-computed from route start point). Null if no route geometry.
DEPRECATED - Use
city field instead. Destination (when applicable)Category list
Event images
Route details (when route exists)
Notes
- Send routes as
route_geojson. The server stores geometry and derives the encoded polyline for responses. - City Auto-Computation: The
cityfield is automatically computed from the route start point using PostGIS spatial queries. It cannot be set manually and will update wheneverroute_geojsonchanges. - All endpoints require Auth0 authentication. Regular users can only access their own events, while admin users can access all events.
- When updating
route_geojson, the system automatically:- Recomputes the
cityfield - Regenerates event edges for routing
- Recomputes the
- Setting
route_geojsonordestination_idto null removes the existing value. - Attempting to access another user’s event (as a non-admin) returns 403 Forbidden.
- Admin-Only Feature: Admin users can change the event owner by including
created_by(Auth0 user ID) in PATCH requests. Regular users cannot modify this field and will receive a 403 Forbidden error if attempted.
Admin Example: Change Event Owner
Admin users can transfer event ownership using PATCH:cURL
- Transfer event ownership between users
- Reassign orphaned events
- Correct ownership mistakes