Create a price/condition-based alert on a symbol. A plain notification-only condition — GTT orders use the dedicated Place GTT Order endpoint instead.
API Endpoint
Method
POST
URL
https://api.shoonya.com/NorenWClientAPI/SetAlert
Content-Type
application/x-www-form-urlencoded
Payload
jData=<JSON payload>&jKey=<AccessToken> — requires a valid AccessToken from Login.
Overview
Set Alert registers a condition evaluated against the live LTP feed. Use Get Enabled GTT Orders to see which ai_t values your account supports before setting one. For an order that should fire automatically on trigger, use Place GTT Order instead — that's a separate endpoint, not this one with a different validity.
Success/failure indication. On success this is a status message rather than a plain Ok flag — check for al_id being present as the reliable success signal.
Present only on failure — e.g. Invalid Input, Session Expired.
Best Practices
Store the returned al_id immediately — there's no idempotency key on this call, so a network timeout leaves you unable to tell whether the alert was created without listing your alerts and matching on tsym + remarks.
Validate ai_t against Get Enabled GTT Orders before calling this, rather than discovering an unsupported type from emsg.
Use a distinct, greppable remarks value per alert so you can reconcile alerts against your own system after the fact, the same way Place Order recommends for orders.
API Endpoint
POSThttps://api.shoonya.com/NorenWClientAPI/SetAlertapplication/x-www-form-urlencodedjData=<JSON payload>&jKey=<AccessToken>— requires a validAccessTokenfrom Login.Overview
Set Alert registers a condition evaluated against the live LTP feed. Use Get Enabled GTT Orders to see which
ai_tvalues your account supports before setting one. For an order that should fire automatically on trigger, use Place GTT Order instead — that's a separate endpoint, not this one with a differentvalidity.Parameters
DAY,GTTRequest Examples
Response
Okflag — check foral_idbeing present as the reliable success signal.Best Practices
al_idimmediately — there's no idempotency key on this call, so a network timeout leaves you unable to tell whether the alert was created without listing your alerts and matching ontsym+remarks.ai_tagainst Get Enabled GTT Orders before calling this, rather than discovering an unsupported type fromemsg.remarksvalue per alert so you can reconcile alerts against your own system after the fact, the same way Place Order recommends for orders.