Upsert Calendar Events
POST
/users/{user_id}/calendar/events
const url = 'https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/calendar/events';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"events":[{"attendee_count":1,"calendar_id":"example","calendar_name":"example","ends_at":"2026-04-15T12:00:00Z","external_id":"example","is_all_day":false,"rsvp_status":"example","starts_at":"2026-04-15T12:00:00Z","status":"confirmed","title":"example"}],"window_end":"2026-04-15","window_start":"2026-04-15"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/calendar/events \ --header 'Content-Type: application/json' \ --data '{ "events": [ { "attendee_count": 1, "calendar_id": "example", "calendar_name": "example", "ends_at": "2026-04-15T12:00:00Z", "external_id": "example", "is_all_day": false, "rsvp_status": "example", "starts_at": "2026-04-15T12:00:00Z", "status": "confirmed", "title": "example" } ], "window_end": "2026-04-15", "window_start": "2026-04-15" }'Batch upsert calendar events from the client.
If window_start and window_end are provided, any events for this user whose starts_at falls within that window and whose external_id is NOT in the payload are deleted — covering calendar deletions and cancellations the client won’t send.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”user_id
required
User Id
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
CalendarEventBatchIngest
object
events
required
Events
Array<object>
CalendarEventIngestobject
ends_at
required
Ends At
string format: date-time
external_id
required
External Id
string
is_all_day
Is All Day
boolean
starts_at
required
Starts At
string format: date-time
status
Status
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
CalendarEventBatchResult
object
deleted
required
Deleted
integer
upserted
required
Upserted
integer
Examplegenerated
{ "deleted": 1, "upserted": 1}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}