Webhooks

Get notified on incoming transactions.

You can subscribe your Snapy addresses or external ones to Snapy webhooks. Providing a URL and an address you'll receive a callback on every transaction sent to the addresses subscribed.

post
Subscribe Address

https://beta.snapy.io/api/v1/webhooks/address
Subscribes an address to be tracked by Snapy.
Request
Response
Headers
x-api-key
required
string
The API key you can find in your dashboard. Example: pub_5cc7743fd5f7fd24b2e9336e-61defadc-0e7e-4786-a011–0b9d900e263b
Body Parameters
address
required
string
The address you want to subscribe.
url
required
string
The URL where you want to receive the callbacks. Example: https://someurl.com/callbacks/snapy
Example Request
optional
object
{ "address": "xrb_3ks3wj7ru48d4wt....", "url": "https://blah.com/asasa" }
200: OK
{
"id": "5d9363b33550b12ab69fdaf2",
"status": "success"
}

get
Callback History

https://beta.snapy.io/api/v1/webhooks
Returns the history of callbacks sent about any of the addresses you have subscribed. They are sorted by age, starting from the newest. It can be paginated, with up to 100 results per page. Each webhook returns its status, address, attempts, and the response obtained.
Request
Response
Headers
x-api-key
required
string
The API key you can find in your dashboard. Example: pub_5cc7743fd5f7fd24b2e9336e-61defadc-0e7e-4786-a011–0b9d900e263b
Query Parameters
page
optional
integer
The page number to be returned.
200: OK
{
"count": 40,
"page": 1,
"history": [
{
"status": "success",
"address": "xrb_3phzgtchxsckzdubifreck7dpd9wwqz6b7w6ie4bnwp91k9shz5jboybxu86",
"attempts": 1,
"url": "https://webhook.site/7b0982cd-2594-4fb6-909d-c44768be8da5",
"response": "\"\"",
"responseCode": "200",
"responseHeaders": "{\"server\":\"nginx/1.10.3\",\"content-type\":\"text/plain; charset=UTF-8\",\"transfer-encoding\":\"chunked\",\"connection\":\"close\",\"vary\":\"Accept-Encoding\",\"x-request-id\":\"09afdd6a-eaed-4a8f-a287-7cb40cda423b\",\"x-token-id\":\"7b0982cd-2594-4fb6-909d-c44768be8da5\",\"cache-control\":\"no-cache, private\",\"date\":\"Tue, 04 Jun 2019 16:34:42 GMT\",\"x-ratelimit-limit\":\"30\",\"x-ratelimit-remaining\":\"27\"}",
"data": "{\"hash\":\"FD0427402742D48D6A8B80A5C03D4996D61D5CDD9B8E25B5E7705A1E36EF647F\",\"address\":\"xrb_3phzgtchxsckzdubifreck7dpd9wwqz6b7w6ie4bnwp91k9shz5jboybxu86\",\"confirmationNo\":1,\"sender\":\"xrb_3p8s7yy4w9pi7fynabkjp66xky49wxkjf7ez5bzdsz7oiy4on8p1c689u5g5\",\"amount\":1}",
"createdAt": "2019-06-04T16:34:42.662Z",
"lastAttempt": "2019-06-04T16:34:42.835Z"
},
{
"status": "failed",
"address": "xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6",
"attempts": 20,
"url": "https://wololoso.io/favesese",
"data": "{\"hash\":\"EB28B3FA03133218084C958368246E7975CFA0A9B81202BD682DFDB4EF074E33\",\"address\":\"xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6\",\"confirmationNo\":1,\"sender\":\"xrb_3p8s7yy4w9pi7fynabkjp66xky49wxkjf7ez5bzdsz7oiy4on8p1c689u5g5\",\"amount\":1}",
"createdAt": "2019-06-04T16:34:36.343Z",
"lastAttempt": "2019-06-04T16:53:36.636Z"
},
{
"status": "success",
"address": "xrb_1wzakro4cxnjxrqx818cfc764u7o9pw9pkpshkymr4tfamaniou59ce1xpp8",
"attempts": 1,
"url": "https://webhook.site/7b0982cd-2594-4fb6-909d-c44768be8da5",
"response": "\"\"",
"responseCode": "200",
"responseHeaders": "{\"server\":\"nginx/1.10.3\",\"content-type\":\"text/plain; charset=UTF-8\",\"transfer-encoding\":\"chunked\",\"connection\":\"close\",\"vary\":\"Accept-Encoding\",\"x-request-id\":\"668540e4-7761-4dd2-b4b8-7968f73121a4\",\"x-token-id\":\"7b0982cd-2594-4fb6-909d-c44768be8da5\",\"cache-control\":\"no-cache, private\",\"date\":\"Tue, 04 Jun 2019 16:33:55 GMT\",\"x-ratelimit-limit\":\"30\",\"x-ratelimit-remaining\":\"28\"}",
"data": "{\"hash\":\"5B4144BB2042525A9507A2E0EED5F609CE12FE409BBF0BFFB78A493B9DE2D197\",\"address\":\"xrb_1wzakro4cxnjxrqx818cfc764u7o9pw9pkpshkymr4tfamaniou59ce1xpp8\",\"confirmationNo\":2,\"sender\":\"xrb_3p8s7yy4w9pi7fynabkjp66xky49wxkjf7ez5bzdsz7oiy4on8p1c689u5g5\",\"amount\":3}",
"createdAt": "2019-06-04T16:33:55.646Z",
"lastAttempt": "2019-06-04T16:33:55.895Z"
},
{
"status": "success",
"address": "xrb_1wzakro4cxnjxrqx818cfc764u7o9pw9pkpshkymr4tfamaniou59ce1xpp8",
"attempts": 1,
"url": "https://webhook.site/7b0982cd-2594-4fb6-909d-c44768be8da5",
"response": "\"\"",
"responseCode": "200",
"responseHeaders": "{\"server\":\"nginx/1.10.3\",\"content-type\":\"text/plain; charset=UTF-8\",\"transfer-encoding\":\"chunked\",\"connection\":\"close\",\"vary\":\"Accept-Encoding\",\"x-request-id\":\"1c3fb8d1-ec26-49b2-ab56-f58bf32699d4\",\"x-token-id\":\"7b0982cd-2594-4fb6-909d-c44768be8da5\",\"cache-control\":\"no-cache, private\",\"date\":\"Tue, 04 Jun 2019 16:33:55 GMT\",\"x-ratelimit-limit\":\"30\",\"x-ratelimit-remaining\":\"29\"}",
"data": "{\"hash\":\"5B4144BB2042525A9507A2E0EED5F609CE12FE409BBF0BFFB78A493B9DE2D197\",\"address\":\"xrb_1wzakro4cxnjxrqx818cfc764u7o9pw9pkpshkymr4tfamaniou59ce1xpp8\",\"confirmationNo\":1,\"sender\":\"xrb_3p8s7yy4w9pi7fynabkjp66xky49wxkjf7ez5bzdsz7oiy4on8p1c689u5g5\",\"amount\":3}",
"createdAt": "2019-06-04T16:33:55.636Z",
"lastAttempt": "2019-06-04T16:33:55.861Z"
},
...
],
"status": "success"
}

get
Address Callback History

https://beta.snapy.io/api/v1/webhooks/{address}
Same as the previous one, but filtered by address.
Request
Response
Path Parameters
address
required
string
Address from which to retrieve the webhook callback history.
Headers
x-api-key
required
string
The API key you can find in your dashboard, Example: pub_5cc7743fd5f7fd24b2e9336e-61defadc-0e7e-4786-a011–0b9d900e263b
Query Parameters
page
optional
integer
The page number to be returned.
200: OK
{
"count": 15,
"page": 1,
"address": "xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6",
"history": [
{
"status": "failed",
"address": "xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6",
"attempts": 20,
"url": "https://wololoso.io/favesese",
"data": "{\"hash\":\"EB28B3FA03133218084C958368246E7975CFA0A9B81202BD682DFDB4EF074E33\",\"address\":\"xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6\",\"confirmationNo\":1,\"sender\":\"xrb_3p8s7yy4w9pi7fynabkjp66xky49wxkjf7ez5bzdsz7oiy4on8p1c689u5g5\",\"amount\":1}",
"createdAt": "2019-06-04T16:34:36.343Z",
"lastAttempt": "2019-06-04T16:53:36.636Z"
},
....
],
"status": "success"
}

get
Subscriptions

https://beta.snapy.io/api/v1/webhooks/subscriptions
Returns a list of your subscribed addresses and their callback URLs. You can have up to 3 different URLs per each address.
Request
Response
Headers
x-api-key
required
string
The API key you can find in your dashboard, Example: pub_5cc7743fd5f7fd24b2e9336e-61defadc-0e7e-4786-a011–0b9d900e263b
200: OK
{
"count": 7,
"addressCount": 5,
"subscriptions": {
"xrb_17ckeubwg439znd4d968kryofza6a1njmyksoryode3x1mzinre6euqrc5s5": [
{
"id": "5ceeb21d889e4d6bbee2e0df",
"url": "https://webhook.site/7b0982cd-2594-4fb6-909d-c44768be8da5",
"address": "xrb_17ckeubwg439znd4d968kryofza6a1njmyksoryode3x1mzinre6euqrc5s5",
"active": true,
"confirmations": 1,
"everyConf": false
}
],
"xrb_3phzgtchxsckzdubifreck7dpd9wwqz6b7w6ie4bnwp91k9shz5jboybxu86": [
{
"id": "5ceecd62a3f8c47c96227bc2",
"url": "https://webhook.site/7b0982cd-2594-4fb6-909d-c44768be8da5",
"address": "xrb_3phzgtchxsckzdubifreck7dpd9wwqz6b7w6ie4bnwp91k9shz5jboybxu86",
"active": true,
"confirmations": 1,
"everyConf": false
}
],
"xrb_1wzakro4cxnjxrqx818cfc764u7o9pw9pkpshkymr4tfamaniou59ce1xpp8": [
{
"id": "5ceecd68a3f8c47c96227bc3",
"url": "https://webhook.site/7b0982cd-2594-4fb6-909d-c44768be8da5",
"address": "xrb_1wzakro4cxnjxrqx818cfc764u7o9pw9pkpshkymr4tfamaniou59ce1xpp8",
"active": true,
"confirmations": 1,
"everyConf": false
}
],
"xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6": [
{
"id": "5cf03cb6f56cc1202ea8160f",
"url": "https://wololoso.io",
"address": "xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6",
"active": false,
"confirmations": 1,
"everyConf": false
},
{
"id": "5cf5ac8a03f94bfecdf15544",
"url": "https://wololoso.io/favesese",
"address": "xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6",
"active": true,
"confirmations": 1,
"everyConf": false
},
{
"id": "5cf5ad015a9e9eff806ae03f",
"url": "https://wololoso.io/favesesdse",
"address": "xrb_3k8x6xtga5tti8cx463cbfsob8hoznau95k78wwkzz8z68rgktd8g4mprzk6",
"active": false,
"confirmations": 1,
"everyConf": false
}
],
"xrb_15198pqmtsy6tf5a4nycwb6mnutepzaozdm4kqg4j4nx39twzty6s9mue6gj": [
{
"id": "5cf7d3bbdb4de02705b46e07",
"url": "https://wololoso.io/favesesdse",
"address": "xrb_15198pqmtsy6tf5a4nycwb6mnutepzaozdm4kqg4j4nx39twzty6s9mue6gj",
"active": true,
"confirmations": 1,
"everyConf": false
}
]
},
"status": "success"
}

delete
Delete subscription

https://beta.snapy.io/api/v1/webhooks/subscriptions/{subscriptionId}
Deletes the specified subscription.
Request
Response
Path Parameters
subscriptionId
required
string
The identifier of the subscription to be deleted.
Headers
x-api-key
required
string
The API key you can find in your dashboard, Example: pub_5cc7743fd5f7fd24b2e9336e-61defadc-0e7e-4786-a011–0b9d900e263b
200: OK
{
"status": "success"
}

patch
Activate/Deactivate

https://beta.snapy.io/api/v1/webhooks/subscriptions/{subscriptionId}
Activates or deactivates a subscription. They may deactivate automatically if the callback fails to be received too many times. You can also deactivate them for any reason you might have.
Request
Response
Path Parameters
subscriptionId
required
string
The identifier of the subscription to be deleted.
Headers
x-api-key
required
string
The API key you can find in your dashboard, Example: pub_5cc7743fd5f7fd24b2e9336e-61defadc-0e7e-4786-a011–0b9d900e263b
Body Parameters
active
required
boolean
Activate or deactivate.
Example Request
optional
object
{ "active": "true|false" }
200: OK
{
"status": "success"
}