---
title: "Sync a host's calendar"
description: "Let a call's host block its times with their Google Calendar or a calendar feed, and write each booking into their Google Calendar."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync a host's calendar

A call's host rarely keeps their week in Sherpo alone. Each member of the store can connect their own calendars: a Google Calendar, whose busy times block calls and which takes their bookings, and any calendar feed (an `.ics` or `webcal` address, such as the one Outlook or Apple Calendar publishes) whose events block calls. A calendar product then names which connections block it and which one its bookings are written into. A call whose product books its own slots offers none over those busy times (see [Read and move call bookings](/merchant-api/guides/call-bookings)). This guide uses the `sherpo` helper from [your first call](/merchant-api/first-call) and a token with `product:write`; listing the connections needs `product:read` alone.

## Connect a calendar feed

<a href="/merchant-api/reference/add-calendar-feed/">`POST /calendar_connections/feeds`</a> connects one of your own feeds. The address must be `https` (a `webcal` one is read as `https`) on a public host, the same rules a [webhook](/merchant-api/guides/receive-webhooks) endpoint follows:

```bash
curl -X POST 'https://api.sherpo.io/merchant/v1/stores/STORE_ID/calendar_connections/feeds' \
  -H "Authorization: Bearer $SHERPO_TOKEN" \
  -H 'Idempotency-Key: feed-work-calendar' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "webcal://calendar.example.com/ada/busy.ics"
}'
```

```js
const answer = await sherpo('POST', '/v1/stores/STORE_ID/calendar_connections/feeds', {
  body: {
    "url": "webcal://calendar.example.com/ada/busy.ics"
  },
  key: 'feed-work-calendar',
});
```

Answers `200`, abridged:

```json
{
  "id": "8d3f1b6a-2e4c-4f9a-b7d1-5c0e9a3f6b2d",
  "kind": "ics",
  "user_id": "user_3f8a2c1e9b7d4a6f",
  "account": null,
  "feed_host": "calendar.example.com",
  "can_write": false,
  "status": "syncing",
  "error": null,
  "synced_at": null,
  "created_at": "2026-11-19T09:00:00.000Z"
}
```

A feed's address often works as its password, so Sherpo keeps it encrypted and never answers it back: a connection shows only its `feed_host`. Each member connects a few feeds of their own, and a store holds a limited number of connections in all; past either, the call answers `conflict`.

The feed is read at once, then every 15 minutes, looking ahead as far as the calls it blocks can be booked. Every event counts as busy, repeating ones included, except those marked free or cancelled, and so does every busy period a published free/busy block lists. A feed that can't be read keeps its last busy times, so nothing is booked over them, and its connection says why in `error`:

- `unreachable`: the host didn't answer, or answered with an error.
- `refused`: an address Sherpo never reads, a redirect to one included.
- `too_large`: the file, or the busy times it holds, is more than Sherpo keeps.
- `not_calendar` or `unreadable`: the file isn't a calendar, is cut short, holds a time Sherpo can't place, or repeats an event by a rule Sherpo doesn't expand (one repeating by the hour or by week number, or more often than Sherpo reads, say).

## Connect a Google Calendar

A Google Calendar is connected in the merchant app, from the member's own browser, since Google asks them to consent there. Sherpo asks only to see their busy times and to manage the events of the calendars they own, and writes nothing but the bookings. If the member doesn't let Sherpo manage events, or Google later refuses a booking for want of that access, the connection blocks calls but takes no bookings: `can_write` is `false` until they connect it again. A Google account is connected once per store, by one member; connecting it again replaces its access in place, and connecting another account replaces the member's last one.

Google Calendars are read every 10 minutes. When Google stops answering for a connection, because the member took Sherpo's access back in their Google account, it reads `revoked`: its last busy times keep blocking calls, and no booking is written, until the member connects it again.

## See the connections

<a href="/merchant-api/reference/list-calendar-connections/">`GET /calendar_connections`</a> lists every connection on the store, whoever made it:

```bash
curl 'https://api.sherpo.io/merchant/v1/stores/STORE_ID/calendar_connections' \
  -H "Authorization: Bearer $SHERPO_TOKEN"
```

```js
const answer = await sherpo('GET', '/v1/stores/STORE_ID/calendar_connections');
```

Answers `200`, abridged:

```json
{
  "connections": [
    {
      "id": "4b9e2d7f-1a6c-4e3b-8f5d-0c2a7e9b4d1f",
      "kind": "google",
      "user_id": "user_3f8a2c1e9b7d4a6f",
      "account": "ada@example.com",
      "feed_host": null,
      "can_write": true,
      "status": "ok",
      "error": null,
      "synced_at": "2026-11-19T09:10:00.000Z",
      "created_at": "2026-11-18T16:00:00.000Z"
    },
    {
      "id": "8d3f1b6a-2e4c-4f9a-b7d1-5c0e9a3f6b2d",
      "kind": "ics",
      "user_id": "user_3f8a2c1e9b7d4a6f",
      "account": null,
      "feed_host": "calendar.example.com",
      "can_write": false,
      "status": "failing",
      "error": "unreachable",
      "synced_at": "2026-11-19T09:15:00.000Z",
      "created_at": "2026-11-19T09:00:00.000Z"
    }
  ]
}
```

A connection reads while its member sits on the business. Once they leave, it reads `unseated`: their calendar stops blocking calls and takes no bookings, so name another on the calls it served.

## Name them on a call

A calendar product takes `settings.calendar.sync` on <a href="/merchant-api/reference/update-product/">`PATCH /products/{product}`</a>: `busy` lists the connections whose busy times block it, and `bookings` names the Google connection each booking is written into. Any other category answers `invalid` at `settings.calendar.sync`:

```bash
curl -X PATCH 'https://api.sherpo.io/merchant/v1/stores/STORE_ID/products/2c7e9a4b-5d1f-4b8a-9e3c-6a0d2f4b8c1e' \
  -H "Authorization: Bearer $SHERPO_TOKEN" \
  -H 'Idempotency-Key: sync-intro-call' \
  -H 'Content-Type: application/json' \
  -d '{
  "settings": {
    "calendar": {
      "sync": {
        "busy": [
          "4b9e2d7f-1a6c-4e3b-8f5d-0c2a7e9b4d1f",
          "8d3f1b6a-2e4c-4f9a-b7d1-5c0e9a3f6b2d"
        ],
        "bookings": "4b9e2d7f-1a6c-4e3b-8f5d-0c2a7e9b4d1f"
      }
    }
  }
}'
```

```js
const answer = await sherpo('PATCH', '/v1/stores/STORE_ID/products/2c7e9a4b-5d1f-4b8a-9e3c-6a0d2f4b8c1e', {
  body: {
    "settings": {
      "calendar": {
        "sync": {
          "busy": [
            "4b9e2d7f-1a6c-4e3b-8f5d-0c2a7e9b4d1f",
            "8d3f1b6a-2e4c-4f9a-b7d1-5c0e9a3f6b2d"
          ],
          "bookings": "4b9e2d7f-1a6c-4e3b-8f5d-0c2a7e9b4d1f"
        }
      }
    }
  },
  key: 'sync-intro-call',
});
```

Answers `200`, abridged:

```json
{
  "id": "2c7e9a4b-5d1f-4b8a-9e3c-6a0d2f4b8c1e",
  "category": "calendar",
  "settings": {
    "calendar": {
      "sync": {
        "busy": [
          "4b9e2d7f-1a6c-4e3b-8f5d-0c2a7e9b4d1f",
          "8d3f1b6a-2e4c-4f9a-b7d1-5c0e9a3f6b2d"
        ],
        "bookings": "4b9e2d7f-1a6c-4e3b-8f5d-0c2a7e9b4d1f"
      }
    }
  }
}
```

Each id must be a connection on the store, named once, and `bookings` one with `can_write`; anything else answers `invalid` at its own path. A patch replaces `busy` whole, and `"bookings": null` writes bookings nowhere. Anyone who may write the catalog can name any member's connection, so agree with your team whose calendar a call books into. Naming a connection, or letting a call book further ahead, reads the whole horizon again at once.

A booking's event shows its time and title in the host's calendar, and Google sends no invitation. The same calendar makes each booking's Google Meet when the call asks for one (see [Give calls a meeting link](/merchant-api/guides/meeting-links)). When a booking moves, its event moves with it; when it's cancelled, or the call writes its bookings elsewhere, the event is removed. A booking owed while its calendar can't take one goes once the calendar reads again.

## Remove one

<a href="/merchant-api/reference/remove-calendar-connection/">`DELETE /calendar_connections/{connection}`</a> removes a connection, whoever made it. Its busy times stop blocking calls at once, and Sherpo forgets its access. A call that still names it reads it as none, and a write naming it again answers `invalid`:

```bash
curl -X DELETE 'https://api.sherpo.io/merchant/v1/stores/STORE_ID/calendar_connections/8d3f1b6a-2e4c-4f9a-b7d1-5c0e9a3f6b2d' \
  -H "Authorization: Bearer $SHERPO_TOKEN" \
  -H 'Idempotency-Key: remove-work-calendar'
```

```js
const answer = await sherpo('DELETE', '/v1/stores/STORE_ID/calendar_connections/8d3f1b6a-2e4c-4f9a-b7d1-5c0e9a3f6b2d', {
  key: 'remove-work-calendar',
});
```

Answers `200`, abridged:

```json
{
  "id": "8d3f1b6a-2e4c-4f9a-b7d1-5c0e9a3f6b2d",
  "removed": true
}
```

Removing a Google connection leaves the events it wrote, and leaves Sherpo listed in the member's Google account, since Google would end Sherpo's access everywhere the account is connected: the member takes it back there when they want to.

Source: https://docs.sherpo.io/merchant-api/guides/calendar-sync/index.mdx
