# Google Calendar Events (`calendar.events`)

Lists the events of the connected Google Calendar in a time window, with attendees, locations and meeting links.

Docs: https://primaryapi.com/docs/api-reference/google-calendar/events

- Endpoint: `POST https://api.primaryapi.com/v1/run/calendar.events`
- Category: Knowledge & Data · Platform: `google-calendar` · Kind: list · Status: live
- Price: 1 credit per call. Every call costs the same, including calls that were retried automatically.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=calendar.events`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `calendarId` | string | no | "primary" | max 254 chars | Calendar id; "primary" (default) is the account’s main calendar. |
| `timeMin` | string | no |  | format: date-time | Start of the time window (RFC 3339 with offset, for example "2026-11-09T00:00:00Z"). Default: now. |
| `timeMax` | string | no |  | format: date-time | End of the time window (RFC 3339 with offset). Default: no end. |
| `query` | string | no |  | max 500 chars | Free-text search in event titles, descriptions, locations and attendees. |
| `timeZone` | string | no |  | max 64 chars | IANA time zone for the times in the response, for example "Europe/London" (default: the calendar’s). |
| `limit` | integer | no | 25 | 1–250 | Maximum number of results to return (1-250, default 25). |
| `cursor` | string | no |  |  | Opaque pagination cursor: pass the previous response's nextCursor. |
| `connection` | string | no |  | max 200 chars | Which connected account to use when the workspace has several for this provider: the customId you gave it (exact), its connection id ("con_…"), its handle (login, email or @handle) or its name. Optional; prefer the customId or id, which never match two accounts. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `events` | object[] |  |
| `events[].id` | string |  |
| `events[].status` | string \| null | confirmed, tentative or cancelled |
| `events[].summary` | string \| null | Event title |
| `events[].description` | string \| null |  |
| `events[].location` | string \| null |  |
| `events[].url` | string \| null | Opens the event in Google Calendar |
| `events[].start` | object |  |
| `events[].start.date` | string \| null | All-day events: the date (YYYY-MM-DD) |
| `events[].start.dateTime` | string \| null | Timed events: RFC 3339 date-time |
| `events[].start.timeZone` | string \| null |  |
| `events[].end` | object |  |
| `events[].end.date` | string \| null | All-day events: the date (YYYY-MM-DD) |
| `events[].end.dateTime` | string \| null | Timed events: RFC 3339 date-time |
| `events[].end.timeZone` | string \| null |  |
| `events[].allDay` | boolean |  |
| `events[].organizer` | object \| null |  |
| `events[].organizer.email` | string \| null |  |
| `events[].organizer.name` | string \| null |  |
| `events[].attendees` | object[] |  |
| `events[].attendees[].email` | string \| null |  |
| `events[].attendees[].name` | string \| null |  |
| `events[].attendees[].responseStatus` | string \| null | needsAction, declined, tentative or accepted |
| `events[].attendees[].optional` | boolean |  |
| `events[].recurringEventId` | string \| null |  |
| `events[].meetUrl` | string \| null | Video call link, when the event has one |
| `events[].eventType` | string \| null |  |
| `events[].created` | string \| null |  |
| `events[].updated` | string \| null |  |
| `timeZone` | string \| null | Time zone of the calendar |
| `nextCursor` | string \| null |  |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

Pagination: pass the previous response’s `nextCursor` as `cursor` to get the next page; `nextCursor: null` means there are no more results.

## Example request

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/calendar.events" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"timeMin":"2026-11-09T00:00:00Z","timeMax":"2026-11-16T00:00:00Z","limit":10}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "events": [
        {
          "id": "5a1b2c3d4e5f6g7h8i9j0k1l2m",
          "status": "confirmed",
          "summary": "Quarterly planning",
          "description": "Agenda: the Q4 numbers",
          "location": "Room 3",
          "url": "https://www.google.com/calendar/event?eid=NWExYjJjM2Q0ZTVmNmc3aDhpOWowazFsMm0",
          "start": {
            "date": null,
            "dateTime": "2026-11-09T10:00:00Z",
            "timeZone": "Europe/London"
          },
          "end": {
            "date": null,
            "dateTime": "2026-11-09T11:00:00Z",
            "timeZone": "Europe/London"
          },
          "allDay": false,
          "organizer": {
            "email": "ada@example.com",
            "name": "Ada Example"
          },
          "attendees": [
            {
              "email": "ada@example.com",
              "name": "Ada Example",
              "responseStatus": "accepted",
              "optional": false
            },
            {
              "email": "bob@example.com",
              "name": null,
              "responseStatus": "needsAction",
              "optional": true
            }
          ],
          "recurringEventId": null,
          "meetUrl": "https://meet.google.com/abc-defg-hij",
          "eventType": "default",
          "created": "2026-10-28T10:00:00.000Z",
          "updated": "2026-10-29T08:00:00.000Z"
        }
      ],
      "timeZone": "Europe/London",
      "nextCursor": null
    }
  },
  "provider": "PrimaryAPI",
  "credits": 1,
  "items": 1,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z",
  "nextCursor": null
}
```

## Pricing and reliability

- Usual price: 1 credit per call
- Price ceiling: the usual price, even when a call is retried. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=calendar.events`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

Runs as your connected Google account (read-only Calendar access). Recurring events are expanded into single occurrences and sorted by start time.

