Skip to main content

Overview

Removes a calendar connection for a specific user. This revokes your platform’s access to their calendar and sends a user.calendar.disconnected webhook to all platforms that had this user connected.

Authentication

Requires Platform API Key in the Authorization header or X-API-Key header.

Request

DELETE https://api.syncline.run/v1/calendars/{email}

Path Parameters

email
string
required
Email address of the user whose calendar connection should be removed (URL-encoded)Example: alice@example.comalice%40example.com

Response

Success Response (200 OK)

{
  "success": true,
  "message": "Calendar disconnected successfully",
  "email": "alice@example.com",
  "platform_id": "plat_xyz789"
}

Response Fields

success
boolean
Whether the disconnection succeeded
message
string
Human-readable success message
email
string
Email of the disconnected user
platform_id
string
Your platform’s ID

Multi-Platform Webhook Behavior

IMPORTANT: When a user is disconnected, the user.calendar.disconnected webhook is sent to ALL platforms that had this user connected, not just your platform.

Example Scenario

  1. alice@example.com is connected to 3 platforms:
    • Boardy (plat_boardy)
    • Luma (plat_luma)
    • Cal.com (plat_calcom)
  2. Boardy calls DELETE /v1/calendars/alice@example.com
  3. ALL 3 platforms receive the user.calendar.disconnected webhook:
{
  "id": "wh_def456",
  "event_type": "user.calendar.disconnected",
  "timestamp": "2025-11-21T15:45:00Z",
  "platform_id": "plat_boardy", // OR plat_luma, OR plat_calcom
  "api_version": "v1",
  "data": {
    "user_email": "alice@example.com",
    "google_id": "105942374304",
    "disconnected_at": "2025-11-21T15:45:00Z",
    "reason": "user_requested"
  }
}
This allows all platforms to update their internal records when a user revokes access.

Example

const userEmail = 'alice@example.com';
const encodedEmail = encodeURIComponent(userEmail);

const response = await fetch(`https://api.syncline.run/v1/calendars/${encodedEmail}`, {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

const result = await response.json();
if (result.success) {
  console.log(`Disconnected ${result.email}`);
}

Use Cases

User Privacy Request

Allow users to revoke calendar access:
async function handleUserDisconnectRequest(userEmail) {
  const encodedEmail = encodeURIComponent(userEmail);
  const response = await fetch(
    `https://api.syncline.run/v1/calendars/${encodedEmail}`,
    {
      method: 'DELETE',
      headers: { 'Authorization': `Bearer ${API_KEY}` }
    }
  );

  if (response.ok) {
    // Update UI to show disconnected state
    updateUserProfile(userEmail, { calendarConnected: false });
  }
}

Account Deletion

Disconnect calendar when user deletes their account:
async function deleteUserAccount(userId, userEmail) {
  // 1. Disconnect calendar
  await disconnectCalendar(userEmail);

  // 2. Delete user from your database
  await db.users.delete({ id: userId });

  // 3. Cancel any pending meetings
  await cancelAllUserMeetings(userId);
}

Administrative Removal

Platform admin removes a problematic user:
async function adminRemoveUser(userEmail, reason) {
  await disconnectCalendar(userEmail);
  await logAction({
    action: 'admin_disconnect',
    user: userEmail,
    reason: reason,
    timestamp: new Date()
  });
}

Notes

  • This action cannot be undone
  • User must reconnect via OAuth to restore access
  • Existing scheduled meetings are NOT automatically cancelled
  • OAuth tokens are permanently revoked
  • All platforms receive the disconnection webhook

Webhook Notification

When a calendar is disconnected, Syncline sends a user.calendar.disconnected webhook to all platforms:
{
  "id": "wh_def456",
  "event_type": "user.calendar.disconnected",
  "timestamp": "2025-11-21T15:45:00Z",
  "platform_id": "plat_xyz789",
  "api_version": "v1",
  "data": {
    "user_email": "alice@example.com",
    "google_id": "105942374304",
    "disconnected_at": "2025-11-21T15:45:00Z",
    "reason": "user_requested"
  }
}
Disconnect Reasons:
  • user_requested - User explicitly disconnected
  • token_expired - OAuth token could not be refreshed
  • revoked - User revoked access from Google
Learn more about webhooks

Error Responses

401 Unauthorized
error
Invalid or missing API key
404 Not Found
error
No calendar connection found for this user and platform
500 Internal Server Error
error
Failed to disconnect calendar