API referenceF X

Set a rate alert

Watch a pair and notify when it crosses `rate`. 409 when the condition already holds. An alert fires on the rate *crossing* the threshold rather than on it being past it, so one set above a rate that is already higher could not fire until the rate first fell back — storing it would hand somebody a control that looks armed and is not. The error says what the rate is now, which is the thing they were asking about. 409 too when the same threshold is already set on the same pair: that is a double-click rather than a second intention.

POST
/api/b/v1/fx/alerts

Watch a pair and notify when it crosses rate.

409 when the condition already holds. An alert fires on the rate crossing the threshold rather than on it being past it, so one set above a rate that is already higher could not fire until the rate first fell back — storing it would hand somebody a control that looks armed and is not. The error says what the rate is now, which is the thing they were asking about.

409 too when the same threshold is already set on the same pair: that is a double-click rather than a second intention.

Authorization

OAuth2PasswordBearer
AuthorizationBearer <token>

In: header

admin_access_token?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A threshold to watch on one currency pair.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/b/v1/fx/alerts" \  -H "Content-Type: application/json" \  -d '{    "from_currency": "str",    "to_currency": "str",    "direction": "above",    "rate": 1  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "from_currency": "string",  "to_currency": "string",  "direction": "string",  "rate": "string",  "created_at": "2019-08-24T14:15:22Z",  "last_triggered_at": "2019-08-24T14:15:22Z",  "last_triggered_rate": "string"}