# List event types through the supported v2 endpoint

Operation ID: `connectors.calGetEventTypes`

List event types through the supported v2 endpoint. Calls Cal.com through the HealthCloud connector gateway.

## Public method

`getEventTypes`

Signature: `connectors.cal.createClient(config).getEventTypes(body)`

Return type: `Promise<CalGetEventTypesResult>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /connectors/cal/get-event-types`

## Path parameters

None.

## Query parameters

None.

## Body parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `body` | [`CalGetEventTypesRequest`](../models/CalGetEventTypesRequest.md) | Yes |  |  |  | No |  |

Request model: [`CalGetEventTypesRequest`](../models/CalGetEventTypesRequest.md)

## Request example

```json
{
  "api_key": "example-api-key",
  "default_event_type_id": 2883016,
  "mode": "live"
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`CalGetEventTypesResponse`](../models/CalGetEventTypesResponse.md) | application/json | Successful response |

## Success response examples

### 200

```json
[
  {
    "after_event_buffer": 0,
    "before_event_buffer": 0,
    "booking_fields": [
      {
        "disable_on_prefill": false,
        "is_default": true,
        "required": true,
        "slug": "name",
        "type": "name"
      }
    ],
    "confirmation_policy": {
      "disabled": true
    },
    "currency": "usd",
    "custom_name": "Telehealth Appointment for {Scheduler}",
    "description": "A video call with a Provider",
    "disable_guests": false,
    "forward_params_success_redirect": true,
    "hide_calendar_event_details": false,
    "hide_calendar_notes": false,
    "id": 2883016,
    "is_instant_event": false,
    "length_in_minutes": 30,
    "locations": [
      {
        "integration": "cal-video",
        "type": "integration"
      }
    ],
    "lock_time_zone_toggle_on_booking_page": false,
    "metadata": {
      "apps": {
        "giphy": {
          "currency": "usd",
          "enabled": false,
          "thank_you_page": ""
        }
      },
      "disable_standard_emails": {
        "confirmation": {
          "attendee": true,
          "host": false
        }
      }
    },
    "minimum_booking_notice": 120,
    "offset_start": 0,
    "only_show_first_available_slot": false,
    "owner_id": 1448952,
    "price": 0,
    "requires_booker_email_verification": false,
    "schedule_id": 866566,
    "seats": {
      "disabled": true
    },
    "slug": "telehealth",
    "title": "Telehealth",
    "use_destination_calendar_email": false,
    "users": [
      {
        "avatar_url": "/api/avatar/efb0f8d0-3da1-4f03-9630-a3727eb5cdf7.png",
        "brand_color": "#623827",
        "dark_brand_color": "#fafafa",
        "id": 1448952,
        "metadata": {
          "stripe_customer_id": "example-stripe_customer_id"
        },
        "name": "Healthcheck PMC",
        "username": "example-username",
        "week_start": "Sunday"
      }
    ]
  }
]
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | Connector validation rejected the payload, or a required field was missing or of the wrong type. |
| `401` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The HealthCloud bearer token is missing or invalid, or the vendor rejected the supplied connector credentials. |
| `500` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The connector failed unexpectedly. |
| `502` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The vendor returned an application or transport-level failure. |
| `504` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The vendor did not respond within the connector timeout. |

## Error examples

### 400 — Invalid request

```json
{
  "error": "Invalid request"
}
```

### 401 — Authorization required

```json
{
  "error": "Authorization required"
}
```

### 500 — Internal error

```json
{
  "error": "Internal error"
}
```

### 502 — Upstream vendor error

```json
{
  "error": "Upstream vendor error"
}
```

### 504 — Upstream timeout

```json
{
  "error": "Upstream timeout"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
import type { CalGetEventTypesRequest } from "@healthcloudai/hc-sdk";
```

```ts
const body = {
  "api_key": "example-api-key",
  "default_event_type_id": 2883016,
  "mode": "live"
};

const result = await connectors.cal.createClient(config).getEventTypes(body);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"api_key":"example-api-key","default_event_type_id":2883016,"mode":"live"}' \
  'https://dev-api-connectors.health.cloud/connectors/cal/get-event-types'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
