Back to landing page
Last updated: 09 Jul 2026, 10:15 AM
Documentation

Website API Flow

Public website APIs and API-key protected endpoints.

Website API Flow

This document is for the WordPress website developer integrating public website APIs.

Base URL

{API_BASE_URL}/api/website

Example local URL:

http://127.0.0.1:8000/api/website

Authentication

Website APIs are read-only APIs for the public WordPress website.

They do not use app member login or admin portal login.

If WEBSITE_API_KEY is empty in .env, website APIs are public.

If WEBSITE_API_KEY is configured, every request must pass the API key.

Recommended header:

X-Website-Api-Key: {website_api_key}
Accept: application/json

Query parameter is also accepted:

?api_key={website_api_key}

Invalid or missing API key response:

{
  "message": "Invalid website API key."
}

Visibility Rule

Website event APIs only expose events where:

visibility_scope = ALL

Chapter-only events are not exposed to the public website.

Cancelled events are excluded from website event APIs.

Route Summary

GET /api/website/events/types
GET /api/website/events/upcoming
GET /api/website/events/past
GET /api/website/events/details?event_id={event_uuid}
GET /api/website/events/{event_uuid}

Routes are defined in:

routes/api/website/route.php

The route group uses:

Route::middleware(['website.api.key'])->prefix('events')->name('events.')->group(...)

Event Types

List Event Types

GET /events/types

Success response:

{
  "message": "Event types found.",
  "total_event_types": 2,
  "data": [
    {
      "id": "event_type_uuid",
      "code": "WORKSHOP_VISIT",
      "name": "Workshop"
    }
  ]
}

When no event types are found:

{
  "message": "Event types not found.",
  "total_event_types": 0,
  "data": []
}

Upcoming Events

List Upcoming Events

GET /events/upcoming

Behavior:

  • Returns events where event_date >= today.
  • Excludes CANCELLED and COMPLETED events.
  • Orders by event_date ascending, then start_time ascending.
  • Only returns public website events where visibility_scope = ALL.

Examples:

GET /events/upcoming
GET /events/upcoming?limit=10&page=1
GET /events/upcoming?search=growth
GET /events/upcoming?event_type_id=event_type_uuid
GET /events/upcoming?event_type_code=WORKSHOP_VISIT
GET /events/upcoming?from_date=2026-06-01&to_date=2026-06-30

Query params:

Query param Required Notes
search No Searches title, description, location, and event type.
q No Alias for search.
limit No Pagination size, 1 to 100. Defaults to 10.
per_page No Alias for limit.
page No Page number. Defaults to 1.
event_type_id No Filter by event type UUID.
event_type_code No Filter by event type code.
from_date No Minimum event date. Alias: date_from.
to_date No Maximum event date. Alias: date_to.

Success response:

{
  "message": "Events found.",
  "meta": {
    "total_records": 1,
    "page": 1,
    "limit": 10,
    "total_pages": 1,
    "record_start": 1,
    "record_end": 1
  },
  "data": [
    {
      "id": "event_uuid",
      "event_type_id": "event_type_uuid",
      "event_type": {
        "id": "event_type_uuid",
        "code": "WORKSHOP_VISIT",
        "name": "Workshop"
      },
      "created_by_chapter_id": null,
      "created_by_chapter": null,
      "title": "Business Growth Workshop",
      "description": "A focused workshop on practical sales systems.",
      "event_date": "2026-06-05",
      "start_time": "10:00",
      "end_time": "13:00",
      "location_name": "Ahmedabad Convention Center",
      "location_address": "Ahmedabad, Gujarat",
      "latitude": null,
      "longitude": null,
      "map_url": null,
      "visibility_scope": "ALL",
      "visible_to": "All Members",
      "banner_image": "event-banners/workshop.jpg",
      "banner_image_url": "http://localhost/storage/event-banners/workshop.jpg",
      "status": "ACTIVE",
      "is_attended": false,
      "attendance_id": null,
      "attendance_status": null,
      "total_attendees": 0,
      "total_photos": 0,
      "is_past": false,
      "created_at": "2026-05-23T10:00:00.000000Z",
      "updated_at": "2026-05-23T10:00:00.000000Z"
    }
  ]
}

When no upcoming events are found:

{
  "message": "Events not found.",
  "meta": {
    "total_records": 0,
    "page": 1,
    "limit": 10,
    "total_pages": 1,
    "record_start": null,
    "record_end": null
  },
  "data": []
}

Past Events

List Past Events

GET /events/past

Behavior:

  • Returns events where event_date < today or status = COMPLETED.
  • Excludes CANCELLED events.
  • Orders by event_date descending, then start_time descending.
  • Only returns public website events where visibility_scope = ALL.

Examples:

GET /events/past
GET /events/past?limit=10&page=1
GET /events/past?search=summit
GET /events/past?event_type_code=NETWORKING
GET /events/past?from_date=2026-04-01&to_date=2026-05-31

Query params are the same as upcoming events.

Success response shape is the same as upcoming events.

Event Details

Event Details By Query Param

GET /events/details?event_id={event_uuid}

id is also accepted as an alias:

GET /events/details?id={event_uuid}

Validation:

Query param Required Notes
event_id Yes if id is not sent Event UUID.
id Yes if event_id is not sent Alias for event_id.

Event Details By Path

GET /events/{event_uuid}

Success response:

{
  "message": "Event found.",
  "data": {
    "id": "event_uuid",
    "event_type_id": "event_type_uuid",
    "event_type": {
      "id": "event_type_uuid",
      "code": "WORKSHOP_VISIT",
      "name": "Workshop"
    },
    "created_by_chapter_id": null,
    "created_by_chapter": null,
    "title": "Business Growth Workshop",
    "description": "A focused workshop on practical sales systems.",
    "event_date": "2026-06-05",
    "start_time": "10:00",
    "end_time": "13:00",
    "location_name": "Ahmedabad Convention Center",
    "location_address": "Ahmedabad, Gujarat",
    "latitude": null,
    "longitude": null,
    "map_url": null,
    "visibility_scope": "ALL",
    "visible_to": "All Members",
    "banner_image": "event-banners/workshop.jpg",
    "banner_image_url": "http://localhost/storage/event-banners/workshop.jpg",
    "status": "ACTIVE",
    "is_attended": false,
    "attendance_id": null,
    "attendance_status": null,
    "total_attendees": 0,
    "total_photos": 2,
    "is_past": false,
    "created_at": "2026-05-23T10:00:00.000000Z",
    "updated_at": "2026-05-23T10:00:00.000000Z",
    "guests": [
      {
        "id": "guest_uuid",
        "name": "Dr. Mehul Shah",
        "company_name": "Growth Labs",
        "designation": "Business Coach",
        "sort_order": 1
      }
    ],
    "photos": [
      {
        "id": "photo_uuid",
        "event_id": "event_uuid",
        "image_path": "event-photos/workshop-1.jpg",
        "image_url": "http://localhost/storage/event-photos/workshop-1.jpg",
        "caption": "Workshop session",
        "sort_order": 1,
        "uploaded_by_member": null,
        "created_at": "2026-05-23T10:00:00.000000Z"
      }
    ]
  }
}

If the event does not exist, is cancelled, or is not public:

{
  "message": "Event not found."
}

WordPress Integration Notes

  • Use /events/upcoming for the homepage upcoming event section.
  • Use /events/past for gallery or archive pages.
  • Use /events/types for filters.
  • Use /events/details?event_id=... or /events/{event_uuid} for the detail page.
  • Keep WEBSITE_API_KEY server-side in WordPress. Do not expose it in frontend JavaScript if possible.
  • If WordPress is calling the API from backend PHP, send the API key in X-Website-Api-Key.

Example WordPress request header:

X-Website-Api-Key: your_secret_key
Accept: application/json