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

# Set Cal.com settings

> Replace Cal.com settings for one owned number. Omitted configuration values do not retain the previous saved values.

**FIXED · call** For new Google Calendar or Cal.com voice bookings, collect spelled name and email separately. Finish the combined read-back and get a later clear yes before the write, even with require\_booking\_confirmation=false. To reschedule or cancel an existing Cal.com appointment that changed across lookups, read back the current target in full and get a fresh yes. Google Calendar skips this; its moves and cancels follow require\_booking\_confirmation. Confirm success only after the calendar write succeeds. SMS uses its own flow.

**NOT OFFERED → do this instead · number** The booking zone cannot change general call time. Set calcom\_timezone\_override on the number to an IANA zone, or null to inherit. Cal.com uses number → agent → saved connection → Europe/London. With a booking context, read effective\_calcom\_timezone and effective\_calcom\_timezone\_source. Google Calendar keeps its own number-calendar setting.

**YOU CAN CHANGE · number** Supported Google Calendar settings include availability hours, timezone and invitation behaviour. These configure that number’s booking calendar. `timezone`, `hours`, `slot_minutes`, `calendar_id`, `send_invites`.

**SCOPE · number** For an owned number assigned to an agent, send only return\_url to start Google Calendar consent. Open the returned url for the calendar owner. A competing calendar is refused. Read the number’s status after consent to confirm connection.

[Read the compact AI rules](https://docs.nixflex.com/ai-rules.md#bookings-calendars)

Save Cal.com settings for an owned phone number. This replaces the saved configuration for this integration; omitted configuration values do not preserve the old values.

Method: **PUT** · Success: **200** · Scope: **Owning account**

**The important part**

* Only one booking calendar can cover a number. Start Google Calendar consent with the [per-number connect endpoint](https://docs.nixflex.com/api-reference/integration-settings/google-calendar.md), then open the returned URL for the calendar owner.

* Save the setting for the exact owned target, then read it back to confirm.

* Only one booking provider can be active for a number.

* Available times and appointment length come from the Cal.com event type and its schedule. Nixflex saves no Cal.com hours or length setting.

[Business guide](https://docs.nixflex.com/guides/business/calcom.md) · [Developer guide](https://docs.nixflex.com/actions/calcom.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Authentication

Send `Authorization: Bearer KEY_ID:KEY_SECRET` using the owning account’s server-side credential. When personal dashboard sessions are enabled, Owner and Admin sessions can write these settings; Member sessions can read only. Ownership checks still apply. Send `Content-Type: application/json`.

## Request fields

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `phoneNumber` (path) | string | Yes | None | Owned E.164 number. URL-encode the leading plus sign. |

Send a JSON object. Credential values must stay private.

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `is_active` | boolean | No | `true` | Only literal false disables this configuration. |
| `agent_id` | string | No | Omitted | Fallback agent ID used only when the number has no assigned agent; does not move the number. |
| `api_key` | string | Yes | None | Calendar API credential; trimmed and never returned by GET. |
| `username` | string | Yes | None | Calendar username; trimmed. |
| `event_slug` | string | Yes | None | Calendar event slug; trimmed. |
| `default_timezone` | string | No | `"Europe/London"` | Calendar time zone. |

Per-number calendar settings override agent settings. A conflict with another booking calendar is checked only after number ownership. This endpoint does not connect or disconnect other integrations. Start Google Calendar consent with the [per-number connect endpoint](https://docs.nixflex.com/api-reference/integration-settings/google-calendar.md), then open the returned URL for the calendar owner. HTTP 409 booking\_provider\_conflict refuses a competing calendar before saving. The error identifies the connected provider in details.connected\_provider. Number connections and the agent-level fallback are both checked; changing is\_active does not bypass that guard. Number-level message pattern: `CALENDAR is already connected to NUMBER. Only one booking calendar can be connected to a number at a time - the AI would be given both sets of booking tools and would silently use only one. Disconnect CALENDAR first, then connect Cal.com.` Agent-level message pattern: `CALENDAR is already connected to this agent, which covers every number on it. Only one booking calendar can be active at a time. Disconnect CALENDAR first, then connect Cal.com.` CALENDAR and NUMBER are replaced with the connected calendar label and owned number.

## Response fields

`200 OK` returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.

| Field | Type | Meaning |
| - | - | - |
| `ok` | boolean | Request succeeded. Value: `true`. |
| `phone_number` | string | Owned phone number. |
| `provider` | string | Integration identifier. Value: `"calcom"`. |
| `is_active` | boolean | Whether the saved integration is enabled. |

## Example request

Examples require Node/CLI 0.11.0 or later, Python 0.4.0 or later and MCP 0.5.0 or later. Keep `NIXFLEX_API_KEY` in your private process environment. The cURL example uses Bash. Use approved owned fixtures and keep configuration responses private. Python shows sync usage; AsyncNixflex uses the same method with async with and await. Configure the existing MCP installation for the same account at `https://api.nixflex.com`. Save the request JSON fields from the example below in request-12.json privately before using cURL or CLI; replace fixture credentials only in that private file. Review the target and payload before this write.

```json request-12.json theme={"dark"}
{
  "api_key": "fixture_calendar_credential",
  "username": "team",
  "event_slug": "consultation",
  "default_timezone": "Europe/London",
  "is_active": false,
  "agent_id": "agent/example"
}
```

```bash cURL theme={"dark"}
curl --request PUT \
  --url "https://api.nixflex.com/v1/integrations/calcom/number/%2B12025550123" \
  --header "Authorization: Bearer $NIXFLEX_API_KEY" \
  --header "Content-Type: application/json" \
  --data-binary @request-12.json
```

```javascript Node theme={"dark"}
import Nixflex from 'nixflex';
const c = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl:'https://api.nixflex.com',maxRetries:0});
const result = await c.integrations.set("calcom", "+12025550123", {"api_key": "fixture_calendar_credential", "username": "team", "event_slug": "consultation", "default_timezone": "Europe/London", "is_active": false, "agent_id": "agent/example"});
// Keep private responses out of logs and AI conversations.
```

```python Python theme={"dark"}
import os
from nixflex import Nixflex
with Nixflex(api_key=os.environ["NIXFLEX_API_KEY"], base_url="https://api.nixflex.com", max_retries=0) as c:
    result = c.integrations.set('calcom', '+12025550123', api_key='fixture_calendar_credential', username='team', event_slug='consultation', default_timezone='Europe/London', is_active=False, agent_id='agent/example')
```

```powershell CLI (PowerShell) theme={"dark"}
# Save the documented JSON fields privately as request-12.json first.
nixflex integrations set calcom '+12025550123' --body '@request-12.json' --confirm --json --base-url "https://api.nixflex.com"
```

MCP does not offer this operation because it accepts private credentials or executable settings; use the API, Node, CLI or Python.

## Example response

Illustrative `200` response. Identifiers and values are examples; some optional or compatibility fields are omitted.

```json Response theme={"dark"}
{
  "ok": true,
  "phone_number": "+12025550100",
  "provider": "calcom",
  "is_active": true
}
```

## Errors

Failures return an `error` object with `code`, `message`, `doc_url` and optional details. Each code links to the shared error catalog. Read the message and details before deciding whether to resend.

| Status | Code | Meaning | What to do |
| - | - | - | - |
| 500 | [`server_error`](https://docs.nixflex.com/api-reference/errors#server_error) | The result could not be confirmed. | Read the current state before retrying a write. |
| 404 | [`not_found`](https://docs.nixflex.com/api-reference/errors#not_found) | No matching owned resource or saved configuration was found. | Check the identifier and owning account. |
| 400 | [`invalid_phone`](https://docs.nixflex.com/api-reference/errors#invalid_phone) | The number is not valid E.164. | Correct the request before retrying. |
| 400 | [`missing_field`](https://docs.nixflex.com/api-reference/errors#missing_field) | A required field is missing or has the wrong type. | Correct the request before retrying. |
| 409 | [`booking_provider_conflict`](https://docs.nixflex.com/api-reference/errors#booking_provider_conflict) | Another booking calendar is connected to this number or its agent. | Choose one booking calendar for this number. |
| 400 | [`invalid_json`](https://docs.nixflex.com/api-reference/errors#invalid_json) | The JSON body could not be parsed. | Correct the request before retrying. |
| 413 | [`payload_too_large`](https://docs.nixflex.com/api-reference/errors#payload_too_large) | The request body is too large. | Reduce the request body. |
| 401 | [`unauthorized`](https://docs.nixflex.com/api-reference/errors#unauthorized) | The credential is missing or invalid. | Check the full account credential. |
| 429 | [`rate_limit_exceeded`](https://docs.nixflex.com/api-reference/errors#rate_limit_exceeded) | The account request limit was reached. | Wait for Retry-After. Reconcile uncertain writes before resending. |

## Retry and idempotency

This is a replacement write with no idempotency token. Read the current settings after a timeout before deciding whether to resend. Never overwrite a newer configuration blindly.

## Related endpoints

* [Get Cal.com settings](https://docs.nixflex.com/api-reference/integration-settings/get-integrations-calcom-number-phoneNumber.md)
* [Delete Cal.com settings](https://docs.nixflex.com/api-reference/integration-settings/delete-integrations-calcom-number-phoneNumber.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md#error-envelope)


## OpenAPI

````yaml api-reference/public.openapi.json PUT /integrations/calcom/number/{phoneNumber}
openapi: 3.1.0
info:
  title: Nixflex public API
  version: 1.0.0
  description: >-
    Nixflex API reference for agents, calls, messaging, knowledge, organisations
    and integrations. Authenticate with the owning account and follow each
    operation’s permissions, response and retry contract.
servers:
  - url: https://api.nixflex.com/v1
security:
  - bearerAuth: []
paths:
  /integrations/calcom/number/{phoneNumber}:
    put:
      tags:
        - Integration settings
      summary: Set Cal.com settings
      description: >-
        Save Cal.com settings for an owned phone number. This replaces the saved
        configuration for this integration; omitted configuration values do not
        preserve the old values. Per-number calendar settings override agent
        settings. A conflict with another booking calendar is checked only after
        number ownership. This endpoint does not connect or disconnect other
        integrations. Start Google Calendar authorisation through POST
        /v1/integrations/google-calendar/number/{phoneNumber}/connect and open
        the returned URL for the calendar owner. HTTP 409
        booking_provider_conflict refuses a competing calendar before saving.
        The error identifies the connected provider in
        details.connected_provider. Number connections and the agent-level
        fallback are both checked; changing is_active does not bypass that
        guard. Number-level message pattern: `CALENDAR is already connected to
        NUMBER. Only one booking calendar can be connected to a number at a time
        - the AI would be given both sets of booking tools and would silently
        use only one. Disconnect CALENDAR first, then connect Cal.com.`
        Agent-level message pattern: `CALENDAR is already connected to this
        agent, which covers every number on it. Only one booking calendar can be
        active at a time. Disconnect CALENDAR first, then connect Cal.com.`
        CALENDAR and NUMBER are replaced with the connected calendar label and
        owned number.
      operationId: setCalcom
      parameters:
        - name: phoneNumber
          in: path
          required: true
          schema:
            type: string
            description: Owned E.164 number. URL-encode the leading plus sign.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_active:
                  type: boolean
                  description: Only literal false disables this configuration.
                  default: true
                agent_id:
                  type: string
                  description: >-
                    Fallback agent ID used only when the number has no assigned
                    agent; does not move the number.
                api_key:
                  type: string
                  description: Calendar API credential; trimmed and never returned by GET.
                  writeOnly: true
                username:
                  type: string
                  description: Calendar username; trimmed.
                event_slug:
                  type: string
                  description: Calendar event slug; trimmed.
                default_timezone:
                  type: string
                  description: Calendar time zone.
                  default: Europe/London
              required:
                - api_key
                - username
                - event_slug
              additionalProperties: false
              description: Send a JSON object. Credential values must stay private.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    description: Request succeeded.
                    const: true
                  phone_number:
                    type: string
                    description: Owned phone number.
                  provider:
                    type: string
                    description: Integration identifier.
                    const: calcom
                  is_active:
                    type: boolean
                    description: Whether the saved integration is enabled.
                required:
                  - ok
                  - phone_number
                  - provider
                  - is_active
                additionalProperties: false
                description: ''
              example:
                ok: true
                phone_number: '+12025550100'
                provider: calcom
                is_active: true
        '400':
          description: >-
            invalid_phone: The number is not valid E.164. missing_field: A
            required field is missing or has the wrong type. invalid_json: The
            JSON body could not be parsed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error category.
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Safe explanation.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    additionalProperties: false
                    description: ''
                required:
                  - error
                additionalProperties: false
                description: ''
        '401':
          description: 'unauthorized: The credential is missing or invalid.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error category.
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Safe explanation.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    additionalProperties: false
                    description: ''
                required:
                  - error
                additionalProperties: false
                description: ''
        '404':
          description: >-
            not_found: No matching owned resource or saved configuration was
            found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error category.
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Safe explanation.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    additionalProperties: false
                    description: ''
                required:
                  - error
                additionalProperties: false
                description: ''
        '409':
          description: >-
            booking_provider_conflict: Another booking calendar is connected to
            this number or its agent.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error category.
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Safe explanation.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    additionalProperties: false
                    description: ''
                required:
                  - error
                additionalProperties: false
                description: ''
              examples:
                booking_provider_conflict:
                  summary: Another calendar is connected (illustrative owned number)
                  value:
                    error:
                      type: conflict
                      code: booking_provider_conflict
                      message: >-
                        Google Calendar is already connected to +12025550123.
                        Only one booking calendar can be connected to a number
                        at a time - the AI would be given both sets of booking
                        tools and would silently use only one. Disconnect Google
                        Calendar first, then connect Cal.com.
                      doc_url: >-
                        https://docs.nixflex.com/errors/booking_provider_conflict
                      details:
                        connected_provider: gcal
        '413':
          description: 'payload_too_large: The request body is too large.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error category.
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Safe explanation.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    additionalProperties: false
                    description: ''
                required:
                  - error
                additionalProperties: false
                description: ''
        '429':
          description: 'rate_limit_exceeded: The account request limit was reached.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error category.
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Safe explanation.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    additionalProperties: false
                    description: ''
                required:
                  - error
                additionalProperties: false
                description: ''
        '500':
          description: 'server_error: The result could not be confirmed.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error category.
                      code:
                        type: string
                        description: Machine-readable error code.
                      message:
                        type: string
                        description: Safe explanation.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    additionalProperties: false
                    description: ''
                required:
                  - error
                additionalProperties: false
                description: ''
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        KEY_ID:KEY_SECRET from the owning account. Keep it server-side. A
        verified personal dashboard Bearer session may be used where the
        operation documents role-based access.

````

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