curl -X POST 'https://api.serialized.xyz/v1/webhook/price/tpsl/add' \
-H 'Authorization: YOUR_API_KEY' -H 'Content-Type: application/json' \
-d '{"triggers":[{"id":"order-8814","chain":"evm:8453","address":"0x4ed4e862860bed51a9570b96d89af5e1b0efefed","priceUsd":{"eq":"0.0042"}},{"id":"order-8812","chain":"solana","address":"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263","priceUsd":{"gte":"0.000023"}}]}'
{
"data": {
"id": "tpsl",
"armed": [{ "index": 0, "id": "order-8814", "direction": "gte" }],
"alreadyIn": [{ "index": 1, "id": "order-8812", "status": "active" }],
"rejected": []
}
}
Price Webhooks
Add Price Triggers
Arm up to 1,000 triggers on a price webhook, on up to 100 distinct tokens, idempotent. Free.
POST
/
v1
/
webhook
/
price
/
{id}
/
add
curl -X POST 'https://api.serialized.xyz/v1/webhook/price/tpsl/add' \
-H 'Authorization: YOUR_API_KEY' -H 'Content-Type: application/json' \
-d '{"triggers":[{"id":"order-8814","chain":"evm:8453","address":"0x4ed4e862860bed51a9570b96d89af5e1b0efefed","priceUsd":{"eq":"0.0042"}},{"id":"order-8812","chain":"solana","address":"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263","priceUsd":{"gte":"0.000023"}}]}'
{
"data": {
"id": "tpsl",
"armed": [{ "index": 0, "id": "order-8814", "direction": "gte" }],
"alreadyIn": [{ "index": 1, "id": "order-8812", "status": "active" }],
"rejected": []
}
}
POST /v1/webhook/price/{id}/add · Free
Arms up to 1,000 triggers on a price webhook, on up to 100 distinct tokens per call. Idempotent: a trigger already there with the same id, token and condition comes back in alreadyIn with its status, whatever it is; the same id with another condition comes back in rejected (details.reason: "idTaken": an id stays taken for 30 days after its trigger ends). A trigger you removed is not armed again: it comes back in alreadyIn with status: "removed", so check status, and arm it again under a new id. A condition already true fires at once. The response never carries the token’s price.
rejected gives each trigger that was not armed, with its index and error: a malformed field (INVALID_PARAM or INVALID_CHAIN, details.param names it), a token not covered (details.reason nativeCoin, wrappedNative or stablecoin), an unknown token (NOT_FOUND), an eq on a token with no price yet in the level’s unit (details.reason: "noPrice"), an id used twice in the call (duplicateId), a trigger with both priceUsd and priceNative (INVALID_PARAM: set one). The others are armed. Free; your account must be able to pay for the triggers it arms (1 credit per trigger sent to your URL).
curl -X POST 'https://api.serialized.xyz/v1/webhook/price/tpsl/add' \
-H 'Authorization: YOUR_API_KEY' -H 'Content-Type: application/json' \
-d '{"triggers":[{"id":"order-8814","chain":"evm:8453","address":"0x4ed4e862860bed51a9570b96d89af5e1b0efefed","priceUsd":{"eq":"0.0042"}},{"id":"order-8812","chain":"solana","address":"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263","priceUsd":{"gte":"0.000023"}}]}'
{
"data": {
"id": "tpsl",
"armed": [{ "index": 0, "id": "order-8814", "direction": "gte" }],
"alreadyIn": [{ "index": 1, "id": "order-8812", "status": "active" }],
"rejected": []
}
}
Authorizations
Your raw API key (not needed on the demo server).
Path Parameters
The price webhook id: yours, or the wh_… id we generated.
Body
application/json
1 to 1,000 triggers per call, on up to 100 distinct tokens: { "id"?, "name"?, "chain", "address", "priceUsd": { "gt" | "gte" | "lt" | "lte" | "eq": "<level>" } }, the level in USD, or the same with priceNative, the level in the native coin of the chain (one of the two; a decimal string of at most 32 characters, or a JSON number). An invalid trigger comes back in rejected with its index; the others are armed.
Response
200
Standard { data, meta } envelope.