# Rename a node, cap its agents or stop it accepting tasks.

> https://koi.dog/docs/api/nodes/update-node/

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

No query parameters.

## Path parameters.

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

## Body.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | no | The machine's name. At least 1 character. |
| `maxAgents` | `0–32` | no | Agents this machine runs at once. 0 takes none. |
| `acceptsTasks` | `boolean` | no | Off: no new agent is started on it. |

## Response.

200 OK: a `Node`. 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/nodes/$ID" \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "maxAgents": 2
    }'
```

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

```python
import os

import requests

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

## Response example.

```json
{
  "id": "string",
  "kind": "mac",
  "name": "string",
  "state": "pending",
  "maxAgents": 0,
  "acceptsTasks": false,
  "workspaceRoot": "string",
  "pairedAt": "string",
  …
}
```
