> ## 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 web calls

> Set the website voice-call switch for an owned Nixflex number. Review its saved state without starting a web call.

**FIXED · number** Website chat and website voice offer eligible custom functions only. Built-in calendar booking and availability are excluded. Phone and eligible SMS can use a configured calendar.

**NOT OFFERED → do this instead · number** Website install code is available only from the dashboard for now. The public API does not return ready-to-paste install HTML. Use the dashboard Install action for each customer’s number. The settings read includes install\_id. An install receipt only reports that a widget was seen.

**YOU CAN CHANGE · number** Enable website custom functions only when every enabled function on that number is safe for public visitors. To offer booking, share the business’s booking link or hand off to phone or SMS. Website voice uses one stored switch: `phone_numbers.web_calls_enabled`. Number PATCH (`web_calls_enabled`), web-agent PATCH (`settings.web_calls_enabled`) and web-calls integration PUT (`enabled`) write the same value.

**SCOPE · number** Configure each number’s sms\_prompt for SMS and web\_prompt for website chat and voice. Neither channel inherits its phone custom\_prompt. Both still use the agent knowledge enabled for that channel and follow their own channel rules.

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

Set the web calls setting for an owned number. This controls the saved number switch for website voice calls. Reading or changing the switch does not start a call.

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

**The important part**

* Save the setting for the exact owned target, then read it back to confirm.
* A saved web-call setting does not mean a browser session connected.

[Business guide](https://docs.nixflex.com/guides/voice-widget.md) · [Developer guide](https://docs.nixflex.com/web-assistant/overview.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

The stored website voice switch is `phone_numbers.web_calls_enabled`. These three requests write that same value: `PATCH /v1/phone-numbers/{phoneNumber}` with `web_calls_enabled`, `PATCH /v1/agent-web/{number}` with `settings.web_calls_enabled`, and `PUT /v1/integrations/web-calls/number/{phoneNumber}` with `enabled`. The number’s web agent must also allow website access.

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

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `enabled` | boolean | Yes | None | Required boolean; true enables and false disables the saved number switch. |

The GET response reports the saved number flag, not the full effective website availability. Agent settings and service availability can still prevent a website call. The website Web agent must also be on. Read phone-number details for web\_calls\_effective; account, agent and billing checks still apply.

## 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. |
| `web_calls_enabled` | boolean | The saved number switch. |

## 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-36.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-36.json theme={"dark"}
{
  "enabled": false
}
```

```bash cURL theme={"dark"}
curl --request PUT \
  --url "https://api.nixflex.com/v1/integrations/web-calls/number/%2B12025550123" \
  --header "Authorization: Bearer $NIXFLEX_API_KEY" \
  --header "Content-Type: application/json" \
  --data-binary @request-36.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("web-calls", "+12025550123", {"enabled": false});
// 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('web-calls', '+12025550123', enabled=False)
```

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

```json MCP theme={"dark"}
{
  "name": "set_number_web_calls",
  "arguments": {
    "phone_number": "+12025550123",
    "enabled": false,
    "confirm": true
  }
}
```

## 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",
  "web_calls_enabled": false
}
```

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

The operation writes one saved setting and has no idempotency token. Read the current value after an uncertain response. Repeating it can overwrite a newer change, so reconcile before resending.

## Related endpoints

* [Read web agent settings](https://docs.nixflex.com/api-reference/web-agent/get-agent-web-number.md)
* [Update web agent settings](https://docs.nixflex.com/api-reference/web-agent/patch-agent-web-number.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md#error-envelope)


## OpenAPI

````yaml api-reference/public.openapi.json PUT /integrations/web-calls/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/web-calls/number/{phoneNumber}:
    put:
      tags:
        - Integration settings
      summary: Set web calls
      description: >-
        Set the web calls setting for an owned number. This controls the saved
        number switch for website voice calls. Reading or changing the switch
        does not start a call. The GET response reports the saved number flag,
        not the full effective website availability. Agent settings and service
        availability can still prevent a website call. The website Web agent
        must also be on. Read phone-number details for web_calls_effective;
        account, agent and billing checks still apply.
      operationId: setWebCalls
      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:
                enabled:
                  type: boolean
                  description: >-
                    Required boolean; true enables and false disables the saved
                    number switch.
              required:
                - enabled
              additionalProperties: false
              description: ''
      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.
                  web_calls_enabled:
                    type: boolean
                    description: The saved number switch.
                required:
                  - ok
                  - phone_number
                  - web_calls_enabled
                additionalProperties: false
                description: ''
              example:
                ok: true
                phone_number: '+12025550100'
                web_calls_enabled: false
        '400':
          description: >-
            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: ''
        '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.