Skip to content

Create Price Alert

Creates a new price alert for the current user.

POST

https://{some_domain}/price_alert

Authorization

All requests must include a JWT token:

Authorization: <JWT_TOKEN>

This endpoint is available only for a client user session. The server takes login from the JWT session.

Request

Content-Type: application/json

Body Parameters

Field Type Required Description
symbol string Yes Alert symbol
indicator_name string No Display name / source label
message string No Custom message shown on trigger
side int Yes Price source: 0=Bid, 1=Ask
condition int Yes Trigger type
target_price double No Required only for level/crossing conditions
channel_low double No Lower bound for channel conditions
channel_high double No Upper bound for channel conditions
move_threshold double No Threshold for moving conditions
repeat_mode int Yes 0=once, 1=repeat
expires_at int64 No Expiration timestamp, 0 = no expiration
reference_price double No Reference price for moving conditions
reference_time int64 No Reference price timestamp
comment string No Internal comment

Supported condition values

Value Meaning
0 Crossing Up
1 Crossing Down
2 Greater Than
3 Less Than
4 Entering Channel
5 Exiting Channel
6 Inside Channel
7 Outside Channel
8 Moving Up
9 Moving Down
10 Moving Up %
11 Moving Down %
12 Crossing Either

Field requirements by condition

  • Level/crossing conditions 0, 1, 2, 3, 12 require target_price > 0
  • Channel conditions 4, 5, 6, 7 require channel_low < channel_high
  • Moving conditions 8, 9, 10, 11 require move_threshold > 0

Response

Success (200)

{
  "structure": ["id"],
  "rows": [
    [101]
  ]
}

Error Responses

Code Error Description
400 INVALID_DATA Validation failed
400 INVALID_LOGIN Session login is missing or invalid
400 INVALID_TARGET_PRICE Missing or invalid target_price for level/crossing condition
400 INVALID_CHANNEL Invalid channel bounds
400 INVALID_MOVE_THRESHOLD Invalid movement threshold
400 INVALID_EXPIRES_AT Expiration is in the past
400 SYMBOL_NOT_FOUND Symbol does not exist
401 PERMISSION_DENIED Access denied

Example

{
  "symbol": "EURUSD",
  "indicator_name": "Price Alert",
  "message": "EUR breakout",
  "side": 0,
  "condition": 12,
  "target_price": 1.1000,
  "channel_low": 0,
  "channel_high": 0,
  "move_threshold": 0,
  "repeat_mode": 0,
  "expires_at": 0,
  "reference_price": 1.0950,
  "reference_time": 1775400000,
  "comment": "My alert"
}