Skip to content
Assistants

Add a calendar to an assistant

POST/assistants/{id}/calendars

Add a calendar on a provider, before any account is connected to it. Then create an invite link for the account owner to connect it: connecting gives it the handle the prompt mentions, named after the account (google_calendar_jane_at_example.com).

Path parameters

Request body

  • provider"google-calendar" | "calendly" | "cal-com-oauth"required

    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.

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.