Calendar API
Connect a Google Calendar account and manage events, check availability, and schedule directly through the API.All calendar endpoints require an authenticated session. Use the connect flow to authorize Google Calendar access before calling event endpoints.
Authentication
All calendar endpoints require a valid NextAuth session. The user identity is derived from your session — you never pass auserId directly. Unauthenticated requests receive a 401 response.
Base URL
Check connection status
{ "connected": false } without an error.
Query parameters
Response
Connect calendar
Request body
Response
authUrl to begin the OAuth consent flow. After granting access, Google redirects to the callback endpoint below.
Errors
OAuth callback
Query parameters
Behavior
On success, this endpoint:- Verifies the HMAC signature on the
stateparameter and checks that it has not expired (10-minute window). - Exchanges the authorization code for access and refresh tokens.
- Retrieves the user’s primary calendar ID and timezone.
- Stores the connection for future API calls, keyed to the verified user from the signed state.
- Redirects to
/dashboard/calendar?connected=true.
Error redirects
If an error occurs, the endpoint redirects to/dashboard/calendar with an error query parameter: