Create Calendar Event

Create a new calendar event for the authenticated user with customizable properties.

POST /calendar/create

Description

This endpoint creates a new calendar event for the authenticated user. The event is automatically assigned to the user via their API token. EventToken and UserToken are generated automatically.

Important: Events cannot be created in the past. The EventStartDate and EventStartTime must be in the future.

Authentication

This endpoint requires Bearer token authentication via the Authorization header.

Request Body

{ "EventTitle": "Team Meeting", "EventDescription": "Monthly team sync meeting", "EventLocation": "Conference Room A", "EventStartDate": "2026-02-20T10:00:00.000Z", "EventEndDate": "2026-02-20T12:00:00.000Z", "EventStartTime": "10:00", "EventEndTime": "12:00", "EventColor": "#FF5733", "EventAllDay": false, "EventStatus": false, "PrivateEvent": false, "SMSNotification": false, "Completed": false }
Required Parameters
Parameter Type Description
EventTitle string Title of the event
EventStartDate string Start date (ISO 8601 format)
EventEndDate string End date (ISO 8601 format)
Optional Parameters
Parameter Type Default Description
EventDescription string null Event description
EventLocation string null Event location
Latitude string null Location latitude
Longitude string null Location longitude
EventURL string null Event URL
EventStartTime string 00:00 Start time (HH:mm)
EventEndTime string 23:59 End time (HH:mm)
EventColor string #6CD9FF Event color (hex)
EventAllDay boolean false All day event flag
EventStatus boolean false Event status (busy/free)
PrivateEvent boolean false Private event flag
SMSNotification boolean false SMS notification flag
Completed boolean false Completion status
SweepstakesToken string "" Associated sweepstakes token
PeopleInvolved array [] List of people involved
RepeatThisEvent object {} Repeat configuration
Notification object {} Notification settings

Code Examples

curl -X POST "https://api-v3.sweeppea.com/calendar/create" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "EventTitle": "Team Meeting", "EventStartDate": "2026-02-20T10:00:00.000Z", "EventEndDate": "2026-02-20T12:00:00.000Z", "EventColor": "#FF5733" }'

Response

201 Created

{ "Response": true, "Message": "Calendar Event Created Successfully", "Data": { "_id": "696f74c08c20c5725ca2aa32", "EventToken": "bbc95fa1-0301-498e-bf97-e60fd286d9bc", "EventTitle": "Team Meeting", "EventDescription": "Monthly team sync meeting", "EventStartDate": "2026-02-20T10:00:00.000Z", "EventEndDate": "2026-02-20T12:00:00.000Z", "EventTimeZone": "1", ... } }

Error Responses

400 Bad Request

{ "Response": false, "Message": "EventTitle is Required", "Code": 400 }

400 Bad Request

{ "Response": false, "Message": "Cannot Create Events In The Past", "Code": 400 }

401 Unauthorized

{ "Response": false, "Message": "Invalid or Missing Bearer Token", "Code": 401 }

403 Forbidden

{ "Response": false, "Message": "Invalid API Token", "Code": 403 }

500 Internal Server Error

{ "Response": false, "Message": "Internal Server Error", "Code": 500 }