AI agents and calendar credential recovery
Calendar API for AI Agents: Recover From Credential Revocation Without Guessing Availability
The buyer approved Thursday at 2. Then a required participant revoked calendar access before the agent committed. The dangerous implementation catches the auth error, substitutes an empty busy array, and books the meeting straight through a conflict. Credential loss is not availability. It is a change in what the agent can prove.
Recover a hard meeting from credential revocation in eight steps
Use one sixty-minute customer review with an organizer, three required people, and one optional observer across Google and Microsoft. A required participant’s refresh token stops working after two slots were proposed. The organizer’s calendar remains writable, and the participant may reconnect or answer without calendar sync.
- 1
Persist typed meeting intent and credential dependencies
Store meeting ID, revision, authenticated organizer, purpose, duration, bounded date range, booking deadline, IANA meeting zone, required and optional participants, approved substitutes, working-hour policy, organizer calendar, outreach authority, approval mode, and completion proof. For each calendar capability, record provider, account subject, tenant, granted permission class, encrypted credential reference, status, last successful refresh, and every meeting evidence object that depends on it.- Required and optional roles live in meeting state, never inside token metadata.
- Workers receive credential references and typed commands rather than tokens or raw instructions.
- One revoked grant can identify every availability snapshot, proposal, and pending write it affects.
- 2
Classify the failure before choosing recovery
An expired access token normally enters a single-flight refresh path. A token-endpoint response indicating an invalid, expired, or revoked grant can enterreauth_required. Keep insufficient scope, tenant policy, account removal, provider outage, throttling, and malformed requests separate. One calendar API 401 is a signal to authenticate or refresh; it is not by itself permission to erase the credential or contact the participant.- Store provider reason, request correlation, detection time, token generation, and redacted account identity.
- Bounded retries with jitter apply to transient transport or service failure, not a confirmed revoked grant.
- Refresh work is deduplicated so ten blocked meetings do not race ten token exchanges.
- 3
Quarantine dependent evidence without deleting history
Move the credential toreauth_required, stop new operations that need it, and mark affected free/busy snapshotsaccess_lost. Revoke proposals whose required-participant proof no longer meets freshness policy. Preserve prior intervals and provider errors as audit evidence, but exclude them from new overlap. Missing access, stale evidence, and an empty busy response are three different states.- The participant is never modeled as free because the provider could not be read.
- Unaffected Google, Microsoft, and conversational evidence remains usable under its own expiry.
- Queued event writes re-check credential state, meeting revision, approval, and evidence before dispatch.
- 4
Select recovery by capability and participant role
Build a recovery plan from the lost capability. A required person’s availability read can recover through provider re-consent or consent-safe bounded availability. An optional person can be omitted only under the organizer’s declared policy. Loss of the organizer’s event-write grant cannot be covered by somebody else’s availability reply; pause commit until the organizer reconnects or an already-authorized delegate calendar is selected.- Recovery never changes required attendance, organizer identity, or booking authority by inference.
- Calendar sync remains optional for participant availability, not for a provider write that policy requires.
- The organizer sees the affected person, capability, deadline risk, and available safe paths.
- 5
Run re-consent as a narrow, trusted operation
Create one expiring re-consent task tied to credential subject, meeting revision, required permission class, redirect state, and return location. Send it only through an approved channel, explain the limited scheduling purpose, and route the user to the provider authorization surface. Keep authorization codes, refresh tokens, and access tokens out of prompts, analytics, URLs, participant messages, and model-visible traces.- A repeated recovery command returns the existing re-consent task instead of sending another request.
- The callback verifies state, account subject, tenant, granted permissions, and current meeting ownership.
- Denial, different-account consent, expired state, and admin-policy block each produce a typed next action.
- 6
Collect bounded availability when sync stays optional
When outreach is authorized, ask only for windows inside the meeting date range. Include organizer, purpose at the approved disclosure level, duration, participant-local dates, named IANA zone, response deadline, correction path, reminder cap, and opt-out. Normalize the reply into versioned intervals with source, consent, received time, zone, confidence, and expiry. Ask one narrow clarification when the date or zone is ambiguous.- Silence blocks a required participant and never becomes an all-day opening.
- A participant can decline calendar connection while still answering for this one meeting.
- Re-consent and availability outreach share one recovery case so parallel paths cannot spam the person.
- 7
Restore evidence, recompute, and commit once
After re-consent, perform a fresh bounded free/busy read and attach a new credential generation; do not resurrect old evidence merely because access returned. If conversational windows arrived first, keep them as separate evidence until expiry and apply declared source policy. Recompute required overlap, then optional attendance, working hours, buffers, and time-zone fairness. Bind approval to the resulting meeting revision, slot, attendees, evidence versions, and organizer calendar.- A later provider read can invalidate fallback-based proposals without rewriting the participant’s reply.
- One booking idempotency key covers the approved meeting revision and slot.
- If a write outcome is uncertain, recover access and reconcile provider state before another insert.
- 8
Verify completion and preserve the recovery trail
Read back the canonical event with authorized access and verify start, end, zone, organizer, every required attendee, the optional-attendee decision, provider event identity, and invitation dispatch state. Close the recovery case only after that proof or an authorized terminal exception. Trace classification, quarantined evidence, user decisions, outreach, retries, recomputation, approval, write, reconciliation, and read-back with private content redacted.- A successful token exchange is recovery progress, not meeting completion.
- Support can name the blocked capability, evidence age, recovery owner, deadline, and safe next action.
- Metrics separate time to detect, time to re-consent, fallback completion, abandoned recovery, and verified booking.
Revocation changes proof, not the participant’s calendar
OAuth revocation removes the application’s authority to use a token or grant. It does not prove that the participant deleted every event, became free, or withdrew from the meeting. Your scheduling model needs separate states for credential health, availability evidence, meeting role, outreach consent, and booking authority.
That separation also prevents overreaction. A routine access-token expiry may recover silently through the refresh flow. A confirmed revoked refresh grant needs user interaction. A provider outage needs bounded retry. A changed tenant policy may need an administrator. Converting all four into ‘calendar disconnected’ destroys the next-action signal.
Use a revocation state machine instead of an auth-error loop
A practical credential path is active → refresh_pending → active for ordinary renewal and active → suspect → reauth_required → restoring → active when authority is lost. The meeting can separately move through evidence_blocked, fallback_collecting, ready_to_recompute, and commit_pending.
Do not let the language model own those transitions. Provider adapters classify raw errors. Deterministic policy decides whether to retry, quarantine, re-consent, ask for bounded windows, wait, or escalate. The model can explain the choice and parse a reply; it cannot convert authentication failure into free time.
Credential recovery is not another scheduling surface
A poll collects votes. A booking link presents configured slots. A calendar-sync utility copies availability between accounts. A drafting assistant can write a reconnect note. Direct calendar APIs read and write provider resources. Each can help while leaving the active meeting, evidence invalidation, recovery choice, cross-company overlap, safe commit, and invitation proof to your application.
Scheduling execution owns the instruction through the interruption to a verified outcome. The distinctive requirement here is continuity: preserve one meeting identity while the evidence source changes, without lowering required attendance or reopening every participant thread.
Run the mid-meeting revocation acceptance test
Create two proposed slots from fresh Google and Microsoft free/busy plus one bounded reply. Revoke a required Microsoft grant, duplicate the refresh failure, deny the first re-consent attempt, accept conversational windows in another IANA zone, reconnect a different Microsoft account, approve the corrected account, and hide the final event-write response.
Pass when one recovery case forms, affected proposals stop, unavailable access never becomes free time, outreach stays within consent, the wrong account is rejected, fresh evidence recomputes overlap, duplicate writes collapse, uncertain state reconciles, and one invitation set is verified. Fail when the agent books from the last calendar snapshot because it was convenient.
Compare credential recovery by whether the meeting survives
Refreshing a token is one operation. Recovering a hard meeting means preserving roles, consent, evidence, deadlines, side effects, and proof while calendar authority changes.
| Decision vector | Direct Google and Microsoft APIs | Custom scheduling recovery layer | WonderCal execution direction |
|---|---|---|---|
| Execution completion | Exposes token and calendar operations; the application still owns proposal invalidation, approval, commit, reconciliation, and invitation proof. | Can carry the meeting through revocation when credential and evidence state are built beside the scheduling workflow. | Target path preserves one meeting through recovery to verified invitations or a bounded exception. |
| Cross-company reach | Each provider account, tenant rule, delegate, and external participant path stays in application code. | Supports the providers, tenants, identity rules, and participant channels the team builds. | Designed for required and optional people across Google, Microsoft, companies, and mixed access states. |
| Optional-sync fallback | Provider authorization can be renewed, but APIs do not collect a bounded human answer when connection is declined. | Can join re-consent and conversational availability after consent, parsing, time zones, reminders, and expiry are implemented. | Target model treats connection as helpful and bounded participant availability as a first-class recovery source. |
| Recovery and observability | Provider errors and request logs are available; meeting-wide evidence impact and safe next action need more state. | Maximum control with credential generations, dependency tracking, idempotency, redaction, operator repair, and upkeep. | Target release should expose recovery state, affected evidence, participant waits, retries, write reconciliation, and terminal proof. |
| Time to ship | Fast for token refresh and one provider; mid-meeting continuity remains application work. | Rational when credential recovery and hard-meeting operations are infrastructure the team wants to own. | Worth adopting when the live contract removes that recovery layer without hiding provider authority or incomplete meetings. |
Execution completion
Direct Google and Microsoft APIs
Exposes token and calendar operations; the application still owns proposal invalidation, approval, commit, reconciliation, and invitation proof.
Custom scheduling recovery layer
Can carry the meeting through revocation when credential and evidence state are built beside the scheduling workflow.
WonderCal execution direction
Target path preserves one meeting through recovery to verified invitations or a bounded exception.
Cross-company reach
Direct Google and Microsoft APIs
Each provider account, tenant rule, delegate, and external participant path stays in application code.
Custom scheduling recovery layer
Supports the providers, tenants, identity rules, and participant channels the team builds.
WonderCal execution direction
Designed for required and optional people across Google, Microsoft, companies, and mixed access states.
Optional-sync fallback
Direct Google and Microsoft APIs
Provider authorization can be renewed, but APIs do not collect a bounded human answer when connection is declined.
Custom scheduling recovery layer
Can join re-consent and conversational availability after consent, parsing, time zones, reminders, and expiry are implemented.
WonderCal execution direction
Target model treats connection as helpful and bounded participant availability as a first-class recovery source.
Recovery and observability
Direct Google and Microsoft APIs
Provider errors and request logs are available; meeting-wide evidence impact and safe next action need more state.
Custom scheduling recovery layer
Maximum control with credential generations, dependency tracking, idempotency, redaction, operator repair, and upkeep.
WonderCal execution direction
Target release should expose recovery state, affected evidence, participant waits, retries, write reconciliation, and terminal proof.
Time to ship
Direct Google and Microsoft APIs
Fast for token refresh and one provider; mid-meeting continuity remains application work.
Custom scheduling recovery layer
Rational when credential recovery and hard-meeting operations are infrastructure the team wants to own.
WonderCal execution direction
Worth adopting when the live contract removes that recovery layer without hiding provider authority or incomplete meetings.
Frequently asked questions
How should an AI scheduling agent handle calendar OAuth token revocation?
Should every calendar API 401 trigger re-consent?
Can scheduling continue when a required participant revokes access?
How do idempotency and retries work during credential recovery?
Is WonderCal credential recovery available now?
Primary sources
- RFC 7009: OAuth 2.0 Token Revocation — IETF revocation endpoint behavior, token invalidation, related authorization grants, and revocation responses
- Google: Using OAuth 2.0 to Access Google APIs — official Google reasons a refresh token can stop working and guidance to anticipate loss of access
- Microsoft identity platform: Refresh tokens — official Microsoft token lifetime, replacement, revocation triggers, secure storage, and interactive reauthentication guidance
- Google Calendar API: Freebusy query — official bounded free/busy request, time-zone, busy-interval, permission, and per-calendar error fields
- Microsoft Graph: calendar getSchedule — official Microsoft availability operation, least-privileged permission, schedule interval, and time-zone behavior
Pull access during the acceptance test
Revoke one required calendar after proposal, decline one reconnect, recover through bounded availability, hide the write response, and demand one verified invitation set.
Review WonderCal for AI agents