Sweeppea API v3

Create Calendar Event

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

POST https://api-v3.sweeppea.com/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": true,
  "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 true (hardcoded) All events created via API v3 are private by default. Admins cannot see them. The user can make an event public by editing it in the calendar UI.
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

{
  "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

{
  "Response": false,
  "Message": "EventTitle is Required",
  "Help": {
    "ExpectedBody": {
      "EventTitle": "string (required) \u2014 title of the event",
      "EventStartDate": "string (required) \u2014 start date, ISO format YYYY-MM-DD",
      "EventEndDate": "string (required) \u2014 end date, ISO format YYYY-MM-DD. Cannot be in the past",
      "EventStartTime": "string (optional) \u2014 start time, HH:MM (24-hour)",
      "EventEndTime": "string (optional) \u2014 end time, HH:MM (24-hour)",
      "EventAllDay": "boolean (optional) \u2014 all-day event",
      "EventDescription": "string (optional) \u2014 description of the event",
      "EventLocation": "string (optional) \u2014 location of the event",
      "EventURL": "string (optional) \u2014 related URL",
      "EventColor": "string (optional) \u2014 colour used to render the event",
      "EventStatus": "string (optional) \u2014 status of the event",
      "SweepstakesToken": "string (optional) \u2014 UUID v4 of the sweepstakes",
      "PeopleInvolved": "array (optional) \u2014 people invited to the event",
      "Notification": "boolean (optional) \u2014 send an email notification",
      "SMSNotification": "boolean (optional) \u2014 send an SMS notification",
      "RepeatThisEvent": "string (optional) \u2014 recurrence rule",
      "Latitude": "number (optional) \u2014 latitude of the location",
      "Longitude": "number (optional) \u2014 longitude of the location"
    }
  },
  "Code": 400
}
{
  "Response": false,
  "Message": "Cannot Create Events In The Past",
  "Help": {
    "ExpectedBody": {
      "EventTitle": "string (required) \u2014 title of the event",
      "EventStartDate": "string (required) \u2014 start date, ISO format YYYY-MM-DD",
      "EventEndDate": "string (required) \u2014 end date, ISO format YYYY-MM-DD. Cannot be in the past",
      "EventStartTime": "string (optional) \u2014 start time, HH:MM (24-hour)",
      "EventEndTime": "string (optional) \u2014 end time, HH:MM (24-hour)",
      "EventAllDay": "boolean (optional) \u2014 all-day event",
      "EventDescription": "string (optional) \u2014 description of the event",
      "EventLocation": "string (optional) \u2014 location of the event",
      "EventURL": "string (optional) \u2014 related URL",
      "EventColor": "string (optional) \u2014 colour used to render the event",
      "EventStatus": "string (optional) \u2014 status of the event",
      "SweepstakesToken": "string (optional) \u2014 UUID v4 of the sweepstakes",
      "PeopleInvolved": "array (optional) \u2014 people invited to the event",
      "Notification": "boolean (optional) \u2014 send an email notification",
      "SMSNotification": "boolean (optional) \u2014 send an SMS notification",
      "RepeatThisEvent": "string (optional) \u2014 recurrence rule",
      "Latitude": "number (optional) \u2014 latitude of the location",
      "Longitude": "number (optional) \u2014 longitude of the location"
    }
  },
  "Code": 400
}
{
  "Response": false,
  "Message": "Missing or invalid Bearer token. Send your API token in the Authorization header as: Authorization: Bearer YOUR_API_TOKEN",
  "Code": 401
}
{
  "Response": false,
  "Message": "Invalid API token. It does not match any account.",
  "Code": 403
}
{
  "Response": false,
  "Message": "Internal server error. Please try again; if it persists, contact support with the time of this request.",
  "Code": 500
}
© Sweeppea. All rights reserved.