> ## Documentation Index
> Fetch the complete documentation index at: https://docs.roark.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a calendar connection

> Renames a connection, changes the timezone slots are offered in, or rotates the credential. A rotated credential is verified first, and a verified credential returns the connection to ACTIVE.



## OpenAPI

````yaml /api-reference/openapi.documented.json patch /v1/connections/calendar/{connectionId}
openapi: 3.1.0
info:
  title: Roark Analytics API
  description: >-
    The Roark Analytics API gives you access to the same API that powers the
    award winning Roark Analytics platform.
  version: 1.0.0
servers:
  - description: Production
    url: https://api.roark.ai
security:
  - Bearer: []
tags:
  - name: Health
    x-displayName: Health
  - name: Authentication
    x-displayName: Current credential
  - name: Project API Key
    x-displayName: Project API keys
  - name: Personal API Key
    x-displayName: Personal API keys
  - name: Agent
    x-displayName: Agents
  - name: Agent Endpoint
    x-displayName: Endpoints
  - name: Tool
    x-displayName: Tools
  - name: Autoimprove
    x-displayName: Autoimprove
  - name: Generate Simulation Resources
    x-displayName: Generate resources
  - name: Customer Flow
    x-displayName: Customer flows
  - name: Customer Flow Folder
    x-displayName: Customer flow folders
  - name: Simulation Persona
    x-displayName: Personas
  - name: Simulation Environment
    x-displayName: Environments
  - name: Simulation Template
    x-displayName: Templates
  - name: Simulation Run Plan
    x-displayName: Plans
  - name: Simulation Run
    x-displayName: Runs
  - name: Simulation Tool Mock
    x-displayName: Tool mocks and fixtures
  - name: Simulation Phone Number
    x-displayName: Simulation phone numbers
  - name: Metric
    x-displayName: Definitions
  - name: Metric Variant
    x-displayName: Variants
  - name: Metric Policy
    x-displayName: Policies
  - name: Metric Collection Job
    x-displayName: Collection jobs
  - name: Call
    x-displayName: Calls
  - name: Chat
    x-displayName: Chats
  - name: Customer
    x-displayName: Customers
  - name: Issue
    x-displayName: Issues
  - name: Analytics
    x-displayName: Analytics
  - name: Dashboard
    x-displayName: Dashboards & widgets
  - name: Live Report
    x-displayName: Live reports
  - name: Agent Connection
    x-displayName: Agent platforms
  - name: Calendar Connection
    x-displayName: Calendars
  - name: MCP Server Connection
    x-displayName: MCP servers
  - name: Knowledge Base
    x-displayName: Knowledge bases
  - name: HTTP Request Definition
    x-displayName: HTTP request definitions
  - name: Webhook
    x-displayName: Webhooks
  - name: Config
    x-displayName: Config as code
  - name: Organization Project
    x-displayName: Projects
  - name: Organization Project Member
    x-displayName: Project members
  - name: Usage
    x-displayName: Usage
  - name: Benchmark
    x-displayName: Model benchmarks
paths:
  /v1/connections/calendar/{connectionId}:
    patch:
      tags:
        - Calendar Connection
      summary: Update a calendar connection
      description: >-
        Renames a connection, changes the timezone slots are offered in, or
        rotates the credential. A rotated credential is verified first, and a
        verified credential returns the connection to ACTIVE.
      operationId: patchV1ConnectionsCalendarByConnectionId
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
          description: Calendar connection ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 120
                  description: Rename the connection.
                timezone:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  description: Change the named IANA timezone slots are offered in.
                apiKey:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  description: >-
                    Rotate the credential. The new key is verified before it is
                    stored, and a verified key returns the connection to ACTIVE,
                    which is how a connection recovers from INVALID_CREDENTIALS.
                goHighLevelLocation:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 64
                  description: >-
                    Only with `apiKey`, and only for GO_HIGH_LEVEL: the
                    sub-account the rotated token belongs to. Required there
                    because the token and the sub-account are one credential, so
                    a rotation has to name both.
              title: UpdateCalendarConnectionInput
              description: Fields to change. At least one is required.
      responses:
        '200':
          description: The updated calendar connection.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier of the calendar connection.
                      provider:
                        type: string
                        enum:
                          - CAL_COM
                          - GOOGLE
                          - CALENDLY
                          - GO_HIGH_LEVEL
                        description: >-
                          Who holds the calendar. CAL_COM and GO_HIGH_LEVEL are
                          connected with a key, GO_HIGH_LEVEL also needing the
                          sub-account the key belongs to; GOOGLE and CALENDLY
                          are connected by consent, through `POST
                          /v1/connections/calendar/google/authorize-url` and
                          `POST
                          /v1/connections/calendar/calendly/authorize-url`.
                      label:
                        type: string
                        description: >-
                          Customer-supplied name for this account. Unique within
                          the project.
                      accountLabel:
                        type:
                          - string
                          - 'null'
                        description: >-
                          How the provider names the connected account (a
                          Cal.com email). Read-only.
                      scopes:
                        type:
                          - array
                          - 'null'
                        items:
                          type: string
                        description: >-
                          Scopes the credential carries, when the provider
                          issues scoped credentials. Null for an API key.
                      credentialExpiresAt:
                        type:
                          - string
                          - 'null'
                        description: >-
                          When the credential expires, ISO 8601. Null when it
                          does not expire.
                      timezone:
                        type: string
                        description: >-
                          The IANA timezone slots are offered in: the
                          business’s, not the caller’s. A clinic’s 3pm is 3pm
                          whoever dials it.
                      status:
                        type: string
                        enum:
                          - ACTIVE
                          - INVALID_CREDENTIALS
                          - ERROR
                        description: >-
                          Whether the stored credential still works, as of
                          `lastCheckedAt`. INVALID_CREDENTIALS means the
                          provider rejected it and the connection needs a new
                          one. A provider outage never changes this.
                      statusMessage:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Why the status is not ACTIVE, in the provider’s words.
                          Null when ACTIVE.
                      lastCheckedAt:
                        type:
                          - string
                          - 'null'
                        description: >-
                          When the credential was last verified against the
                          provider, ISO 8601.
                      capabilities:
                        type: object
                        properties:
                          auth:
                            type: string
                            enum:
                              - API_KEY
                              - OAUTH
                            description: >-
                              How a credential is obtained, which is the whole
                              of what connecting looks like: API_KEY takes a key
                              in the create body, OAUTH sends the customer to
                              the provider and Roark stores the result itself.
                          operations:
                            type: array
                            items:
                              type: string
                              enum:
                                - CHECK_AVAILABILITY
                                - BOOK
                                - LOOKUP_BOOKING
                                - RESCHEDULE
                                - CANCEL
                                - LIST_BOOKINGS
                              description: >-
                                An operation a calendar tool can offer the
                                agent.
                            description: >-
                              The operations this provider supports. An
                              operation that is absent is never registered as a
                              tool, so the agent cannot promise it: Calendly,
                              for example, has no reschedule API, and callers
                              wanting to move an appointment must cancel and
                              rebook.
                          requiresAttendeeEmail:
                            type: boolean
                            description: >-
                              Whether a booking cannot be created without an
                              attendee email address. True for every scheduling
                              system, which decides how an agent has to identify
                              the caller.
                          slotHold:
                            type: string
                            enum:
                              - RESERVATION
                              - NONE
                            description: >-
                              Whether a slot can be held before committing.
                              RESERVATION blocks other bookers in the provider’s
                              own UI but is not consumed by the booking that
                              follows, so it is a courtesy and not a guarantee.
                          roarkOwnsBookingPolicy:
                            type: boolean
                            description: >-
                              True for a calendar that exposes only events and
                              free/busy. Roark then owns the bookable hours,
                              duration, buffers, lead time and horizon, because
                              the provider has no notion of them. A tool on one
                              of these is pointed at a bookable target you
                              create through this API, rather than at something
                              that already exists on the account. Read this
                              instead of matching on the provider name.
                          availabilityWindowDays:
                            type:
                              - number
                              - 'null'
                            description: >-
                              Hard cap on the width of one availability query,
                              in days, when the provider has one.
                        required:
                          - auth
                          - operations
                          - requiresAttendeeEmail
                          - slotHold
                          - roarkOwnsBookingPolicy
                          - availabilityWindowDays
                        title: CalendarCapabilities
                        description: >-
                          What a calendar provider can actually do. Read this
                          before configuring a calendar tool.
                      createdAt:
                        type: string
                        description: Creation timestamp in ISO 8601 format.
                      updatedAt:
                        type: string
                        description: Last update timestamp in ISO 8601 format.
                    required:
                      - id
                      - provider
                      - label
                      - accountLabel
                      - scopes
                      - credentialExpiresAt
                      - timezone
                      - status
                      - statusMessage
                      - lastCheckedAt
                      - capabilities
                      - createdAt
                      - updatedAt
                    title: CalendarConnection
                    description: >-
                      A project’s credential for one calendar account, the thing
                      a calendar tool books against. The credential itself is
                      never returned.
                required:
                  - data
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Validation error
              example:
                type: validation
                code: invalid_parameter
                message: The request was invalid
                param: email
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Authentication error
              example:
                type: authentication
                code: unauthorized
                message: Authentication required
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Not found error
              example:
                type: not_found
                code: resource_not_found
                message: The requested resource could not be found
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Conflict error
              example:
                type: conflict
                code: resource_in_use
                message: The resource is in use and cannot be deleted
          description: Conflict
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Server error
              example:
                type: internal
                code: internal_error
                message: Internal server error
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Roark from '@roarkanalytics/sdk';


            const client = new Roark({
              bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
            });


            const calendarConnection = await
            client.calendarConnection.update('connectionId');


            console.log(calendarConnection.data);
        - lang: Python
          source: |-
            import os
            from roark_analytics import Roark

            client = Roark(
                bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"),  # This is the default and can be omitted
            )
            calendar_connection = client.calendar_connection.update(
                connection_id="connectionId",
            )
            print(calendar_connection.data)
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - validation
            - authentication
            - forbidden
            - not_found
            - conflict
            - payment_required
            - rate_limit
            - internal
          description: The error type category
          examples:
            - validation
            - authentication
        code:
          type: string
          description: Machine-readable error code identifier
          examples:
            - invalid_parameter
            - missing_required_field
            - unauthorized
        message:
          type: string
          description: Human-readable error message
          examples:
            - The request was invalid
            - Authentication required
        param:
          type: string
          description: The parameter that caused the error (if applicable)
          examples:
            - email
            - user_id
        details:
          description: Additional error context information
      required:
        - type
        - code
        - message
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.