
Google Calendar
Connect a Google account and your agents can check availability and book, reschedule or cancel meetings during a call.
Beta
This connector is in beta. It works end to end and is safe to use on real calendars, but the surface can still change before general availability, so do not pin automation to exact tool names or response shapes yet.
How it works
Connect a Google account once, choose which agents may use it, and give each one a read or a write grant. During a call the agent can check availability and offer open times, and with write it can also book, reschedule and cancel, all as ordinary events you can see in Google Calendar. The grant is the whole story, and everything below follows from it.
Connect a calendar
Connecting is an OAuth consent flow, so it needs a browser once: the calendar owner approves the access at Google. Aethex gives you the URL to send them to, and you never see their credentials. The authorize and grant calls need an API key with integrations:write; reading connections needs integrations:read.
Ask for a consent URL
Returns the Google URL to open. It is single-use and valid for 10 minutes, so generate it when the person is ready to click.
bashcurl -X POST https://api.aethexai.com/api/v1/integrations/google_calendar/authorize \ -H "X-API-Key: $AETHEX_API_KEY" # { "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth?..." }Open it and approve
The calendar owner signs in at Google and approves the two permissions. Google redirects back to Aethex, which finishes the exchange. Confirm the result from the API, not from where the browser lands.
Confirm the connection
The connection is live once it appears with
status: active. Note itsid, since the grant and disconnect calls both take it.agentscomes back empty, which means no agent can use it yet.bash# Keep the id: the grant and disconnect calls below both take it. CONNECTION_ID=$(curl -s https://api.aethexai.com/api/v1/integrations \ -H "X-API-Key: $AETHEX_API_KEY" \ | jq -r '.data[] | select(.provider == "google_calendar") | .id')
Grant agents access
A connected calendar belongs to the account, not to one agent, so it reaches an agent only when you grant it. Give an agent read to check availability and offer times, or write to also book, reschedule and cancel. The grant call is declarative: it replaces the whole set, and an empty list revokes everyone. Grants are read when a call starts, so a change applies to the next call, not one already in progress. Reschedule and cancel act only on a meeting the agent booked in the same call, since they need its event id and the agent cannot search the calendar for one it did not create.
| Action | What it does | Grant |
|---|---|---|
| Offer open times | Reads busy periods over the next few days and proposes only the gaps that fit. | read |
| Book a meeting | Adds the event to the calendar and emails the guests an invitation. | write |
| Reschedule | Moves a meeting it booked earlier in the same call, and notifies the guests. | write |
| Cancel | Removes that meeting and notifies the guests. | write |
read for an agent that only quotes availability and hands off to a human to confirm. Widening it to write later does not require reconnecting the calendar.curl -X PUT https://api.aethexai.com/api/v1/integrations/$CONNECTION_ID/agents \
-H "X-API-Key: $AETHEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agents": [
{ "agent_id": "6b1e...", "access": "write" },
{ "agent_id": "9d02...", "access": "read" }
]
}'The access being approved
Connecting asks Google for exactly two permissions, and nothing else. The broader scope that could read your calendar list, its settings, or who it is shared with is a different Google scope, and Aethex does not request it.
| Scope | What it covers |
|---|---|
calendar.events | Read, create, update and delete events. The write half books, reschedules and cancels; the read half checks an event's current length when rescheduling, so it is preserved. |
calendar.freebusy | Read busy time ranges. This is what a check for a free slot uses. |
Status codes worth knowing
The ones you are most likely to meet while wiring this up. 401 and 403 can come from any call; 404 and 409 come from the grant call; 422 and 503 come from authorize.
Every call on this page, before any handler runs. No X-API-Key header, or a key that is invalid, revoked or expired.
Send a live key. Missing API key means the header never arrived; Invalid or expired API key means it did not match.
The API key is valid but lacks the scope this call needs.
authorize, the grant call and disconnect need integrations:write; listing connections needs integrations:read.
The grant call was handed a connection id that is not this account's, or an agent_id that is not one of your agents.
Re-read GET /integrations for the connection id, and check every agent_id is an agent on this account. It is 404 rather than 422 so it never reveals another account's rows.
A rare conflicting change to the connection while the grants were being written.
Re-read the connection's agents list and send the complete set again.
On authorize, a provider that does not use a consent flow. The grant call also returns 422 for a malformed body, such as a bad agent_id or an unknown access level.
Check the provider is google_calendar. Providers that take a credential directly are connected with POST /integrations instead.
On authorize, the consent flow is not available on this deployment, or the state store was briefly unavailable.
If the state store blipped, the same call succeeds on a retry. If the consent flow is not configured on this deployment, retrying will not help, so contact support.
Disconnect
Deletes the connection and the stored access at once, including on calls in progress, so the next calendar action in a live call fails. It does not touch the calendar itself, so booked meetings stay where they are. Disconnecting is idempotent and returns 204 whether the connection was active, already gone, or never existed. You can also revoke access from the Google account's own third-party settings; the connection then turns to status: error on its next token refresh.
curl -X DELETE https://api.aethexai.com/api/v1/integrations/$CONNECTION_ID \
-H "X-API-Key: $AETHEX_API_KEY"
# 204 No ContentIf something does not work
The handful of things that usually explain a calendar that looks broken.
| Symptom | What to check |
|---|---|
The connection shows status: error | Google stopped accepting the stored access, usually revoked at Google or an expired beta grant. Connect again, then re-grant your agents, since a reconnect starts with an empty grant set. |
| The agent never offers times | Confirm the agent is in the connection's agents list. |
| It offers times but never books | That is read access working. Change the grant to write. |
| The consent URL stopped working | It is single-use and expires after 10 minutes. Ask for a fresh one. |
| The approval cannot complete | On a Google Workspace account, an administrator may restrict third-party access. |
