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
Whether the request succeeded
Array of calendar connection objects
Email address of the connected user
Google account ID for the user
connections[].calendar_provider
Calendar provider (currently only "google")
connections[].connected_at
ISO 8601 timestamp when the user first connected
connections[].last_used_at
ISO 8601 timestamp of last API usage for this user
connections[].onboarding_complete
Whether the user completed the onboarding flow
User’s configured timezone (IANA format)
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:
- Get their email from this endpoint
- Use their email in scheduling API calls
- 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
Invalid or missing API key
500 Internal Server Error
Failed to retrieve connections from database