---
title: "modify conditional order"
method: PUT
path: "/alerts/orders/{alertId}"
tags: ["Conditional and Multi Order"]
---

# modify conditional order

`PUT /alerts/orders/{alertId}`

Modify an existing alert order by updating its conditional trigger logic and/or the associated order execution parameters.

## Path parameters

- `alertId` string, required

## Headers

- `access-token` string, required

## Request body

- AlertModifyRequest
  - `dhanClientId` string, required — User specific identification generated by Dhan
  - `alertId` string, required — Unique ID generated by Dhan For eg. "12345"
  - `condition` AlertCondition, required — Alert condition details
    - `comparisonType` 'TECHNICAL_WITH_VALUE' | 'TECHNICAL_WITH_INDICATOR' | 'TECHNICAL_WITH_CLOSE' | 'PRICE_WITH_VALUE' — Type of comparison
    - `exchangeSegment` 'NSE_EQ' | 'BSE_EQ' | 'IDX_I' — The exchange where the condition is checked
    - `securityId` string, required — Condition security
    - `indicatorName` 'SMA_5' | 'SMA_10' | 'SMA_20' | 'SMA_50' | 'SMA_100' | 'SMA_200' | 'EMA_5' | 'EMA_10' | 'EMA_20' | 'EMA_50' | 'EMA_100' | 'EMA_200' | 'BB_UPPER' | 'BB_LOWER' | 'RSI_14' | 'ATR_14' | 'STOCHASTIC' | 'STOCHRSI_14' | 'MACD_26' | 'MACD_12' | 'MACD_HIST' — Name of the indicator
    - `timeFrame` 'DAY' | 'ONE_MIN' | 'FIVE_MIN' | 'FIFTEEN_MIN' — Time frame for technical indicators
    - `operator` 'CROSSING_UP' | 'CROSSING_DOWN' | 'CROSSING_ANY_SIDE' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_EQUAL' | 'LESS_THAN_EQUAL' | 'EQUAL' | 'NOT_EQUAL' — Comparison operator
    - `comparingValue` number, float — Target value for comparison
    - `comparingIndicatorName` 'SMA_5' | 'SMA_10' | 'SMA_20' | 'SMA_50' | 'SMA_100' | 'SMA_200' | 'EMA_5' | 'EMA_10' | 'EMA_20' | 'EMA_50' | 'EMA_100' | 'EMA_200' | 'BB_UPPER' | 'BB_LOWER' | 'RSI_14' | 'ATR_14' | 'STOCHASTIC' | 'STOCHRSI_14' | 'MACD_26' | 'MACD_12' | 'MACD_HIST' — The technical indicator to compare against when using TechnicalWithIndicator conditions. This represents the right-hand side (RHS) indicator in a technical comparison For e.g. SMA_20 crossing above SMA_50
    - `expDate` string, date — Expiry date of alert
    - `frequency` 'ONCE' — Evaluation frequency
    - `userNote` string — User-provided note For eg. Price crossing SMA
  - `orders` AlertOrder[] — List of orders to execute when alert is triggered
    - `transactionType` 'BUY' | 'SELL', required — Type of transaction
    - `exchangeSegment` 'NSE_EQ' | 'NSE_FNO' | 'NSE_COMM' | 'BSE_EQ' | 'BSE_FNO' | 'MCX_COMM', required — The exchange where the transaction takes place
    - `productType` 'CNC' | 'INTRADAY' | 'MARGIN' | 'MTF' | 'CO' | 'BO', required — Product type
    - `orderType` 'LIMIT' | 'MARKET' | 'STOP_LOSS' | 'STOP_LOSS_MARKET', required — Type of order
    - `securityId` string, required — Unique identifier for the security
    - `quantity` integer, required — Quantity of securities to trade
    - `validity` 'DAY' | 'IOC', required — Order validity
    - `price` string — Price per unit For eg. "250.5"
    - `discQuantity` string — Disclosed quantity For eg. "100"
    - `triggerPrice` string — Trigger price for stop-loss or trigger orders For eg. "2500.0"

## Response `200`

Successful operation

- AlertOrderResponse
  - `alertId` string — Alert ID generated by Dhan
  - `alertStatus` string — | **Status** | **Description** | |--------------|-----------------------------------| | ACTIVE | Alert is currently active | | TRIGGERED | Alert condition has been met | | EXPIRED | Alert expired without triggering | | CANCELLED | Alert was manually cancelled |

---

[API](https://skmtc.dev/dhan/apis/dhanhq-api.md) · [All operations](https://skmtc.dev/dhan/apis/dhanhq-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dhan/dhanhq-api/revisions/2d368b9ed32d/schema)
