curl --request POST \
--url https://data.gravia.trade/v1/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"filters": {
"wallet_addresses": [
"<string>"
],
"condition_ids": [
"<string>"
],
"position_ids": [
"<string>"
],
"outcomes": [
"<string>"
],
"position_outcome_indices": [
1
],
"event_slugs": [
"<string>"
],
"trade_types": [],
"trigger_mode": "every_trade",
"reset_distance": 0.1,
"min_usd_value": 1,
"min_price": 0.5,
"max_price": 0.5,
"exclude_shortterm_markets": true,
"one_shot": true
},
"description": "<string>",
"secret": "<string>"
}
'import requests
url = "https://data.gravia.trade/v1/webhooks"
payload = {
"url": "<string>",
"filters": {
"wallet_addresses": ["<string>"],
"condition_ids": ["<string>"],
"position_ids": ["<string>"],
"outcomes": ["<string>"],
"position_outcome_indices": [1],
"event_slugs": ["<string>"],
"trade_types": [],
"trigger_mode": "every_trade",
"reset_distance": 0.1,
"min_usd_value": 1,
"min_price": 0.5,
"max_price": 0.5,
"exclude_shortterm_markets": True,
"one_shot": True
},
"description": "<string>",
"secret": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
filters: {
wallet_addresses: ['<string>'],
condition_ids: ['<string>'],
position_ids: ['<string>'],
outcomes: ['<string>'],
position_outcome_indices: [1],
event_slugs: ['<string>'],
trade_types: [],
trigger_mode: 'every_trade',
reset_distance: 0.1,
min_usd_value: 1,
min_price: 0.5,
max_price: 0.5,
exclude_shortterm_markets: true,
one_shot: true
},
description: '<string>',
secret: '<string>'
})
};
fetch('https://data.gravia.trade/v1/webhooks', 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://data.gravia.trade/v1/webhooks",
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([
'url' => '<string>',
'filters' => [
'wallet_addresses' => [
'<string>'
],
'condition_ids' => [
'<string>'
],
'position_ids' => [
'<string>'
],
'outcomes' => [
'<string>'
],
'position_outcome_indices' => [
1
],
'event_slugs' => [
'<string>'
],
'trade_types' => [
],
'trigger_mode' => 'every_trade',
'reset_distance' => 0.1,
'min_usd_value' => 1,
'min_price' => 0.5,
'max_price' => 0.5,
'exclude_shortterm_markets' => true,
'one_shot' => true
],
'description' => '<string>',
'secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://data.gravia.trade/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"filters\": {\n \"wallet_addresses\": [\n \"<string>\"\n ],\n \"condition_ids\": [\n \"<string>\"\n ],\n \"position_ids\": [\n \"<string>\"\n ],\n \"outcomes\": [\n \"<string>\"\n ],\n \"position_outcome_indices\": [\n 1\n ],\n \"event_slugs\": [\n \"<string>\"\n ],\n \"trade_types\": [],\n \"trigger_mode\": \"every_trade\",\n \"reset_distance\": 0.1,\n \"min_usd_value\": 1,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"exclude_shortterm_markets\": true,\n \"one_shot\": true\n },\n \"description\": \"<string>\",\n \"secret\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://data.gravia.trade/v1/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"filters\": {\n \"wallet_addresses\": [\n \"<string>\"\n ],\n \"condition_ids\": [\n \"<string>\"\n ],\n \"position_ids\": [\n \"<string>\"\n ],\n \"outcomes\": [\n \"<string>\"\n ],\n \"position_outcome_indices\": [\n 1\n ],\n \"event_slugs\": [\n \"<string>\"\n ],\n \"trade_types\": [],\n \"trigger_mode\": \"every_trade\",\n \"reset_distance\": 0.1,\n \"min_usd_value\": 1,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"exclude_shortterm_markets\": true,\n \"one_shot\": true\n },\n \"description\": \"<string>\",\n \"secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.gravia.trade/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"filters\": {\n \"wallet_addresses\": [\n \"<string>\"\n ],\n \"condition_ids\": [\n \"<string>\"\n ],\n \"position_ids\": [\n \"<string>\"\n ],\n \"outcomes\": [\n \"<string>\"\n ],\n \"position_outcome_indices\": [\n 1\n ],\n \"event_slugs\": [\n \"<string>\"\n ],\n \"trade_types\": [],\n \"trigger_mode\": \"every_trade\",\n \"reset_distance\": 0.1,\n \"min_usd_value\": 1,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"exclude_shortterm_markets\": true,\n \"one_shot\": true\n },\n \"description\": \"<string>\",\n \"secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"data": {
"id": "b2fa6dc4-3eaf-4b12-bc9d-a7cf79178f23",
"url": "https://receiver.example/trades",
"event": "trader_new_trade",
"status": "active",
"created_at": 1790121600000,
"updated_at": 1790121600000,
"description": null,
"has_secret": true,
"credits_used_24h": 0
},
"info": {
"version": "1.0.0",
"credits_consumed": 0
}
}{
"success": false,
"message": "<string>",
"data": null
}{
"success": false,
"message": "<string>",
"data": null
}{
"success": false,
"message": "<string>",
"data": null
}{
"success": false,
"message": "<string>",
"data": null
}{
"success": false,
"message": "<string>",
"data": null
}Create a webhook
Create an active subscription with a public HTTPS callback URL and a supported event. Supply optional filters, a callback signing secret, and a description. The authenticated API key owns the subscription.
curl --request POST \
--url https://data.gravia.trade/v1/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"filters": {
"wallet_addresses": [
"<string>"
],
"condition_ids": [
"<string>"
],
"position_ids": [
"<string>"
],
"outcomes": [
"<string>"
],
"position_outcome_indices": [
1
],
"event_slugs": [
"<string>"
],
"trade_types": [],
"trigger_mode": "every_trade",
"reset_distance": 0.1,
"min_usd_value": 1,
"min_price": 0.5,
"max_price": 0.5,
"exclude_shortterm_markets": true,
"one_shot": true
},
"description": "<string>",
"secret": "<string>"
}
'import requests
url = "https://data.gravia.trade/v1/webhooks"
payload = {
"url": "<string>",
"filters": {
"wallet_addresses": ["<string>"],
"condition_ids": ["<string>"],
"position_ids": ["<string>"],
"outcomes": ["<string>"],
"position_outcome_indices": [1],
"event_slugs": ["<string>"],
"trade_types": [],
"trigger_mode": "every_trade",
"reset_distance": 0.1,
"min_usd_value": 1,
"min_price": 0.5,
"max_price": 0.5,
"exclude_shortterm_markets": True,
"one_shot": True
},
"description": "<string>",
"secret": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
filters: {
wallet_addresses: ['<string>'],
condition_ids: ['<string>'],
position_ids: ['<string>'],
outcomes: ['<string>'],
position_outcome_indices: [1],
event_slugs: ['<string>'],
trade_types: [],
trigger_mode: 'every_trade',
reset_distance: 0.1,
min_usd_value: 1,
min_price: 0.5,
max_price: 0.5,
exclude_shortterm_markets: true,
one_shot: true
},
description: '<string>',
secret: '<string>'
})
};
fetch('https://data.gravia.trade/v1/webhooks', 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://data.gravia.trade/v1/webhooks",
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([
'url' => '<string>',
'filters' => [
'wallet_addresses' => [
'<string>'
],
'condition_ids' => [
'<string>'
],
'position_ids' => [
'<string>'
],
'outcomes' => [
'<string>'
],
'position_outcome_indices' => [
1
],
'event_slugs' => [
'<string>'
],
'trade_types' => [
],
'trigger_mode' => 'every_trade',
'reset_distance' => 0.1,
'min_usd_value' => 1,
'min_price' => 0.5,
'max_price' => 0.5,
'exclude_shortterm_markets' => true,
'one_shot' => true
],
'description' => '<string>',
'secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://data.gravia.trade/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"filters\": {\n \"wallet_addresses\": [\n \"<string>\"\n ],\n \"condition_ids\": [\n \"<string>\"\n ],\n \"position_ids\": [\n \"<string>\"\n ],\n \"outcomes\": [\n \"<string>\"\n ],\n \"position_outcome_indices\": [\n 1\n ],\n \"event_slugs\": [\n \"<string>\"\n ],\n \"trade_types\": [],\n \"trigger_mode\": \"every_trade\",\n \"reset_distance\": 0.1,\n \"min_usd_value\": 1,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"exclude_shortterm_markets\": true,\n \"one_shot\": true\n },\n \"description\": \"<string>\",\n \"secret\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://data.gravia.trade/v1/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"filters\": {\n \"wallet_addresses\": [\n \"<string>\"\n ],\n \"condition_ids\": [\n \"<string>\"\n ],\n \"position_ids\": [\n \"<string>\"\n ],\n \"outcomes\": [\n \"<string>\"\n ],\n \"position_outcome_indices\": [\n 1\n ],\n \"event_slugs\": [\n \"<string>\"\n ],\n \"trade_types\": [],\n \"trigger_mode\": \"every_trade\",\n \"reset_distance\": 0.1,\n \"min_usd_value\": 1,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"exclude_shortterm_markets\": true,\n \"one_shot\": true\n },\n \"description\": \"<string>\",\n \"secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.gravia.trade/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"filters\": {\n \"wallet_addresses\": [\n \"<string>\"\n ],\n \"condition_ids\": [\n \"<string>\"\n ],\n \"position_ids\": [\n \"<string>\"\n ],\n \"outcomes\": [\n \"<string>\"\n ],\n \"position_outcome_indices\": [\n 1\n ],\n \"event_slugs\": [\n \"<string>\"\n ],\n \"trade_types\": [],\n \"trigger_mode\": \"every_trade\",\n \"reset_distance\": 0.1,\n \"min_usd_value\": 1,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"exclude_shortterm_markets\": true,\n \"one_shot\": true\n },\n \"description\": \"<string>\",\n \"secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"data": {
"id": "b2fa6dc4-3eaf-4b12-bc9d-a7cf79178f23",
"url": "https://receiver.example/trades",
"event": "trader_new_trade",
"status": "active",
"created_at": 1790121600000,
"updated_at": 1790121600000,
"description": null,
"has_secret": true,
"credits_used_24h": 0
},
"info": {
"version": "1.0.0",
"credits_consumed": 0
}
}{
"success": false,
"message": "<string>",
"data": null
}{
"success": false,
"message": "<string>",
"data": null
}{
"success": false,
"message": "<string>",
"data": null
}{
"success": false,
"message": "<string>",
"data": null
}{
"success": false,
"message": "<string>",
"data": null
}Authorizations
Raw database-backed API key.
Body
trader_new_trade, close_to_bond For close_to_bond, min_price is the inclusive high threshold and max_price is the inclusive low threshold. At least one is required; when both are set min_price must exceed max_price (OR zones). Prices 0 and 1 are skipped. trigger_mode defaults to every_trade; crossing fires once per subscription and position until a reset or the opposite threshold. In crossing mode, reset_distance defaults to 0.10 absolute price units; high rearms at or below min_price minus reset_distance, low at or above max_price plus reset_distance. Each reset boundary must be strictly between 0 and 1. The first qualifying trade fires immediately. See the Webhooks overview for examples, ordering, state persistence and expiration behavior. position_ids, outcomes and position_outcome_indices apply only to close_to_bond; wallet_addresses, min_usd_value and trade_types apply only to trader_new_trade. Arrays use OR within a filter and AND between filters.
Show child attributes
Show child attributes