---
title: "Create Or Modify Alert"
method: POST
path: "/iserver/account/{accountId}/alert"
tags: ["tradingAlerts"]
---

# Create Or Modify Alert

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

Endpoint used to create a new alert, or modify an existing alert.

## Path parameters

- `accountId` string, required

## Request body

- AlertCreationRequest
  - `orderId` integer — optional; used in case of modification and represent Alert Id
  - `alertName` string, required — Alert name.
  - `alertMessage` string, required — Alert message which will be sent
  - `alertRepeatable` '0' | '1', required — Boolean number (0, 1) signifies if an alert can be triggered more than once. A value of '1' is required for MTA alerts
  - `email` string — Email address you want to send email alerts to
  - `expireTime` string — Used with a tif of "GTD" only. Signifies time when the alert should terminate if no alert is triggered.
  - `iTWSOrdersOnly` integer — allow (0) or disallow (1) alerts to trigger alerts through the mobile app
  - `outsideRth` '0' | '1', required — Allow (1) or disallow (0) the alert to be triggered outside of regular trading hours
  - `sendMessage` '0' | '1' — allow (1) or disallow (0) alerts to trigger email messages
  - `showPopup` integer — allow (1) or disallow (0) alerts to trigger TWS Pop-up messages
  - `tif` 'GTC' | 'GTD', required — Time in Force duration of alert.
  - `conditions` AlertCreationRequestConditionsItems[], required — Container for all conditions applied for an alert to trigger.
    - `conidex` string, required — Concatenation of conid and exchange. Formatted as "conid@exchange"
    - `logicBind` 'a' | 'o' | 'n', required — Describes how multiple conditions should behave together. Available logic types: * `a` - AND * `o` - OR * `n` - END
    - `operator` '>=' | '<=' | '>' | '<' | '==', required — Indicates whether the trigger should be above or below the given value.
    - `timeZone` string — Only needed for some MTA alert condition.
    - `triggerMethod` string, required — Pass the string representation of zero, "0"
    - `type` '1' | '3' | '4' | '5' | '6' | '7' | '8' | '9', required — Designate what condition type to use. Note the "MTA" types listed are only supported if iTWSOrdersOnly=1 Available condition types: * `1` - Price * `3` - Time * `4` - Margin * `5` - Trade * `6` - Volume * `7` - MTA Market * `8` - MTA Postion * `9` - MTA Account Daily PnL
    - `value` string, required — Trigger value based on Type.

## Response `200`

An object containing valid accounts and the account properties regarding trading access. This endpoint is also used to confirm account validation.

- AlertCreationResponse
  - `request_id` integer — Not applicable
  - `order_id` integer — The tracking number of the alert. Alert identifier internally referenced as order id.
  - `success` boolean — Displays result status of alert request
  - `text` string — Response message to clarify submission status.
  - `order_status` string — Not applicable
  - `warning_message` string — Returns 'null'

## Other responses

- `400` — bad request; body is empty
- `401` — Missing, invalid, or unparseable Authorization token.
- `500` — Internal Server Error. Unable to process request if incoming values are not valid. For example operator is "abc" Or if modification request contains unmodified fields
- `503` — service is unavailable. For example if request takes more than 10s due to some internal service unavailability, request aborted and this status returned

---

[API](https://skmtc.net/interactivebrokers/apis/api-reference.md) · [All operations](https://skmtc.net/interactivebrokers/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/interactivebrokers/api-reference/revisions/67f9f562c2c6/schema)
