REST
scheduling

Google Calendar

List calendars and events, create events, and look up events by ID.

Connect Google Calendar

Go to /dashboard/connections and click Connect on the Google Calendar card to grant OAuth access.

Example

Create a 30-minute team standup on the user's primary calendar.

app/api/standup/route.ts
import { Leash } from '@leash/sdk/leash'
import { NextRequest } from 'next/server'
export async function POST(req: NextRequest) {
const leash = new Leash({ request: req })
const event = await leash.integrations.calendar.createEvent({
calendarId: 'primary',
summary: 'Team standup',
description: 'Daily sync',
start: { dateTime: '2026-05-13T09:00:00-04:00' },
end: { dateTime: '2026-05-13T09:30:00-04:00' },
attendees: [
{ email: 'alice@company.com' },
{ email: 'bob@company.com' },
],
})
// event =>
// {
// id: 'q1a2b3c4...',
// htmlLink: 'https://www.google.com/calendar/event?eid=...',
// summary: 'Team standup',
// status: 'confirmed',
// start: { dateTime: '2026-05-13T09:00:00-04:00' },
// end: { dateTime: '2026-05-13T09:30:00-04:00' }
// }
return Response.json(event)
}

Available methods

  • listCalendars() — every calendar the user can see.
  • listEvents(params?) — events with timeMin/timeMax/query filters.
  • createEvent({ summary, start, end, attendees?, ... }) — book a new event.
  • getEvent(eventId, calendarId?) — fetch a single event.

Common gotchas

  • Times must be RFC 3339 with timezone offset. Naked timestamps without Z or +HH:MM are rejected.
  • Recurring events expand only when singleEvents: true on listEvents. Otherwise you get the master event with an RRULE.
  • Adding attendees needs https://www.googleapis.com/auth/calendar.events — the broader scope, not calendar.readonly.

See the Google Calendar API reference for the underlying provider docs.

Other languages: see SDK overview for Python and Go.