# Change a connection.

> Changing the harness, model, auth or base URL marks it `untested` again.
> https://koi.dog/docs/api/connections/update-connection/

`PATCH /api/v1/connections/{id}` · Scope: `config`

No query parameters.

## Path parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The connection's id. |

## Body.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | no | A name for the connection, shown in the dashboard. At least 1 character. |
| `harness` | `enum` | no | The coding agent program that runs the model. A machine runs it only when that harness is installed there. One of `claude-code`, `pi`, `codex`. |
| `provider` | `enum` | no | Who serves the model. One of `anthropic`, `morph`, `openai`, `custom`. |
| `model` | `string` | no | The model agents use when a launch names none. At least 1 character. |
| `auth` | `enum` | no | How the harness signs in. `local_login` uses the sign-in already on one paired machine, so it never runs on a cloud VM. One of `local_login`, `oauth_token`, `api_key`, `boat_profile`. |
| `baseUrl` | `string` | no | The provider's address, for a `custom` provider or a proxy. A URL. |
| `scope` | `enum` | no | Where it may run: `local` on paired machines, `cloud` on cloud workers, `both`. |
| `metering` | `enum` | no | How you pay the provider for it: `subscription` or `metered`. Shown in forecasts; Koidog bills nothing. |
| `maxConcurrent` | `1–100` | no | The most agents that use it at once; the rest wait. |
| `defaultOptions` | `object` | no | Options agents use when a launch names none. |
| `defaultOptions.effort` | `enum` | no | How much reasoning the model spends, where its harness lets you choose. Left out, the harness's default. One of `low`, `medium`, `high`, `xhigh`, `max`. |

## Response.

200 OK: a `Connection`. The example has placeholder values.

- **422 validation_failed**: The body does not match its schema; each problem is in `details`.

## Request.

```sh
curl -X PATCH "https://app.koi.dog/api/v1/connections/$ID" \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{}'
```

```js
const res = await fetch(`https://app.koi.dog/api/v1/connections/${process.env.ID}`, {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
console.log(await res.json());
```

```python
import os

import requests

r = requests.patch(
    f"https://app.koi.dog/api/v1/connections/{os.environ['ID']}",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
    json={},
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "id": "string",
  "name": "string",
  "harness": "claude-code",
  "provider": "anthropic",
  "model": "string",
  "auth": "local_login",
  "scope": "local",
  "metering": "subscription",
  "maxConcurrent": 0,
  "status": "untested",
  "defaultOptions": {
    …
  },
  "statusDetail": "string",
  "hasSecret": false,
  …
}
```
