Skip to main content
DELETE
/
calendar
/
disconnect
Disconnect Calendar
curl --request DELETE \
  --url https://api.meestream.ai/api/v1/calendar/disconnect \
  --header 'Authorization: <api-key>'
{
  "disconnected": true,
  "message": "<string>",
  "user_id": "<string>",
  "watch_channel_stopped": true,
  "events_deleted": 123,
  "schedules_cancelled": 123
}

Overview

Disconnects a user’s Google Calendar, stops all webhook channels, deletes all synced events, and cancels all scheduled bots. This operation performs a complete cleanup of all calendar-related data.

Request

Endpoint: DELETE /calendar/disconnect or POST /calendar/disconnect Headers:
Authorization: Token <api_key>
Request Body: None required

Response

Success Response (200)

{
  "disconnected": true,
  "user_id": "user_id",
  "watch_channel_stopped": true,
  "events_deleted": 15,
  "schedules_cancelled": 3,
  "message": "Calendar disconnected successfully. All events and scheduled bots have been removed."
}

Response Fields

FieldTypeDescription
disconnectedbooleanWhether the disconnection was successful
user_idstringThe user ID that was disconnected
watch_channel_stoppedbooleanWhether watch channels were stopped
events_deletedintegerNumber of events deleted from the Events table
schedules_cancelledintegerNumber of EventBridge schedules cancelled
messagestringSuccess message

Error Responses

400 Bad Request

No calendar connection found for the user.

401 Unauthorized

Missing user_id in token or invalid authentication.

404 Not Found

User not found.

500 Internal Server Error

An error occurred while disconnecting the calendar.

Cleanup Operations

The disconnect operation performs the following cleanup:
  1. Stops Google Calendar watch channels - Cancels all active webhook notifications
  2. Deletes all events - Removes all synced events from the Events table
  3. Cancels EventBridge schedules - Removes all scheduled bot triggers for the user
  4. Removes Google credentials - Clears OAuth credentials from the Users table
This operation is irreversible. All calendar events and scheduled bots will be permanently deleted.

Authorizations

Authorization
string
header
required

All API endpoints are authenticated using API Keys. The key should be included in the 'Authorization' header, prefixed with 'Token '. Example: 'Authorization: Token YOUR_API_KEY'.

Response

Calendar disconnected successfully.

disconnected
boolean
required

Whether the disconnection was successful

message
string
required

Success message

user_id
string

The user ID that was disconnected

watch_channel_stopped
boolean

Whether watch channels were stopped

events_deleted
integer

Number of events deleted from the Events table

schedules_cancelled
integer

Number of EventBridge schedules cancelled