Design note — Calendly booking adapter (calendly)
Target registry item: C2a (booking adapters under the system-of-record door, OB-GAP-3 / SO-1). Status: design note only — NOT in CONNECTOR_CATALOG; nothing built; available: false until live verification (CDoD point 14). CDoD points are tracked in docs/reports/ONBOARDING_CONNECTORS_STATE.md.
Auth
Calendly API v2 offers OAuth 2.0 (an authorization-server metadata document is published) and the API "reads and writes Scheduling, Contacts, and Notetaker data" with webhooks for the same (fetched 2026-10-12). Two admissible paths:
- Personal access token typed on the card (preferred for the first tenant). Tenant-owned, generated by the tenant in their Calendly account; stored in the vault; the adapter makes GET calls only. Whether PATs can be scoped read-only was not confirmed — see Scopes.
- Platform OAuth app (fallback). A platform OAuth client registered with Calendly on Track O. It is an operator registration, not an app-review programme as far as the fetched page shows; still platform-owned and therefore never on a tenant form.
Vault-only per (tenant, provider); no environment fallback; vault error → 503; absent → merchant_credentials_not_configured; organization / user URI in a request is a confirmation against the declared one, never an override.
Fields (catalog row, when built)
| key | label | secret | required | pattern | help |
|---|---|---|---|---|---|
personal_access_token |
Personal access token | yes | yes (path 1) | — | Created in Calendly → Integrations → API & Webhooks. Read access is all the platform uses. |
organization_uri |
Organization | no | no | ^https://api\.calendly\.com/organizations/[A-Za-z0-9-]+$ |
Confirms which organization's events are read; discovered from the token on Test connection and shown back — never typed from memory. |
Scopes
Read-only by adapter construction: only GET on scheduled events, invitees and event types; no booking, cancellation or webhook-write call is imported or constructed (rule-01 style test). Whether Calendly PATs or OAuth grants carry scope granularity was not confirmed from the fetched page — verify at build (CDoD point 1) and, if no read-only scope exists, say so on the card help text (the Mailchimp posture).
Webhook subscriptions (push of invitee.created / invitee.canceled) are a second increment: creating a subscription is a WRITE, so it is excluded from v1 and needs its own line in this note before it is built.
Data topics
appointment_booked, appointment_cancelled (invitee events) by event type / date; event-type catalogue (names, durations — configuration data).
Consent posture
| topic | posture |
|---|---|
| invitee identity (name, email, questions/answers) | person-level: subject key hashed under the tenant salt; basis from the tenant's declared default; evaluate_consent fail-closed; no basis → dropped and counted; questions/answers free text NEVER mapped |
| counts by event type/day | de-personalised remainder |
| Notetaker / Contacts data | out of scope entirely; never requested, never read |
Mapper target
MAPPERS["system_of_record:calendly"] → JourneyEvent / MarketSignal counts → ingest_gate → mizoki_unified_data. Shares the door's mapper contract with the CSV path. No new store.
Failure modes → test-connection verdicts
| Failure | Verdict / fix |
|---|---|
| Token invalid / revoked | credentials_revoked → "Create a new personal access token in Calendly and save it here." |
| Token valid but organization differs from the declared one | account_not_granted → shows the discovered organization; the tenant corrects the declaration |
| Plan without API access (if Calendly gates it) | plan_not_eligible with the vendor's own message; nothing stored as healthy |
| Rate limited | test_rate_limited (existing verdict) |
| Vault read error | 503 fail-closed |
Flag
CALENDLY_SYNC default OFF; catalog row available: false until a real scheduled event round-trips into mizoki_unified_data with date and revision recorded (CDoD point 14).
Owner / operator gates
- Owner: none beyond SO-1's scoping of the door.
- Operator (path 2 only): register the platform OAuth client with Calendly; store client id/secret by env NAME on the connectors service. Not needed for path 1.
Vendor references
- Calendly developer docs landing — https://developer.calendly.com/api-docs — fetched 2026-10-12 (REST v2 reads/writes Scheduling, Contacts, Notetaker; webhooks; OAuth authorization-server metadata at
calendly.com/.well-known/oauth-authorization-server; OpenAPI spec URL). - Calendly OpenAPI spec (endpoints, security schemes), PAT scoping, and plan eligibility for API/webhooks — not re-fetched from this sandbox on 2026-10-12.