# Change an alert hook's name, accounts or defaults

URL: https://docs.fxapis.com/api-reference/alerts/change-an-alert-hooks-name-accounts-or-defaults

> Change an alert hook's name, accounts or defaults. The URL does not change, so nothing needs editing in TradingView.

`PATCH https://api.fxapis.com/v1/alert-hooks/{id}`

The URL does not change, so nothing needs editing in TradingView. `defaults` fields you send replace those fields; the rest stay as they are. `symbolMap`, when sent, replaces the whole map.

Authentication: `Authorization: Bearer <API key>`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes |  |

#### Request body (application/json, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | Example: `"Gold breakout strategy"` |
| `accountIds` | string (uuid)[] | no | Example: `["2b0c7c1e-5d0b-4d8e-9a53-0e6f3b1c9a10"]` |
| `defaults` | object | no |  |
| `defaults.volume` | string | no | Lots, used when an alert does not send `volume`. Example: `"0.10"` |
| `defaults.deviationPoints` | null \| integer | no | Maximum slippage in points. Null leaves it to the terminal. Example: `20` |
| `defaults.symbolMap` | object | no | TradingView symbol (after the exchange prefix is removed) → your broker's symbol. Checked before the suffix. Example: `{"XAUUSD":"XAUUSD.a","US30":"DJ30"}` |
| `defaults.symbolSuffix` | string | no | Appended to symbols the map does not name — for brokers that decorate every symbol, like `EURUSD.a`. Example: `".a"` |
| `defaults.stripExchangePrefix` | boolean | no | Turn `OANDA:XAUUSD` into `XAUUSD`. On by default. |
| `defaults.allowClose` | boolean | no | Whether `close`, `flat` and `close_all` alerts are acted on. On by default. |
| `defaults.onlyTradingViewIps` | boolean | no | Refuse alerts that do not come from TradingView's published webhook addresses. On by default. |

#### Responses

- `200`
- `400`
- `401`
- `402`
- `403`
- `404`

Failures return `{ "error": { "code", "message" } }`; every code is listed at https://docs.fxapis.com/errors.

#### 200 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object | no |  |
| `data.id` | string (uuid) | no |  |
| `data.name` | string | no |  |
| `data.accountIds` | string (uuid)[] | no | One account places an ordinary order; several place a multi-account order. |
| `data.defaults` | object | no |  |
| `data.defaults.volume` | string | no | Lots, used when an alert does not send `volume`. Example: `"0.10"` |
| `data.defaults.deviationPoints` | null \| integer | no | Maximum slippage in points. Null leaves it to the terminal. Example: `20` |
| `data.defaults.symbolMap` | object | no | TradingView symbol (after the exchange prefix is removed) → your broker's symbol. Checked before the suffix. Example: `{"XAUUSD":"XAUUSD.a","US30":"DJ30"}` |
| `data.defaults.symbolSuffix` | string | no | Appended to symbols the map does not name — for brokers that decorate every symbol, like `EURUSD.a`. Example: `".a"` |
| `data.defaults.stripExchangePrefix` | boolean | no | Turn `OANDA:XAUUSD` into `XAUUSD`. On by default. |
| `data.defaults.allowClose` | boolean | no | Whether `close`, `flat` and `close_all` alerts are acted on. On by default. |
| `data.defaults.onlyTradingViewIps` | boolean | no | Refuse alerts that do not come from TradingView's published webhook addresses. On by default. |
| `data.enabled` | boolean | no |  |
| `data.urlHint` | string | no | The URL with its secret elided, for telling hooks apart. The full URL is returned only by create and rotate. Example: `"https://api.fxapis.com/hooks/tradingview/…Qx4w"` |
| `data.lastUsedAt` | null \| string (date-time) | no | When an alert last arrived, to the minute. |
| `data.createdAt` | string (date-time) | no |  |