Skip to content

Google: Returns free busy information for a set of calendars

Google calendarFreebusy.calendarFreebusyQuery: arguments, response, policy and SDK examples.

← Calendar freebusy operations · Get started

Operation google.calendar_freebusy_query

Provider route: POST /calendar/v3/freeBusy. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/google with npm, or alter-sdk-google with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { GoogleIntegration } from "@alter-ai/google";
async function execute(input: Parameters<GoogleIntegration["calendarFreebusy"]["calendarFreebusyQuery"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new GoogleIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.calendarFreebusy.calendarFreebusyQuery(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_google import GoogleIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = GoogleIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.calendar_freebusy.calendar_freebusy_query(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryModelOptionalExpand Returns a single user setting — request body — query
bodyModelRequired within parentExpand Returns free busy information for a set of calendars — request body — body

Referenced models: Returns free busy information for a set of calendars — request body — body, Returns a single user setting — request body — query

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Returns free busy information for a set of calendars — response body

Referenced models: Returns free busy information for a set of calendars — response body

Returns free busy information for a set of calendars — response body
FieldTypePresenceDescription and constraints
$objectRoot
calendarsobjectOptionalList of free/busy information for calendars.
Additional keys: see wildcard field
calendars.*ModelAdditional keysExpand Returns free busy information for a set of calendars — response body — calendars value
Free/busy expansions for a single calendar.
groupsobjectOptionalExpansion of groups.
Additional keys: see wildcard field
groups.*ModelAdditional keysExpand Returns free busy information for a set of calendars — response body — groups value
List of calendars that are members of this group.
kindstringOptionalType of the resource ("calendar#freeBusy").
Default: calendar#freeBusy
timeMaxstringOptionalThe end of the interval.
Format: date-time
timeMinstringOptionalThe start of the interval.
Format: date-time

Referenced models: Returns free busy information for a set of calendars — response body — calendars value, Returns free busy information for a set of calendars — response body — groups value

Returns free busy information for a set of calendars — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
calendarExpansionMaxintegerOptionalMaximal number of calendars for which FreeBusy information is to be provided. Optional. Maximum value is 50.
Format: int32
groupExpansionMaxintegerOptionalMaximal number of calendar identifiers to be provided for a single group. Optional. An error is returned for a group with more members than this value. Maximum value is 100.
Format: int32
itemsarrayOptionalList of calendars and/or groups to query.
items[]ModelEach itemExpand Returns free busy information for a set of calendars — request body — body items item
timeMaxstringOptionalThe end of the interval for the query formatted as per RFC3339.
Format: date-time
timeMinstringOptionalThe start of the interval for the query formatted as per RFC3339.
Format: date-time
timeZonestringOptionalTime zone used in the response. Optional. The default is UTC.
Default: UTC

Referenced models: Returns free busy information for a set of calendars — request body — body items item

Returns a single user setting — request body — query
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
fieldsstringOptionalSelector specifying which fields to include in a partial response.
prettyPrintbooleanOptionalReturns response with indentations and line breaks.
Default: true
quotaUserstringOptionalAn opaque string that represents a user for quota purposes. Must not exceed 40 characters.
userIpstringOptionalDeprecated. Please use quotaUser instead.
Returns free busy information for a set of calendars — response body — calendars value
FieldTypePresenceDescription and constraints
$objectRoot
busyarrayOptionalList of time ranges during which this calendar should be regarded as busy.
busy[]ModelEach itemExpand Returns free busy information for a set of calendars — response body — calendars value busy item
errorsarrayOptionalOptional error(s) (if computation for the calendar failed).
errors[]ModelEach itemExpand Returns free busy information for a set of calendars — response body — groups value errors item

Referenced models: Returns free busy information for a set of calendars — response body — groups value errors item, Returns free busy information for a set of calendars — response body — calendars value busy item

Returns free busy information for a set of calendars — response body — groups value
FieldTypePresenceDescription and constraints
$objectRoot
calendarsarrayOptionalList of calendars' identifiers within a group.
calendars[]stringEach item
errorsarrayOptionalOptional error(s) (if computation for the group failed).
errors[]ModelEach itemExpand Returns free busy information for a set of calendars — response body — groups value errors item

Referenced models: Returns free busy information for a set of calendars — response body — groups value errors item

Returns free busy information for a set of calendars — request body — body items item
FieldTypePresenceDescription and constraints
$objectRoot
idstringOptionalThe identifier of a calendar or a group.
Returns free busy information for a set of calendars — response body — groups value errors item
FieldTypePresenceDescription and constraints
$objectRoot
domainstringOptionalDomain, or broad category, of the error.
reasonstringOptionalSpecific reason for the error. Some of the possible values are:
- "groupTooBig" - The group of users requested is too large for a single query.
- "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query.
- "notFound" - The requested resource was not found.
- "internalError" - The API service has encountered an internal error. Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list.
Returns free busy information for a set of calendars — response body — calendars value busy item
FieldTypePresenceDescription and constraints
$objectRoot
endstringOptionalThe (exclusive) end of the time period.
Format: date-time
startstringOptionalThe (inclusive) start of the time period.
Format: date-time

SDK function policy ID: google.calendar_freebusy_query. Catalog operation: calendar.freebusy.query. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.events.freebusy", "https://www.googleapis.com/auth/calendar.freebusy", "https://www.googleapis.com/auth/calendar.readonly"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.