---
title: "Sets whether a calendar is or not selected by the user."
method: PATCH
path: "/integrations/calendar/{integration_id}/calendars/{calendar_id}"
tags: ["calendar"]
---

# Sets whether a calendar is or not selected by the user.

`PATCH /integrations/calendar/{integration_id}/calendars/{calendar_id}`

## Request

- Base URL: `https://localhost:8080/api/v9`
- URL: `https://localhost:8080/api/v9/integrations/calendar/{integration_id}/calendars/{calendar_id}`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/toggl/apis/toggl-api/docs/integrations/calendar/:integration_id/calendars/:calendar_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint is used to set updatable fields of a calendar like selected field.

## Path parameters

- `integration_id` integer, required
- `calendar_id` integer, required

## Request body

- HandlercalendarPatchCalendar
  - `default_planned_task_id` integer
  - `default_project_id` integer
  - `default_workspace_id` integer
  - `remind_tracking` boolean: The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps
  - `selected` boolean

## Response `200`

Calendars successfully updated

- ModelsCalendar[]
  - `background_color` string
  - `calendar_id` integer
  - `calendar_integration_id` integer
  - `created_at` string
  - `default_planned_task_id` integer
  - `default_project_id` integer
  - `default_workspace_id` integer
  - `deleted_at` string
  - `external_id` string
  - `foreground_color` string
  - `name` string
  - `remind_tracking` boolean: The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps
  - `selected` boolean
  - `updated_at` string

## Other responses

- `400`: Possible error messages: * JSON is not valid * json: unknown field * ID is an invalid value for calendar\_id * ID is an invalid value for integration\_id * invalid json: Default Task needs workspace\_id, project\_id and task\_id * invalid json: Default Project needs workspace\_id and project\_id * invalid json: cannot set a Default Workspace * the payload should not be empty
- `402`: outlook calendar integration is a starter feature
- `403`: you do not have access to the integration
- `404`: you do not have a calendar with the given ID
- `500`: Internal Server Error

---

[API](https://skmtc.dev/toggl/apis/toggl-api.md) - [All operations](https://skmtc.dev/toggl/apis/toggl-api/llms.txt) - [OpenAPI document](https://skmtc.dev/toggl/apis/toggl-api/revisions/3085aee16990?raw)
