Connect an account to a calendar
/assistants /{id} /calendars /{calendarId} /connectionConnect the calendar to an account your organization already uses on its provider. The calendar takes the handle of that account (google_calendar_jane_at_example.com, then _2 for a second calendar on the same account); reconnecting the same account keeps the handle. Google's primary calendar, or the account's only event type, is picked right away; otherwise pick one with GET .../options and PUT .../selection.
Path parameters
idstringrequiredID of the assistant, as returned by
GET /assistants.calendarIdstringrequiredID of the calendar, from the assistant's
calendarslist orGET /.assistants/ {id}/ calendars
Request body
application/jsonconnection_idstringrequiredID of a connection your organization already has to an account on the calendar's provider: the connection.connection_id of another calendar connected to that account. To connect a new account, create an invite link instead.
Response
200calendarAssistantCalendaridstringUnique ID of the calendar: the {calendarId} of the calendar endpoints.
assistant_idstringID of the assistant that books on this calendar.
handlestringnullableHow the prompt names this calendar, as @handle: the provider, then the connected account (e.g. google_calendar_jane_at_example.com). Null until an account is connected, unique within the assistant, kept when it is disconnected.
Example
"google_calendar_jane_at_example.com"at most 255 charactersprovider"google-calendar" | "calendly" | "cal-com-oauth"Calendar provider.
"google-calendar"Google Calendar: books on a calendar of the account, with the opening hours and meeting length of its settings.
"calendly"Calendly: books an event type of the account.
"cal-com-oauth"Cal.com: books an event type of the account.
status"not_connected" | "needs_setup" | "ready"Whether the calendar takes bookings.
"not_connected"No account is connected yet: send the invite link to the account owner, or connect an account of your organization.
"needs_setup"An account is connected, but the calendar (Google) or event type (Calendly, Cal.com) to book on is not picked: list them with GET .../options and pick one with PUT .../selection.
"ready"Takes bookings: the agent can book on it during calls.
connectionobjectnullableThe connected account, on the calendar's provider. Null until one is connected.
account_labelstringnullableThe connected account, usually its email. Null when not connected, or when the provider did not say.
connected_via_invitebooleanTrue when the account was connected by a colleague from the invite link.
inviteobjectnullableThe invite link a colleague can use to connect their own account to this calendar (
POST /). Null when no link was created, once it was revoked, and once an account was connected from the dashboard or the API instead.assistants/ {id}/ calendars/ {calendarId}/ invite created_atstring (date-time)When the calendar was added to the assistant (ISO 8601).
Errors
- 400Invalid request: a field or parameter failed validation
{ "message"?: string, "error"?: string, "bodyErrors"?: {…} } - 404Not found in your organization
{ "message"?: string, "error"?: string, "bodyErrors"?: {…} }
Error bodies carry an error (or message) string; a 400 adds bodyErrors.issues. See Errors.