curl --request POST \
--url https://api.ironflow.sh/v1/alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"telegram_chat": "@my_liquidations",
"url": "https://discord.com/api/webhooks/123/abc",
"name": "BTC and ETH longs",
"markets": [
"BTC",
"ETH-PERP",
"xyz:NVDA"
],
"side": "any",
"min_usd": 100000,
"address": "0xabc0000000000000000000000000000000000001"
}
'import requests
url = "https://api.ironflow.sh/v1/alerts"
payload = {
"telegram_chat": "@my_liquidations",
"url": "https://discord.com/api/webhooks/123/abc",
"name": "BTC and ETH longs",
"markets": ["BTC", "ETH-PERP", "xyz:NVDA"],
"side": "any",
"min_usd": 100000,
"address": "0xabc0000000000000000000000000000000000001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
telegram_chat: '@my_liquidations',
url: 'https://discord.com/api/webhooks/123/abc',
name: 'BTC and ETH longs',
markets: ['BTC', 'ETH-PERP', 'xyz:NVDA'],
side: 'any',
min_usd: 100000,
address: '0xabc0000000000000000000000000000000000001'
})
};
fetch('https://api.ironflow.sh/v1/alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ironflow.sh/v1/alerts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'telegram_chat' => '@my_liquidations',
'url' => 'https://discord.com/api/webhooks/123/abc',
'name' => 'BTC and ETH longs',
'markets' => [
'BTC',
'ETH-PERP',
'xyz:NVDA'
],
'side' => 'any',
'min_usd' => 100000,
'address' => '0xabc0000000000000000000000000000000000001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ironflow.sh/v1/alerts"
payload := strings.NewReader("{\n \"telegram_chat\": \"@my_liquidations\",\n \"url\": \"https://discord.com/api/webhooks/123/abc\",\n \"name\": \"BTC and ETH longs\",\n \"markets\": [\n \"BTC\",\n \"ETH-PERP\",\n \"xyz:NVDA\"\n ],\n \"side\": \"any\",\n \"min_usd\": 100000,\n \"address\": \"0xabc0000000000000000000000000000000000001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ironflow.sh/v1/alerts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"telegram_chat\": \"@my_liquidations\",\n \"url\": \"https://discord.com/api/webhooks/123/abc\",\n \"name\": \"BTC and ETH longs\",\n \"markets\": [\n \"BTC\",\n \"ETH-PERP\",\n \"xyz:NVDA\"\n ],\n \"side\": \"any\",\n \"min_usd\": 100000,\n \"address\": \"0xabc0000000000000000000000000000000000001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ironflow.sh/v1/alerts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"telegram_chat\": \"@my_liquidations\",\n \"url\": \"https://discord.com/api/webhooks/123/abc\",\n \"name\": \"BTC and ETH longs\",\n \"markets\": [\n \"BTC\",\n \"ETH-PERP\",\n \"xyz:NVDA\"\n ],\n \"side\": \"any\",\n \"min_usd\": 100000,\n \"address\": \"0xabc0000000000000000000000000000000000001\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "webhook",
"destination": "discord.com/…",
"markets": [
"BTC-PERP",
"ETH-PERP"
],
"side": "any",
"min_usd": 100000,
"address": "<string>",
"status": "active",
"failures": 123,
"last_error": "destination answered HTTP 404: Unknown Webhook",
"last_sent_at": "2023-11-07T05:31:56Z",
"sent_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"signing_secret": "whsec_3f9a...",
"setup": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"message": "address is required"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"error": {
"code": "TIER_FORBIDDEN",
"message": "Export requires Builder tier or above"
}
}Create a Hyperliquid liquidation alert
POST /v1/alerts posts matching Hyperliquid liquidations to your webhook, Discord channel, Slack channel or Telegram chat within seconds, filtered by market, side, size and wallet.
curl --request POST \
--url https://api.ironflow.sh/v1/alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"telegram_chat": "@my_liquidations",
"url": "https://discord.com/api/webhooks/123/abc",
"name": "BTC and ETH longs",
"markets": [
"BTC",
"ETH-PERP",
"xyz:NVDA"
],
"side": "any",
"min_usd": 100000,
"address": "0xabc0000000000000000000000000000000000001"
}
'import requests
url = "https://api.ironflow.sh/v1/alerts"
payload = {
"telegram_chat": "@my_liquidations",
"url": "https://discord.com/api/webhooks/123/abc",
"name": "BTC and ETH longs",
"markets": ["BTC", "ETH-PERP", "xyz:NVDA"],
"side": "any",
"min_usd": 100000,
"address": "0xabc0000000000000000000000000000000000001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
telegram_chat: '@my_liquidations',
url: 'https://discord.com/api/webhooks/123/abc',
name: 'BTC and ETH longs',
markets: ['BTC', 'ETH-PERP', 'xyz:NVDA'],
side: 'any',
min_usd: 100000,
address: '0xabc0000000000000000000000000000000000001'
})
};
fetch('https://api.ironflow.sh/v1/alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ironflow.sh/v1/alerts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'telegram_chat' => '@my_liquidations',
'url' => 'https://discord.com/api/webhooks/123/abc',
'name' => 'BTC and ETH longs',
'markets' => [
'BTC',
'ETH-PERP',
'xyz:NVDA'
],
'side' => 'any',
'min_usd' => 100000,
'address' => '0xabc0000000000000000000000000000000000001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ironflow.sh/v1/alerts"
payload := strings.NewReader("{\n \"telegram_chat\": \"@my_liquidations\",\n \"url\": \"https://discord.com/api/webhooks/123/abc\",\n \"name\": \"BTC and ETH longs\",\n \"markets\": [\n \"BTC\",\n \"ETH-PERP\",\n \"xyz:NVDA\"\n ],\n \"side\": \"any\",\n \"min_usd\": 100000,\n \"address\": \"0xabc0000000000000000000000000000000000001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ironflow.sh/v1/alerts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"telegram_chat\": \"@my_liquidations\",\n \"url\": \"https://discord.com/api/webhooks/123/abc\",\n \"name\": \"BTC and ETH longs\",\n \"markets\": [\n \"BTC\",\n \"ETH-PERP\",\n \"xyz:NVDA\"\n ],\n \"side\": \"any\",\n \"min_usd\": 100000,\n \"address\": \"0xabc0000000000000000000000000000000000001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ironflow.sh/v1/alerts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"telegram_chat\": \"@my_liquidations\",\n \"url\": \"https://discord.com/api/webhooks/123/abc\",\n \"name\": \"BTC and ETH longs\",\n \"markets\": [\n \"BTC\",\n \"ETH-PERP\",\n \"xyz:NVDA\"\n ],\n \"side\": \"any\",\n \"min_usd\": 100000,\n \"address\": \"0xabc0000000000000000000000000000000000001\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "webhook",
"destination": "discord.com/…",
"markets": [
"BTC-PERP",
"ETH-PERP"
],
"side": "any",
"min_usd": 100000,
"address": "<string>",
"status": "active",
"failures": 123,
"last_error": "destination answered HTTP 404: Unknown Webhook",
"last_sent_at": "2023-11-07T05:31:56Z",
"sent_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"signing_secret": "whsec_3f9a...",
"setup": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"message": "address is required"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"error": {
"code": "TIER_FORBIDDEN",
"message": "Export requires Builder tier or above"
}
}Authorizations
Ironflow API key, format if_xxxx. Free keys at https://ironflow.sh/key. Optional on read endpoints.
Body
A Telegram chat instead of url: a public @channel or group name, or a numeric chat id (groups and channels start with -100). The bot named in setup must be in the chat (in a channel, as an admin that can post).
"@my_liquidations"
Where to post: https://discord.com/api/webhooks/..., https://hooks.slack.com/services/... or any public HTTPS URL (port 443 or 8443). Required unless telegram_chat is set.
"https://discord.com/api/webhooks/123/abc"
Shown in the message title.
80"BTC and ETH longs"
Markets to watch: symbols or Hyperliquid coin names, as a list or a comma-separated string (at most 50). Omit for every market.
["BTC", "ETH-PERP", "xyz:NVDA"]
The liquidated position: long means longs were liquidated.
any, long, short Smallest liquidation to report, in USD.
x >= 0100000
Only this wallet's liquidations.
"0xabc0000000000000000000000000000000000001"
Response
Alert created. signing_secret appears only here, and only for webhooks.
webhook, discord, slack, telegram Host of the URL, without its secret part, or the Telegram chat.
"discord.com/…"
Empty: every market.
["BTC-PERP", "ETH-PERP"]
any, long, short 100000
disabled after 20 failed deliveries in a row; a delivered test re-enables it.
active, disabled Failed deliveries in a row.
"destination answered HTTP 404: Unknown Webhook"
Liquidations delivered so far.
Webhooks only, in the create response only.
"whsec_3f9a..."
Create response only: what to do before the first message arrives (Telegram: which bot to add to the chat).