> ## Documentation Index
> Fetch the complete documentation index at: https://api.scalysis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit a tool

> Change any field of an API tool.

Send only the fields you want to change. Everything else stays the same. `PATCH` works the same way.

> [!WARNING]
>
> Changes apply to every agent using this tool, starting with the next call. You don't need to republish the agent.

## Path

**id** `number` *required*

Tool ID.

## Body

Any field from [Create a tool](https://api.scalysis.com/api-reference/tools/create.md). Rules for lists:

* `headers`, `parameters` and `presetParameters` replace the whole list. Send every item you want to keep.
* To keep a secret header without resending it, send its value as `••••••••`.
* Send `bodyTemplate: null` to go back to the default body.

```bash Change timeout theme={null}
curl -X PUT https://app.scalysis.com/api/v1/tools/512 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "timeoutMs": 15000 }'
```

```bash Keep secret, add header theme={null}
curl -X PUT https://app.scalysis.com/api/v1/tools/512 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "headers": [
      { "key": "X-Api-Key", "value": "••••••••", "secret": true },
      { "key": "Accept", "value": "application/json" }
    ]
  }'
```

```json 200 theme={null}
{
  "success": true,
  "action": "update_tool",
  "tool": {
    "id": 512,
    "name": "Check stock",
    "timeoutMs": 15000
  }
}
```

The response has the full tool. Shortened in the example.

## Errors

| Status | `error_code` | Meaning |
| - | - | - |
| `400` | `INVALID_REQUEST` | A field is wrong. Nothing changed. |
| `404` | `TOOL_NOT_FOUND` | No API tool with this ID on your account. |
| `503` | `SERVICE_UNAVAILABLE` | Try again. [Get the tool](https://api.scalysis.com/api-reference/tools/get.md) to check whether it changed. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.