> ## 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.

# Check a calendar connection

> Re-verifies the stored credential against the provider and records the result on the connection. A credential the provider rejects sets `status` to INVALID_CREDENTIALS. A provider outage is a 500 and leaves the status untouched: being unable to reach the provider is not evidence that the customer’s credential is bad.



## OpenAPI

````yaml /api-reference/openapi.documented.json post /v1/calendar-connection/{connectionId}/check
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: Agent
  - name: Agent Endpoint
  - name: Tool
  - name: Phone Number
  - name: Call
  - name: Chat
  - name: Metric
  - name: Metric Policy
  - name: Metric Collection Job
  - name: Customer Flow
  - name: Customer Flow Edge Case
  - name: Simulation
  - name: Simulation Persona
  - name: Simulation Environment
  - name: Simulation Scenario
  - name: Simulation Run Plan
  - name: Simulation Template
  - name: Simulation Run Plan Job
  - name: Simulation Job
  - name: HTTP Request Definition
  - name: Webhook
  - name: Issue
  - name: Autoimprove
  - name: Agent Config
  - name: Knowledge Base
  - name: Calendar Connection
  - name: Config
  - name: Organization Project
  - name: Organization Project Member
  - name: Organization Project API Key
  - name: Organization Config
  - name: CLI Auth
  - name: Me
  - name: Project
  - name: Usage
  - name: Analytics
  - name: Dashboard
  - name: Live Report
  - name: Benchmark
  - name: Health
  - name: Prospect Simulation
paths:
  /v1/calendar-connection/{connectionId}/check:
    post:
      tags:
        - Calendar Connection
      summary: Check a calendar connection
      description: >-
        Re-verifies the stored credential against the provider and records the
        result on the connection. A credential the provider rejects sets
        `status` to INVALID_CREDENTIALS. A provider outage is a 500 and leaves
        the status untouched: being unable to reach the provider is not evidence
        that the customer’s credential is bad.
      operationId: postV1Calendar-connectionByConnectionIdCheck
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
          description: Calendar connection ID
      responses:
        '200':
          description: The connection, with the result of the check.
          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
                        description: >-
                          Who holds the calendar. CAL_COM is the only provider
                          that can be connected today; GOOGLE and CALENDLY are
                          described by `capabilities` but not yet connectable.
                      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 this provider is authenticated.
                          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 raw calendar, which exposes only events
                              and free/busy. Roark then owns bookable hours,
                              duration, buffers, lead time and horizon, because
                              the provider has no notion of them.
                          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
        '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
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Rate limit error
              example:
                type: rate_limit
                code: too_many_requests
                message: Rate limit exceeded
          description: Too Many Requests
        '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 response = await
            client.calendarConnection.check('connectionId');


            console.log(response.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
            )
            response = client.calendar_connection.check(
                "connectionId",
            )
            print(response.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.