Skip to main content
Calendar events are used for scheduling appointments, birthdays, and other important dates in the MKing Admin dashboard.

Event Object

id
string
Unique identifier for the event
title
string
required
Event title
description
string
Event description or notes
start
string | Date
required
Event start date/time (ISO 8601 format)
end
string | Date
required
Event end date/time (ISO 8601 format)
allDay
boolean
Whether the event is an all-day event (default: false)
color
string
Event color for calendar display (hex color code)
display
string
Display mode for the event (e.g., “auto”, “block”, “background”)

List Events

curl -X GET "${VITE_BASE_URL}/events?start=2024-01-01&end=2024-12-31" \
  -H "Authorization: Bearer <token>"
Retrieves all calendar events within an optional date range. Authentication Required: Yes

Query Parameters

start
string
Start date for filtering events (ISO 8601 format)
end
string
End date for filtering events (ISO 8601 format)

Response

data
array
Array of event objects (see Event Object schema above)
{
  "data": [
    {
      "id": "1",
      "title": "Team Meeting",
      "description": "Monthly team sync",
      "start": "2024-03-15T10:00:00Z",
      "end": "2024-03-15T11:00:00Z",
      "allDay": false,
      "color": "#1976d2"
    },
    {
      "id": "2",
      "title": "John's Birthday",
      "description": "Employee birthday celebration",
      "start": "2024-03-20",
      "end": "2024-03-20",
      "allDay": true,
      "color": "#ff9800"
    }
  ]
}

Create Event

curl -X POST "${VITE_BASE_URL}/events" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Client Meeting",
    "description": "Product demo with new client",
    "start": "2024-03-25T14:00:00Z",
    "end": "2024-03-25T15:00:00Z",
    "color": "#4caf50"
  }'
Creates a new calendar event. Authentication Required: Yes

Request Body

title
string
required
Event title
description
string
Event description or notes
start
string
required
Event start date/time (ISO 8601 format)
end
string
required
Event end date/time (ISO 8601 format)
allDay
boolean
Whether the event is an all-day event
color
string
Event color (hex color code)

Response

data
object
The created event object with assigned ID
{
  "data": {
    "id": "3",
    "title": "Client Meeting",
    "description": "Product demo with new client",
    "start": "2024-03-25T14:00:00Z",
    "end": "2024-03-25T15:00:00Z",
    "allDay": false,
    "color": "#4caf50"
  }
}

Update Event

curl -X PUT "${VITE_BASE_URL}/events/3" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Client Meeting - Rescheduled",
    "start": "2024-03-26T14:00:00Z",
    "end": "2024-03-26T15:00:00Z"
  }'
Updates an existing calendar event. Supports drag-and-drop rescheduling. Authentication Required: Yes

Path Parameters

id
string
required
Event ID

Request Body

All fields from the Event Object are optional. Only provided fields will be updated.

Response

data
object
The updated event object
{
  "data": {
    "id": "3",
    "title": "Client Meeting - Rescheduled",
    "description": "Product demo with new client",
    "start": "2024-03-26T14:00:00Z",
    "end": "2024-03-26T15:00:00Z",
    "allDay": false,
    "color": "#4caf50"
  }
}

Delete Event

curl -X DELETE "${VITE_BASE_URL}/events/3" \
  -H "Authorization: Bearer <token>"
Deletes a calendar event permanently. Authentication Required: Yes

Path Parameters

id
string
required
Event ID

Response

message
string
Success confirmation message
{
  "message": "Event deleted successfully"
}

Integration

Service Functions

The event service (src/services/event.service.ts) provides TypeScript functions for working with calendar events:
import { getEvents, createEvent, updateEvent, deleteEvent, CalendarEvent } from '@/services/event.service';

// List events with date range
const response = await getEvents('2024-01-01', '2024-12-31');

// Create event
const newEvent: CalendarEvent = {
  title: 'Team Meeting',
  start: new Date('2024-03-15T10:00:00Z'),
  end: new Date('2024-03-15T11:00:00Z'),
  color: '#1976d2'
};
await createEvent(newEvent);

// Update event
await updateEvent('1', { title: 'Updated Meeting Title' });

// Delete event
await deleteEvent('1');

FullCalendar Integration

Events are displayed using FullCalendar with Spanish localization (src/pages/Calendar/Calendar.tsx:18-42).
The calendar supports drag-and-drop event rescheduling, which automatically calls the update API.
Employee birthdays are automatically displayed on the calendar and show a celebration modal with confetti animation when clicked.

Calendar Feature

Learn about the calendar user interface

Employees

Employee birthdays appear on the calendar

Build docs developers (and LLMs) love