# Change a calendar's settings

`PATCH https://www.getrevox.com/api/assistants/{id}/calendars/{calendarId}`

The settings of its provider: opening hours, meeting length and Meet link for Google Calendar, the event type for Calendly and Cal.com.

## Path parameters

- `id` (string, required)
- `calendarId` (string, required)

## Request body (JSON)

- `settings` (one of, required): Must match the calendar's provider.
  - One of, **Option 1** (object)
    - `calendar_id` (string, required): The Google calendar to book on. (eg: primary)
    - `time_zone` (string, required): The timezone of the opening hours. (eg: Europe/Paris)
    - `duration_minutes` (integer, required): Constraints: min 5, max 480. Default: `30`.
    - `days` (array of integer, required): The open days, 0 is Sunday. Default: `[1,2,3,4,5]`.
    - `start_time` (string, required): Constraints: pattern ^\d{2}:\d{2}$. Default: `"09:00"`.
    - `end_time` (string, required): Constraints: pattern ^\d{2}:\d{2}$. Default: `"18:00"`.
    - `google_meet` (boolean, required): Adds a Google Meet link to the meeting. Default: `true`.
  - One of, **Option 2** (object)
    - `event_type_id` (string, required): The Calendly event type to schedule. (eg: https://api.calendly.com/event_types/b2330295-2a91-4a1d-bb73-99e7707663d5) Constraints: min length 1.
  - One of, **Option 3** (object)
    - `event_type_id` (string, required): The Cal.com event type to schedule. (eg: 7081322) Constraints: min length 1.

## Example request

```bash
curl -X PATCH https://www.getrevox.com/api/assistants/3c90c3cc-0d44-4b50-8888-8dd25736052a/calendars/3c90c3cc-0d44-4b50-8888-8dd25736052a \
  -H "Authorization: Bearer $REVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "calendar_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "time_zone": "string",
      "duration_minutes": 30,
      "days": [
        1,
        2,
        3,
        4,
        5
      ],
      "start_time": "09:00",
      "end_time": "18:00",
      "google_meet": true
    }
  }'
```

## Responses

### 200: Success

- `calendar` ([AssistantCalendar](https://www.getrevox.com/docs/api/objects/assistant-calendar.md), required)

### 400: Invalid request: the body or a parameter failed validation

- `message` (string, optional)
- `error` (string, optional)
- `bodyErrors` (object, optional): The validation errors returned from the API.
  - `issues` (array of object, required)
    - `path` (array of one of, required)
      - One of, **string** (string)
      - One of, **number** (number)
    - `message` (string, required)
    - `code` (string, optional)

### 404: Not found in your organization

- `message` (string, optional)
- `error` (string, optional)
- `bodyErrors` (object, optional): The validation errors returned from the API.
  - `issues` (array of object, required)
    - `path` (array of one of, required)
      - One of, **string** (string)
      - One of, **number** (number)
    - `message` (string, required)
    - `code` (string, optional)