Events API Reference

List Events

Retrieve a paginated list of events.

HTTP Request

GET /api/v1/events

Query Parameters

Parameter Type Description
page integer Page number for pagination
per_page integer Number of items per page
start_date string Filter events starting from this date (ISO 8601)
end_date string Filter events until this date (ISO 8601)
status string Filter by event status (draft, published, cancelled)

Example Response

{
    "data": [
        {
            "id": 1,
            "title": "Summer Music Festival",
            "description": "Annual summer music festival featuring local bands",
            "location": "Central Park",
            "start_date": "2024-07-15T14:00:00Z",
            "end_date": "2024-07-15T22:00:00Z",
            "status": "published",
            "capacity": 1000,
            "created_at": "2024-01-15T08:30:00Z",
            "updated_at": "2024-01-15T08:30:00Z"
        },
        {
            "id": 2,
            "title": "Tech Conference 2024",
            "description": "Annual technology conference",
            "location": "Convention Center",
            "start_date": "2024-09-20T09:00:00Z",
            "end_date": "2024-09-22T17:00:00Z",
            "status": "published",
            "capacity": 500,
            "created_at": "2024-01-15T09:15:00Z",
            "updated_at": "2024-01-15T09:15:00Z"
        }
    ],
    "meta": {
        "current_page": 1,
        "per_page": 10,
        "total": 2
    }
}

Get Single Event

Retrieve details of a specific event.

HTTP Request

GET /api/v1/events/{id}

URL Parameters

Parameter Type Description
id integer The ID of the event

Example Response

{
    "data": {
        "id": 1,
        "title": "Summer Music Festival",
        "description": "Annual summer music festival featuring local bands",
        "location": "Central Park",
        "start_date": "2024-07-15T14:00:00Z",
        "end_date": "2024-07-15T22:00:00Z",
        "status": "published",
        "capacity": 1000,
        "staff_required": 50,
        "staff_assigned": 30,
        "created_at": "2024-01-15T08:30:00Z",
        "updated_at": "2024-01-15T08:30:00Z"
    }
}

Create Event

Create a new event.

HTTP Request

POST /api/v1/events

Request Body

Parameter Type Description
title string Event title
description string Event description
location string Event location
start_date string Event start date and time (ISO 8601)
end_date string Event end date and time (ISO 8601)
capacity integer Maximum number of attendees
staff_required integer Number of staff members needed

Example Request

{
    "title": "New Year's Eve Party",
    "description": "Celebrate the new year with us!",
    "location": "Grand Hotel Ballroom",
    "start_date": "2024-12-31T20:00:00Z",
    "end_date": "2025-01-01T02:00:00Z",
    "capacity": 300,
    "staff_required": 25
}

Example Response

{
    "data": {
        "id": 3,
        "title": "New Year's Eve Party",
        "description": "Celebrate the new year with us!",
        "location": "Grand Hotel Ballroom",
        "start_date": "2024-12-31T20:00:00Z",
        "end_date": "2025-01-01T02:00:00Z",
        "status": "draft",
        "capacity": 300,
        "staff_required": 25,
        "staff_assigned": 0,
        "created_at": "2024-01-15T10:00:00Z",
        "updated_at": "2024-01-15T10:00:00Z"
    }
}

Update Event

Update an existing event.

HTTP Request

PUT /api/v1/events/{id}

Request Body

Parameter Type Description
title string Event title
description string Event description
location string Event location
start_date string Event start date and time (ISO 8601)
end_date string Event end date and time (ISO 8601)
status string Event status (draft, published, cancelled)
capacity integer Maximum number of attendees
staff_required integer Number of staff members needed

Example Request

{
    "title": "Updated Event Title",
    "description": "Updated event description",
    "status": "published",
    "capacity": 400,
    "staff_required": 30
}

Example Response

{
    "data": {
        "id": 1,
        "title": "Updated Event Title",
        "description": "Updated event description",
        "location": "Central Park",
        "start_date": "2024-07-15T14:00:00Z",
        "end_date": "2024-07-15T22:00:00Z",
        "status": "published",
        "capacity": 400,
        "staff_required": 30,
        "staff_assigned": 30,
        "created_at": "2024-01-15T08:30:00Z",
        "updated_at": "2024-01-15T10:15:00Z"
    }
}

Delete Event

Delete an existing event.

HTTP Request

DELETE /api/v1/events/{id}

URL Parameters

Parameter Type Description
id integer The ID of the event to delete

Example Response

{
    "message": "Event successfully deleted"
}