Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console

Create a price alert

Pan-African Market Data & Intelligence

POST

/price-alerts

Create a price alert

Production onlycreatePriceAlert

Registers a price alert. When the latest delayed price observation crosses the threshold while the exchange is open, a price.alert webhook fires and the event is streamed on GET /stream. threshold is in the instrument's LOCAL trading currency — the same basis as a quote's price. Alerts are evaluated on the same ~15-minute polling cycle as quotes, so an alert fires on the first poll after the crossing, not at the instant of the tick. Do not use a price alert as an execution trigger — place a resting LIMIT or STOP order instead. Maximum 200 active alerts per partner. Requires a full key (pk_live_).

Parameters

This endpoint has no path or query parameters.

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Idempotency-KeystringheaderRequired

Unique string that makes write calls safe to retry on network failure. Required for money movement, trading, KYC, subscriptions, and webhook creation. Deduplicated for 24 hours -- duplicate keys return the cached response. HTTP 409 if a concurrent request with the same key is still in progress.

Example: dep_user42_1743152580

Request body

symbolstringRequired

Example: "SCOM.KE"

exchangestringRequired

Example: "NSE"

conditionabove | belowRequired
thresholdnumberRequired

Positive, in the instrument's local trading currency.

Example: 20

repeatboolean

When false (default) the alert fires once and disarms. When true it re-arms, but only after the price crosses back through the threshold, so a price hovering at the threshold cannot spam your endpoint.

clientAlertIdstring

Your own reference, echoed back on the alert and in the webhook payload.

Response fields

alertIdstring

Example: "alr_abc123"

clientAlertIdstring

Your own reference, supplied at creation.

symbolstring

Example: "SCOM.KE"

exchangestring

Example: "NSE"

conditionabove | below
thresholdnumber

In the instrument's local trading currency.

Example: 20

currencystring

The local trading currency the threshold is denominated in.

Example: "KES"

repeatboolean
stateARMED | TRIGGERED | DISARMED

ARMED — waiting for the threshold to be crossed. TRIGGERED — a repeat alert that has fired and is waiting for the price to cross back before re-arming. DISARMED — a one-shot alert that has fired and is spent.

lastPriceLocalnumber
triggerCountinteger
createdAtstring
lastTriggeredAtstring

Response codes

201Alert created and armed.
400Invalid body, unknown symbol, or the active-alert cap was reached.