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

# Connect Agent Cal.com

> Connects a private white-label Cal.com API key for a single agent. The request is blocked if the agent already has an org-level Cal.com account linked.

### Authorizations

<ParamField header="Authorization" type="string" required>
  Your JWT access token. Pass it as a Bearer token in the `Authorization` header. Example: `Authorization: Bearer <token>`.
</ParamField>

***

### Path Parameters

<ParamField path="agent_id" type="string" required>
  The agent UUID whose private Cal.com key you want to connect.
</ParamField>

***

### Body

<ParamField body="org_id" type="string">
  Optional organization ID. When omitted, the organization is resolved from the agent.
</ParamField>

<ParamField body="api_key" type="string" required>
  The private Cal.com API key to connect for this agent.
</ParamField>

<ParamField body="account_name" type="string">
  Optional display name for the private Cal.com account. Defaults to `Default`.
</ParamField>

***

### Response

<ResponseField name="success" type="boolean">
  Whether the request succeeded.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": <boolean>,
    "message": "Cal.com connected successfully"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 400 theme={null}
  {
    "success": false,
    "message": "<string>",
    "code": "INVALID_REQUEST"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 400 theme={null}
  {
    "success": false,
    "message": "<string>",
    "code": "CONFLICT"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 401 theme={null}
  {
    "success": false,
    "message": "<string>"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 403 theme={null}
  {
    "success": false,
    "message": "<string>",
    "code": "PLAN_LIMIT"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 404 theme={null}
  {
    "success": false,
    "message": "<string>",
    "code": "NOT_FOUND"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 500 theme={null}
  {
    "success": false,
    "message": "<string>",
    "code": "INTERNAL_ERROR"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /api/v1/calcom/agents/{agent_id}/connect
openapi: 3.0.1
info:
  title: Agni API
  version: 1.0.0
  description: >-
    Agni API for managing agents, tools, widget settings, telephony, and
    integrations.
servers:
  - url: https://api.ravan.ai
security:
  - X-Api-Key: []
tags:
  - name: AgentService
  - name: AgentToolService
  - name: WidgetSettingsService
  - name: PhoneService
  - name: AppointmentService
  - name: GHLService
  - name: CalComService
  - name: CampaignService
  - name: ContactService
  - name: CallingService
  - name: RAGService
  - name: ModelService
  - name: HealthService
paths:
  /api/v1/calcom/agents/{agent_id}/connect:
    post:
      tags:
        - CalComService
      summary: Connect Agent Cal.com
      operationId: ConnectAgentCalcom
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
          description: Agent UUID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectAgentCalcomRequest'
            example:
              org_id: <string>
              api_key: <string>
              account_name: <string>
      responses:
        '200':
          description: Cal.com connected successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicSuccessResponse'
              example:
                success: true
                message: Cal.com connected successfully
        '400':
          description: Missing api_key or agent already linked to an org-level account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: <string>
                code: INVALID_REQUEST
        '401':
          description: Missing or invalid JWT
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
              example:
                success: false
                message: <string>
        '403':
          description: Plan does not include calendar integration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: <string>
                code: PLAN_LIMIT
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: <string>
                code: NOT_FOUND
        '500':
          description: Failed to save key or unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: <string>
                code: INTERNAL_ERROR
      security:
        - BearerAuth: []
components:
  schemas:
    ConnectAgentCalcomRequest:
      type: object
      required:
        - api_key
      properties:
        org_id:
          type: string
        api_key:
          type: string
        account_name:
          type: string
      example:
        org_id: <string>
        api_key: <string>
        account_name: <string>
    BasicSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
      example:
        success: true
        message: Cal.com disconnected successfully
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        code:
          type: string
    UnauthorizedResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
      example:
        success: false
        message: <string>
  securitySchemes:
    X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````