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

# Update Google Calendar settings

> Set calendar timezone, weekly hours, slot length and caller invitations for an owned Nixflex number. Omitted settings retain their saved value.

**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)

Set calendar timezone, weekly hours, slot length and caller invitations for an owned Nixflex number. Omitted settings retain their saved value.

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

**The important part**

* Send all seven days when changing working\_hours and use an IANA time zone.
* send\_invites requests Google notifications; it does not confirm inbox delivery.

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

## Authentication

Use `Authorization: Bearer KEY_ID:KEY_SECRET` for the owning account. An organisation API key has Owner authority. Personal sessions use the role rules documented in [Authentication](https://docs.nixflex.com/api-reference/authentication.md); do not treat a Member session as an API key.

## Request fields

| Field | Type | Required | Default and limits |
| - | - | - | - |
| `phoneNumber` (path) | string | Yes | Owned E.164 number. URL-encode the leading +. |

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `timezone` | string | No | Unchanged | IANA timezone. Explicit per-number timezone wins; older settings can inherit the agent timezone. At most 100 characters |
| `hours` | object | No | Unchanged | Replace the entire seven-day map. Omit to retain saved hours. |
| `slot_minutes` | integer | No | Unchanged | Older connections default to 30 minutes. Allowed: 15, 30, 45, 60 |
| `calendar_id` | string | No | Unchanged | Editable calendar ID; primary by default. At most 1024 characters |
| `send_invites` | boolean | No | Unchanged | Defaults to true when not previously stored. Omission on PATCH preserves the setting. Google controls delivery. |

Send one or more fields. Omission preserves each saved value. `hours` replaces the whole map: provide all seven lowercase weekday names, each null or exactly `["HH:MM", "HH:MM"]`. Closing must follow opening on the same day; overnight intervals are refused. Legacy defaults are Monday–Friday 09:00–17:00, 30-minute slots and `primary` calendar.

`send_invites` is a JSON boolean. Existing connections default to true when the value is absent. A string such as `"false"`, null or a number is refused. When enabled, Google is asked to email the caller an invitation, update or cancellation; Google controls delivery. No owner attendee or separate owner email is added. Setting false requests no Google notification. See [booking flow](https://docs.nixflex.com/actions/booking-confirmation.md).

## Response fields

`200` returns the following shape.

| Field | Type | Meaning |
| - | - | - |
| `timezone` | string | IANA timezone. Explicit per-number timezone wins; older settings can inherit the agent timezone. At most 100 characters |
| `hours` | object | Replace the entire seven-day map. Omit to retain saved hours. |
| `hours.monday` | alternative shapes | Null when closed; otherwise \[opening, closing], with closing strictly after opening on the same day. |
| `hours.tuesday` | alternative shapes | Null when closed; otherwise \[opening, closing], with closing strictly after opening on the same day. |
| `hours.wednesday` | alternative shapes | Null when closed; otherwise \[opening, closing], with closing strictly after opening on the same day. |
| `hours.thursday` | alternative shapes | Null when closed; otherwise \[opening, closing], with closing strictly after opening on the same day. |
| `hours.friday` | alternative shapes | Null when closed; otherwise \[opening, closing], with closing strictly after opening on the same day. |
| `hours.saturday` | alternative shapes | Null when closed; otherwise \[opening, closing], with closing strictly after opening on the same day. |
| `hours.sunday` | alternative shapes | Null when closed; otherwise \[opening, closing], with closing strictly after opening on the same day. |
| `slot_minutes` | integer | Older connections default to 30 minutes. Allowed: 15, 30, 45, 60 |
| `calendar_id` | string | Editable calendar ID; primary by default. At most 1024 characters |
| `send_invites` | boolean | Defaults to true when not previously stored. Omission on PATCH preserves the setting. Google controls delivery. |

The response contains safe settings and `send_invites`; it contains no OAuth credentials.

## Example request

Production HTTP examples. Replace the placeholder identifiers with resources owned by the account. Set `NIXFLEX_API_KEY` privately; never print it.

```bash cURL (Bash) theme={"dark"}
curl --request PATCH \
  --url 'https://api.nixflex.com/v1/integrations/google-calendar/number/%2B12025550123' \
  --header "Authorization: Bearer $NIXFLEX_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"timezone":"Europe/London","send_invites":true}'
```

```javascript Node (HTTP) theme={"dark"}
const response = await fetch('https://api.nixflex.com/v1/integrations/google-calendar/number/%2B12025550123', {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.NIXFLEX_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"timezone":"Europe/London","send_invites":true}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await response.json();
// Handle the private result without logging it.
```

```python Python (HTTP) theme={"dark"}
import os, json
from urllib.request import Request, urlopen

request = Request('https://api.nixflex.com/v1/integrations/google-calendar/number/%2B12025550123', method='PATCH',
    headers={'Authorization': 'Bearer ' + os.environ['NIXFLEX_API_KEY'], 'Content-Type': 'application/json'},
    data="{\"timezone\":\"Europe/London\",\"send_invites\":true}".encode("utf-8"))
with urlopen(request, timeout=30) as response:
    result = json.load(response)
# Handle the private result without logging it.
```

```powershell PowerShell (HTTP) theme={"dark"}
$headers = @{ Authorization = "Bearer $env:NIXFLEX_API_KEY" }
$body = '{"timezone":"Europe/London","send_invites":true}'
$result = Invoke-RestMethod -Method PATCH -Uri 'https://api.nixflex.com/v1/integrations/google-calendar/number/%2B12025550123' -Headers $headers -DisableKeepAlive -ContentType "application/json" -Body ([Text.Encoding]::UTF8.GetBytes($body))
# Handle $result privately.
```

## Example response

Illustrative response with placeholder identifiers.

```json Response theme={"dark"}
{
  "timezone": "Europe/London",
  "hours": {
    "monday": [
      "09:00",
      "17:00"
    ],
    "tuesday": [
      "09:00",
      "17:00"
    ],
    "wednesday": [
      "09:00",
      "17:00"
    ],
    "thursday": [
      "09:00",
      "17:00"
    ],
    "friday": [
      "09:00",
      "17:00"
    ],
    "saturday": null,
    "sunday": null
  },
  "slot_minutes": 30,
  "calendar_id": "primary",
  "send_invites": true
}
```

## Errors

Branch on `error.code`, not the wording of `error.message`. The envelope includes `type`, `code`, `message`, `doc_url` and `details`.

| Status / code | What it means | What to do |
| - | - | - |
| 400 · `invalid_settings` | The settings object contains unsupported fields or values. | Send only supported setting fields, using their documented types. |
| 400 · `invalid_timezone` | The time zone is invalid. | Supply a valid IANA time zone such as Europe/London. |
| 400 · `invalid_hours` | The weekly hours shape or a time interval is invalid. | Send a valid working\_hours object containing all seven days. |
| 400 · `invalid_slot_minutes` | The slot length is outside the supported values. | Use an allowed whole-number slot length from the request fields. |
| 400 · `invalid_calendar_id` | The calendar identifier is invalid. | Supply a valid calendar ID accessible to the connected account. |
| 400 · `invalid_send_invites` | The invitation switch is not a boolean. | Send the JSON boolean true or false, or omit the field to keep its saved value. |
| 401 · `unauthorized` | The credential is missing or invalid. | Check the full account credential and API host privately; stop the retry loop. |
| 403 · `permission_denied` | This actor cannot perform the operation. | Resolve the account or role restriction through an authorised person. |
| 403 · `account_unavailable` | The account is unavailable for this operation. | Resolve the account or role restriction through an authorised person. |
| 404 · `number_not_found` | The number is absent or inaccessible to this account. | Check the exact owned identifier and current resource state; do not probe another account. |
| 409 · `not_connected` | The number has no active calendar connection. | Connect this number before changing calendar settings. |
| 409 · `expired_link` | The consent or connection state is no longer current. | Start a fresh consent flow after checking the current connection. |
| 429 · `rate_limit_exceeded` | The request limit was reached. | Stop automatic retries; wait for the limit and reconcile state before a deliberate action. |
| 503 · `calendar_unavailable` | The calendar operation or status check could not be completed. | Treat the outcome as uncertain and read the affected resource before another deliberate change. |

`invalid_send_invites` means the value was not a boolean. PATCH requires a connected calendar.

## Retry and idempotency

Disable automatic write retries. A lost response leaves the result uncertain; read the affected resource before another deliberate action. No general Idempotency-Key replay guarantee applies. See [retry rules](https://docs.nixflex.com/api-reference/retries.md).

## Related endpoints

* [Connect Google Calendar](https://docs.nixflex.com/api-reference/integration-settings/google-calendar.md)
* [Get Google Calendar status](https://docs.nixflex.com/api-reference/integration-settings/google-calendar-status.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md#error-envelope)


## OpenAPI

````yaml api-reference/public.openapi.json PATCH /integrations/google-calendar/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/google-calendar/number/{phoneNumber}:
    patch:
      tags:
        - Google Calendar
      summary: Update Google Calendar settings
      description: >-
        Organisation API key or verified dashboard session. Owner/Admin can
        write; Member can read. Other organisations cannot access this number.
      operationId: updateNumberGoogleCalendarSettings
      parameters:
        - name: phoneNumber
          in: path
          required: true
          description: Owned E.164 number. URL-encode the leading +.
          schema:
            type: string
            pattern: ^\+[1-9][0-9]{1,14}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                timezone:
                  type: string
                  maxLength: 100
                  description: >-
                    IANA timezone. Explicit per-number timezone wins; older
                    settings can inherit the agent timezone.
                hours:
                  type: object
                  properties:
                    monday:
                      anyOf:
                        - type: 'null'
                        - type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                      description: >-
                        Null when closed; otherwise [opening, closing], with
                        closing strictly after opening on the same day.
                    tuesday:
                      anyOf:
                        - type: 'null'
                        - type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                      description: >-
                        Null when closed; otherwise [opening, closing], with
                        closing strictly after opening on the same day.
                    wednesday:
                      anyOf:
                        - type: 'null'
                        - type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                      description: >-
                        Null when closed; otherwise [opening, closing], with
                        closing strictly after opening on the same day.
                    thursday:
                      anyOf:
                        - type: 'null'
                        - type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                      description: >-
                        Null when closed; otherwise [opening, closing], with
                        closing strictly after opening on the same day.
                    friday:
                      anyOf:
                        - type: 'null'
                        - type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                      description: >-
                        Null when closed; otherwise [opening, closing], with
                        closing strictly after opening on the same day.
                    saturday:
                      anyOf:
                        - type: 'null'
                        - type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                      description: >-
                        Null when closed; otherwise [opening, closing], with
                        closing strictly after opening on the same day.
                    sunday:
                      anyOf:
                        - type: 'null'
                        - type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                      description: >-
                        Null when closed; otherwise [opening, closing], with
                        closing strictly after opening on the same day.
                  required:
                    - monday
                    - tuesday
                    - wednesday
                    - thursday
                    - friday
                    - saturday
                    - sunday
                  additionalProperties: false
                  description: >-
                    Replace the entire seven-day map. Omit to retain saved
                    hours.
                slot_minutes:
                  type: integer
                  enum:
                    - 15
                    - 30
                    - 45
                    - 60
                  description: Older connections default to 30 minutes.
                calendar_id:
                  type: string
                  minLength: 1
                  maxLength: 1024
                  pattern: ^[^\s\x00-\x1f\x7f]+$
                  description: Editable calendar ID; primary by default.
                send_invites:
                  type: boolean
                  description: >-
                    Defaults to true when not previously stored. Omission on
                    PATCH preserves the setting. Google controls delivery.
              minProperties: 1
              additionalProperties: false
      responses:
        '200':
          description: 'Success. Cache-Control: no-store.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  timezone:
                    type: string
                    maxLength: 100
                    description: >-
                      IANA timezone. Explicit per-number timezone wins; older
                      settings can inherit the agent timezone.
                  hours:
                    type: object
                    properties:
                      monday:
                        anyOf:
                          - type: 'null'
                          - type: array
                            minItems: 2
                            maxItems: 2
                            items:
                              type: string
                              pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                        description: >-
                          Null when closed; otherwise [opening, closing], with
                          closing strictly after opening on the same day.
                      tuesday:
                        anyOf:
                          - type: 'null'
                          - type: array
                            minItems: 2
                            maxItems: 2
                            items:
                              type: string
                              pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                        description: >-
                          Null when closed; otherwise [opening, closing], with
                          closing strictly after opening on the same day.
                      wednesday:
                        anyOf:
                          - type: 'null'
                          - type: array
                            minItems: 2
                            maxItems: 2
                            items:
                              type: string
                              pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                        description: >-
                          Null when closed; otherwise [opening, closing], with
                          closing strictly after opening on the same day.
                      thursday:
                        anyOf:
                          - type: 'null'
                          - type: array
                            minItems: 2
                            maxItems: 2
                            items:
                              type: string
                              pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                        description: >-
                          Null when closed; otherwise [opening, closing], with
                          closing strictly after opening on the same day.
                      friday:
                        anyOf:
                          - type: 'null'
                          - type: array
                            minItems: 2
                            maxItems: 2
                            items:
                              type: string
                              pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                        description: >-
                          Null when closed; otherwise [opening, closing], with
                          closing strictly after opening on the same day.
                      saturday:
                        anyOf:
                          - type: 'null'
                          - type: array
                            minItems: 2
                            maxItems: 2
                            items:
                              type: string
                              pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                        description: >-
                          Null when closed; otherwise [opening, closing], with
                          closing strictly after opening on the same day.
                      sunday:
                        anyOf:
                          - type: 'null'
                          - type: array
                            minItems: 2
                            maxItems: 2
                            items:
                              type: string
                              pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                        description: >-
                          Null when closed; otherwise [opening, closing], with
                          closing strictly after opening on the same day.
                    required:
                      - monday
                      - tuesday
                      - wednesday
                      - thursday
                      - friday
                      - saturday
                      - sunday
                    additionalProperties: false
                    description: >-
                      Replace the entire seven-day map. Omit to retain saved
                      hours.
                  slot_minutes:
                    type: integer
                    enum:
                      - 15
                      - 30
                      - 45
                      - 60
                    description: Older connections default to 30 minutes.
                  calendar_id:
                    type: string
                    minLength: 1
                    maxLength: 1024
                    pattern: ^[^\s\x00-\x1f\x7f]+$
                    description: Editable calendar ID; primary by default.
                  send_invites:
                    type: boolean
                    description: >-
                      Defaults to true when not previously stored. Omission on
                      PATCH preserves the setting. Google controls delivery.
                required:
                  - timezone
                  - hours
                  - slot_minutes
                  - calendar_id
                  - send_invites
              example:
                timezone: Europe/London
                hours:
                  monday:
                    - '09:00'
                    - '17:00'
                  tuesday:
                    - '09:00'
                    - '17:00'
                  wednesday:
                    - '09:00'
                    - '17:00'
                  thursday:
                    - '09:00'
                    - '17:00'
                  friday:
                    - '09:00'
                    - '17:00'
                  saturday: null
                  sunday: null
                slot_minutes: 30
                calendar_id: primary
                send_invites: true
        '400':
          description: >-
            invalid_settings, invalid_timezone, invalid_hours,
            invalid_slot_minutes, invalid_calendar_id, invalid_send_invites.
            Standard error envelope; branch on error.code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                required:
                  - error
        '401':
          description: unauthorized. Standard error envelope; branch on error.code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                required:
                  - error
        '403':
          description: >-
            permission_denied, account_unavailable. Standard error envelope;
            branch on error.code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                required:
                  - error
        '404':
          description: number_not_found. Standard error envelope; branch on error.code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                required:
                  - error
        '409':
          description: >-
            not_connected, expired_link. Standard error envelope; branch on
            error.code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                required:
                  - error
        '429':
          description: rate_limit_exceeded. Standard error envelope; branch on error.code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                required:
                  - error
        '503':
          description: calendar_unavailable. Standard error envelope; branch on error.code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                required:
                  - error
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.