Skip to main content

Overview

Retrieves all calendar connections associated with your platform. This shows which users have authorized their Google Calendar through your integration.

Authentication

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

Request

GET https://api.syncline.run/v1/calendars

No Parameters Required

This endpoint returns all calendar connections for the authenticated platform.

Response

Success Response (200 OK)

{
  "success": true,
  "connections": [
    {
      "user_email": "alice@example.com",
      "google_id": "105942374304",
      "calendar_provider": "google",
      "connected_at": "2025-11-20T10:30:00Z",
      "last_used_at": "2025-11-21T14:22:00Z",
      "onboarding_complete": true,
      "timezone": "America/Los_Angeles"
    },
    {
      "user_email": "bob@example.com",
      "google_id": "105942374305",
      "calendar_provider": "google",
      "connected_at": "2025-11-19T08:15:00Z",
      "last_used_at": "2025-11-21T09:30:00Z",
      "onboarding_complete": true,
      "timezone": "America/New_York"
    }
  ],
  "count": 2
}

Response Fields

success
boolean
Whether the request succeeded
connections
array
Array of calendar connection objects
connections[].user_email
string
Email address of the connected user
connections[].google_id
string
Google account ID for the user
connections[].calendar_provider
string
Calendar provider (currently only "google")
connections[].connected_at
string
ISO 8601 timestamp when the user first connected
connections[].last_used_at
string
ISO 8601 timestamp of last API usage for this user
connections[].onboarding_complete
boolean
Whether the user completed the onboarding flow
connections[].timezone
string
User’s configured timezone (IANA format)
count
number
Total number of connections returned

Example

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

const result = await response.json();
console.log(`Connected users: ${result.count}`);
result.connections.forEach(conn => {
  console.log(`- ${conn.user_email} (${conn.timezone})`);
});

Security Note

OAuth tokens are sanitized - This endpoint does not return OAuth access tokens or refresh tokens. It only returns connection metadata for security reasons. To use a user’s calendar:
  1. Get their email from this endpoint
  2. Use their email in scheduling API calls
  3. Syncline handles OAuth token management internally

Use Cases

Track Active Users

Monitor which users have connected their calendars:
const { connections } = await listCalendars();
const activeUsers = connections.filter(c => c.onboarding_complete);
console.log(`${activeUsers.length} active users`);

User Onboarding Status

Check if specific users have completed setup:
const { connections } = await listCalendars();
const user = connections.find(c => c.user_email === 'alice@example.com');
if (user && !user.onboarding_complete) {
  console.log('User needs to complete onboarding');
}

Analytics Dashboard

Build dashboards showing connection statistics:
const { connections, count } = await listCalendars();
const timezones = connections.map(c => c.timezone);
const mostCommon = timezones.reduce((acc, tz) => {
  acc[tz] = (acc[tz] || 0) + 1;
  return acc;
}, {});

Error Responses

401 Unauthorized
error
Invalid or missing API key
500 Internal Server Error
error
Failed to retrieve connections from database