Skip to content
Assistants

Connect an account to a calendar

PUT/assistants/{id}/calendars/{calendarId}/connection

Connect 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

Request body

  • connection_idstringrequired

    ID 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

200
    • idstring

      Unique ID of the calendar: the {calendarId} of the calendar endpoints.

    • assistant_idstring

      ID of the assistant that books on this calendar.

    • handlestringnullable

      How 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 characters

    • provider"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.

    • connectionobjectnullable

      The connected account, on the calendar's provider. Null until one is connected.

    • account_labelstringnullable

      The connected account, usually its email. Null when not connected, or when the provider did not say.

    • connected_via_inviteboolean

      True when the account was connected by a colleague from the invite link.

    • inviteobjectnullable

      The invite link a colleague can use to connect their own account to this calendar (POST /assistants/{id}/calendars/{calendarId}/invite). Null when no link was created, once it was revoked, and once an account was connected from the dashboard or the API instead.

    • 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.