---
agentTools:
  projectIndex: https://docs.addevent.com/llms.txt
---

# Update a calendar

Updates a calendar by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts mostly the same properties as the calendar creation call.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "version": "v2.14.0",
    "title": "Calendar and Event API",
    "contact": {
      "name": "AddEvent Inc",
      "email": "support@addevent.com"
    }
  },
  "servers": [
    {
      "url": "https://api.addevent.com/calevent/v2"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/calendars/{calendar_id}": {
      "patch": {
        "operationId": "update-calendar",
        "summary": "Update a calendar",
        "tags": [
          "Calendars"
        ],
        "description": "Updates a calendar by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts mostly the same properties as the calendar creation call.",
        "parameters": [
          {
            "$ref": "#/components/parameters/calendar-id"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/calendar-update"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/20x-calendar"
          },
          "400": {
            "$ref": "#/components/responses/400-invalid-request-body"
          },
          "404": {
            "$ref": "#/components/responses/404-not-found"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "calendar-id": {
        "name": "calendar_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^\\S+$"
        },
        "description": "Unique identifier for the calendar."
      }
    },
    "requestBodies": {
      "calendar-update": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/calendar-input"
            }
          }
        }
      }
    },
    "schemas": {
      "calendar-input": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "pattern": "^(?!\\s*$).+",
            "description": "The calendar's title. It must be a non-empty, single-line string."
          },
          "timezone": {
            "type": "string",
            "pattern": "^(?!\\s*$).+",
            "default": "America/Los_Angeles",
            "description": "The default timezone for events created on this calendar. The `List timezones` endpoint returns all of the timezone values that are supported, or you can use our <a href=\"https://www.addevent.com/c/documentation/tools/time-zone-lookup\" target=\"_blank\">Timezone Lookup Tool</a> to find a timezone. Defaults to `America/Los_Angeles`.\n"
          },
          "weekday_begin": {
            "type": "string",
            "enum": [
              "sunday",
              "monday"
            ],
            "default": "sunday",
            "description": "The day of the week that the calendar starts on. Values are `sunday` or `monday`."
          },
          "description": {
            "type": "string",
            "description": "The calendar's description. This appears on the calendar landing page and can be used to display additional information to users about the calendar. Accepts plain text and simplified HTML."
          },
          "internal_name": {
            "type": "string",
            "description": "An internal name for the calendar which will not be displayed publicly. This can be used internally to distinguish between calendars, to add additional information/context to a calendar, or to store an external ID that relates to another system."
          },
          "calendar_color": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "default": 1,
            "description": "The color of the calendar. This appears in the dashboard. Accepts values between `1` and `20` that correspond to the colors on the calendar's palette."
          },
          "landing_page_template_id": {
            "type": "string",
            "pattern": "^(?!\\s*$).+",
            "default": "default",
            "description": "The ID of the custom calendar landing page template to associate with the calendar. Accepts the value `default`, which uses the standard AddEvent template, or the ID of a custom template, which can be retrieved with the `List calendar templates` endpoint."
          },
          "embeddable_calendar_template_id": {
            "type": "string",
            "pattern": "^(?!\\s*$).+",
            "default": "default",
            "description": "The ID of the custom embeddable calendar template to associate with the calendar. Accepts the value `default`, which uses the standard AddEvent template, or the ID of a custom template, which can be retrieved with the `List calendar templates` endpoint."
          },
          "custom_data": {
            "type": "object",
            "description": "Arbitary key-value pairs that can be attached to a calendar. Useful for storing additional structured data on an object, for example, storing external IDs to link a calendar to another system or linking to custom images for each calendar."
          }
        }
      },
      "calendar": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the calendar."
          },
          "unique_key": {
            "type": "string",
            "description": "A public identifier for the calendar that is used for sharing the calendar."
          },
          "title": {
            "type": "string",
            "description": "The calendar's title."
          },
          "timezone": {
            "type": "string",
            "description": "The default timezone for events on the calendar."
          },
          "weekday_begin": {
            "type": "string",
            "description": "Day of the week that the calendar begins on. Values are `sunday` or `monday`."
          },
          "is_default_calendar": {
            "type": "boolean",
            "description": "Whether the calendar is the default calendar on the account."
          },
          "description": {
            "type": "string",
            "description": "The calendar's description. This appears on the calendar landing page."
          },
          "internal_name": {
            "type": "string",
            "description": "An internal name for the calendar. This will not be displayed publicly."
          },
          "calendar_color": {
            "type": "integer",
            "description": "The color of the calendar which appears in the dashboard. Values are between `1` and `20` and correspond to the colors on the calendar's palette."
          },
          "palette_id": {
            "type": "string",
            "description": "The ID of the custom color palette that is associated with the calendar. The value `default` indicates that the standard AddEvent palette is being used."
          },
          "landing_page_template_id": {
            "type": "string",
            "description": "The ID of the custom calendar landing page template that is associated with the calendar. The value `default` indicates that the standard AddEvent template is being used."
          },
          "embeddable_calendar_template_id": {
            "type": "string",
            "description": "The ID of the custom embeddable calendar template that is associated with the calendar. The value `default` indicates that the standard AddEvent template is being used."
          },
          "stats": {
            "$ref": "#/components/schemas/calendar-stats"
          },
          "custom_data": {
            "type": "object",
            "description": "Arbitary key-value pairs that can be attached to a calendar. Useful for storing additional structured data on an object, for example, storing external IDs to link a calendar to another system or linking to custom images for each calendar."
          },
          "link_long": {
            "type": "string",
            "description": "The public URL to the calendar landing page. Used for sharing the calendar."
          },
          "link_short": {
            "type": "string",
            "description": "The public short URL to the calendar landing page. Used for sharing the calendar."
          },
          "created": {
            "type": "string",
            "description": "Time at which the calendar was created."
          },
          "modified": {
            "type": "string",
            "description": "Time at which the calendar was last updated."
          }
        }
      },
      "calendar-stats": {
        "type": "object",
        "properties": {
          "subscriber_active_count": {
            "type": "integer",
            "description": "The number of active subscribers on the calendar. An active subscriber means that the calendar feed has synced within the last 30 days."
          },
          "subscribers_all_count": {
            "type": "integer",
            "description": "The total number of subscribers on the calendar. This includes all active subscribers, as well as inactive subscribers (which means that the calendar feed has not synced within the last 30 days), and calendar subscribers who were manually blocked by the calendar owner."
          },
          "events_count": {
            "type": "integer",
            "description": "The total number of events on the calendar."
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "APIkey",
        "description": "Your API key can be found on your AddEvent account page - https://dashboard.addevent.com/account/settings"
      }
    },
    "responses": {
      "20x-calendar": {
        "description": "Ok",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/calendar"
            },
            "examples": {
              "Calendar": {
                "$ref": "#/components/examples/calendar-all"
              }
            }
          }
        }
      },
      "400-invalid-request-body": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error_id": {
                  "type": "string",
                  "description": "A UUID which can be used to troubleshoot the error."
                },
                "error_message": {
                  "type": "string",
                  "description": "Additional information about the error."
                },
                "property_validation_errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  },
                  "description": "An array of invalid property names, and the associated reason that the property is invalid."
                }
              }
            },
            "examples": {
              "Invalid request body": {
                "$ref": "#/components/examples/invalid-request-body"
              }
            }
          }
        }
      },
      "404-not-found": {
        "description": "Not found"
      }
    },
    "examples": {
      "invalid-request-body": {
        "value": {
          "error_message": "There are a number of validation errors with the request",
          "error_id": "00c3317d-ecdc-449d-84f5-8562bc1ff831",
          "property_validation_errors": [
            {
              "name": "rrule",
              "reason": "Not a valid RRule value"
            },
            {
              "name": "title",
              "reason": "Cannot have blank value"
            }
          ]
        }
      },
      "calendar-all": {
        "value": {
          "id": 1701121309493871,
          "unique_key": "1d493871",
          "title": "Calendar title",
          "internal_name": "",
          "description": "",
          "is_default_calendar": true,
          "timezone": "America/Los_Angeles",
          "weekday_begin": "sunday",
          "calendar_color": 1,
          "palette_id": "default",
          "landing_page_template_id": "default",
          "embeddable_calendar_template_id": "default",
          "stats": {
            "subscribers_active_count": 25,
            "subscribers_all_count": 32,
            "events_count": 12
          },
          "created": "2023-08-20 21:41:48",
          "modified": "2023-11-27 21:43:17",
          "link_long": "https://www.addevent.dev/calendar/1d493871",
          "link_short": "https://cal.ae/usgdhaw",
          "custom_data": {}
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 165,
      "2": 2,
      "3": 119,
      "4": 10,
      "5": 212,
      "6": 106,
      "7": 0,
      "8": 55,
      "9": 83,
      "10": 79,
      "11": 76
    }
  }
}
```