---
title: "Create or modify alert"
method: POST
path: "/iserver/account/{accountId}/alert"
tags: ["Alert"]
---

# Create or modify alert

`POST /iserver/account/{accountId}/alert`

Please note here, DO NOT pass orderId when creating a new alert, toolId is only required for MTA alert

## Path parameters

- `accountId` string, required

## Request body

- AlertRequest
  - `orderId` integer — orderId is required when modifying alert. You can get it from /iserver/account/:accountId/alerts
  - `alertName` string — name of alert
  - `alertMessage` string — The message you want to receive via email or text message
  - `alertRepeatable` integer — whether alert is repeatable or not, so value can only be 0 or 1, this has to be 1 for MTA alert
  - `email` string — email address to receive alert
  - `sendMessage` integer — whether allowing to send email or not, so value can only be 0 or 1,
  - `tif` string — time in force, can only be GTC or GTD
  - `expireTime` string — format, YYYYMMDD-HH:mm:ss, please NOTE this will only work when tif is GTD
  - `outsideRth` integer — value can only be 0 or 1, set to 1 if the alert can be triggered outside regular trading hours.
  - `iTWSOrdersOnly` integer — value can only be 0 or 1, set to 1 to enable the alert only in IBKR mobile
  - `showPopup` integer — value can only be 0 or 1, set to 1 to allow to show alert in pop-ups
  - `toolId` integer — for MTA alert only, each user has a unique toolId and it will stay the same, do not send for normal alert
  - `playAudio` string — audio message to play when alert is triggered
  - `conditions` object[]
    - `type` integer — Types: 1-Price, 3-Time, 4-Margin, 5-Trade, 6-Volume, 7: MTA market 8: MTA Position, 9: MTA Acc. Daily PN&
    - `conidex` string — conid and exchange. Format supports conid or conid@exchange
    - `operator` string — optional, operator for the current condition, can be >= or <=
    - `triggerMethod` string — optional, only some type of conditions have triggerMethod
    - `value` string — can not be empty, can pass default value "*"
    - `logicBind` string — "a" means "AND", "o" means "OR", "n" means "END", the last one condition in the condition array should "n"
    - `timeZone` string — only needed for some MTA alert condition

## Response `200`

returns an object

- object
  - `request_id` integer
  - `order_id` integer
  - `success` boolean
  - `text` string
  - `order_status` string
  - `warning_message` string

---

[API](https://skmtc.dev/ibkr/apis/client-portal-web-api.md) · [All operations](https://skmtc.dev/ibkr/apis/client-portal-web-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ibkr/apis/client-portal-web-api/revisions/32edbfe496d1?raw)
