---
title: "Change connection settings"
method: PATCH
path: "/v1/connections/{connection}"
tags: ["Connections"]
---

# Change connection settings

`PATCH /v1/connections/{connection}`

## Request

- Base URL: `https://www.chatrail.dev`
- URL: `https://www.chatrail.dev/v1/connections/{connection}`
- Auth: HTTP bearer

Send only the settings you want to change. `reject_calls` declines incoming calls on this number automatically. It is off by default, because the caller sees the call declined. Each call is still announced as `call.received`, with `rejected` saying whether it was declined. `proxy` routes this number through its own HTTP proxy (Team plan), or removes it with `null` (any plan). A proxy is `server` (an IP address and port, not a hostname, and a public address) with an optional `username` and `password`. It is applied when the number is paired, so it can only be changed before the number is linked, or after WhatsApp has logged it out. The response shows the address and `has_credentials`; the username and password are never returned.

## Path parameters

- `connection` string, required

## Request body

- object
  - `reject_calls` boolean
  - `proxy` object, nullable
    - `server` string, required

## Response `200`

The updated connection.

## Other responses

- `400`: A setting is not valid, such as a proxy that is a hostname or a private address.
- `402`: The plan does not include proxies.
- `404`: No such connection.
- `409`: The proxy cannot be changed: the number is linked.
- `422`: The number's WhatsApp engine cannot use a proxy.

---

[API](https://skmtc.dev/chatrail/apis/chatrail-api.md) · [All operations](https://skmtc.dev/chatrail/apis/chatrail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatrail/apis/chatrail-api/revisions/acc5b88c6f59?raw)
