Calendar API
Connect a Google Calendar account and manage events, check availability, and schedule directly through the API.Most calendar endpoints require a connected Google Calendar account. Use the connect flow to authorize access before calling event endpoints.
Base URL
Connect calendar
Request body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be connect |
userId | string | Yes | Your user identifier |
Response
authUrl to begin the OAuth consent flow. After granting access, Google redirects to the callback endpoint below.
Errors
| Code | Description |
|---|---|
| 400 | Invalid action |
OAuth callback
Query parameters
| Parameter | Type | Description |
|---|---|---|
code | string | Authorization code provided by Google |
state | string | The userId passed during the connect flow |
error | string | Error code if the user denied access or an error occurred |
Behavior
On success, this endpoint:- 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.
- Redirects to
/dashboard/calendar?connected=true.
Error redirects
If an error occurs, the endpoint redirects to/dashboard/calendar with an error query parameter:
| Redirect query | Description |
|---|---|
error=<google_error> | The user denied access or Google returned an error |
error=no_code | No authorization code was present in the callback |
error=token_failed | The authorization code could not be exchanged for tokens |
error=unknown | An unexpected error occurred during the callback |
Start OAuth (redirect)
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be auth |
List events
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be list |
userId | string | Yes | Your user identifier |
start | string | No | ISO 8601 start date. Defaults to now. |
end | string | No | ISO 8601 end date. Defaults to 30 days from now. |
Response
Errors
| Code | Description |
|---|---|
| 401 | Calendar not connected |
Check availability
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be availability |
userId | string | Yes | Your user identifier |
date | string | No | Date in YYYY-MM-DD format. Defaults to today. |
Response
Errors
| Code | Description |
|---|---|
| 401 | Calendar not connected |
Create event
Request body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be create-event |
userId | string | Yes | Your user identifier |
title | string | Yes | Event title |
start | string | Yes | ISO 8601 start time |
end | string | Yes | ISO 8601 end time |
description | string | No | Event description |
location | string | No | Event location |
attendees | string[] | No | List of attendee email addresses |
Example request
Response
Errors
| Code | Description |
|---|---|
| 401 | Calendar not connected |
| 500 | Internal error |
Update event
Request body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be update-event |
userId | string | Yes | Your user identifier |
eventId | string | Yes | ID of the event to update |
title | string | No | Updated event title |
description | string | No | Updated description |
start | string | No | Updated start time (ISO 8601) |
end | string | No | Updated end time (ISO 8601) |
location | string | No | Updated location |
Response
Errors
| Code | Description |
|---|---|
| 401 | Calendar not connected |
| 500 | Internal error |
Delete event
Request body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be delete-event |
userId | string | Yes | Your user identifier |
eventId | string | Yes | ID of the event to delete |
Response
Errors
| Code | Description |
|---|---|
| 401 | Calendar not connected |
| 500 | Internal error |
Quick add
Request body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be quick-add |
userId | string | Yes | Your user identifier |
text | string | Yes | Natural language event description (for example, "Meeting with Sarah tomorrow at 3pm") |
Response
Errors
| Code | Description |
|---|---|
| 401 | Calendar not connected |
| 500 | Internal error |