---
title: /registerWebhook
slug: mihai-tests/registerwebhook
createdAt: 2024-01-09T12:30:00.567Z
---

{
  "id": "jM4wtCm8aw8VBXrLU3VoP",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "http://1.1.1.1/registerWebhook",
    "servers": [
      {
        "url": "http://1.1.1.1/registerWebhook"
      }
    ],
    "name": "",
    "description": "<p>Registers a new webhook and returns a success/failed status</p>\n<ul>\n<li>return - registration status</li>\n</ul>\n<p>example:</p>\n<p>*registerWebhook(\"<a href=\"http://192.168.1.22:8027%22,0,%7B(%22BTC%22,%221%22)%7D)\" target=\"_blank\">http://192.168.1.22:8027\",0,{(\"BTC\",\"1\")})</a></p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "webhook_url",
          "type": "string",
          "example": "http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot",
          "description": "The webhook URL to be registered",
          "default": "http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot"
        },
        {
          "kind": "required",
          "name": "type",
          "type": "integer",
          "example": 0,
          "description": "<p>the type of webhook:</p>\n<ul>\n<li>0 - input transaction - notifying the user about incoming transactions into our system.</li>\n<li>1 - approve transaction - notifying the user about transactions that wait to his approval.</li>\n<li>2 - output transaction - notifying the user about output transactions states.</li>\n<li>3 - balance alert -      notifying the user about balance changes  related to given threshold.</li>\n</ul>",
          "default": 0
        },
        {
          "kind": "required",
          "name": "filter",
          "type": "object",
          "example": "",
          "description": "a Json containing the filters by which you want to filter the data for the webhook.\n* - For input transaction webhook, the filter must contain the following fields: CoinSymbol, Machine, AccountId\n* and MinAmount, for example:\n* filter: {\n* \"CoinSymbol\": \"BTC\",\n* \"Machine\": \"Hot\",\n* \"AccountIds\": [\"1\"],\n* \"MinAmount\": \"10000\"\n* }\n*  For output transaction webhook, the filter can contain optional fields: CoinSymbols, Machine , AccountIds, AlertEvent\n*  alert event types - \"All confirmations\"/\"First confirmation\"/\"Confirmed\"/\"Sent\"/\"No funds available\"/\"Created\" \n/\"Failed-Limits\"/\"Failed-Technical\"/\"Sent\"/\"No funds available\"/\"Timeout occurred\"\n/\"Waiting to be processed\" /\"Cancelled\"/\"Waiting for external co-signer\"\n/\"Cancelled group changed\"/\"Cancelled account changed\"/\"Replaced\"/\"Confirmed\"\n*  For example:\n* filter: {\n* \"CoinSymbols\": [\"BTC\",\"XRP\"],\n* \"Machine\": \"Hot\",\n* \"AccountIds\": [\"1\"],\n* \"AlertEvent\": [\"All confirmations\"]\n* }\n*\n* - For aleret balance webhook, the filter must contain the following fields: CoinSymbol, Threshold\n*, the filter can contain optional fields: Machine , AccountIds, AlertEvent\n* and MinAmount, for example:\n* filter: {\n* \"CoinSymbol\": \"BTC\",\n* \"Machine\": \"Hot\",\n* \"AccountIds\": [\"1\"],\n* \"Threshold\": Amount in smallest units (satoshi, wei, drops, lovelace..),\n* \"AlertEvent: \"Below\"/ \"Above\"\n* Approve transaction webhook does not require any filters, so you can choose not to send this parameter,\n*   or to send an empty Json \n",
          "default": "{\n  \"AccountIds\": [\"1\"],\n  \"CoinSymbol\": \"BTC\",\n  \"Machine\": \"Hot\",\n  \"MinAmount\": \"10000\"\n}\n",
          "schema": []
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "Request data for setting up a webhook filter.",
          "customType": "registerWebhookRequest",
          "schema": [
            {
              "name": "Filter",
              "kind": "optional",
              "type": "object",
              "description": "Filter criteria for webhook notifications.",
              "example": "",
              "schema": [
                {
                  "name": "AccountIds",
                  "kind": "optional",
                  "type": "array",
                  "description": "An array of account IDs to filter notifications for.",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "1",
                  "itemDefault": "1"
                },
                {
                  "name": "CoinSymbol",
                  "kind": "optional",
                  "type": "string",
                  "description": "The cryptocurrency symbol to filter notifications for.",
                  "example": "BTC",
                  "default": "BTC"
                },
                {
                  "name": "Machine",
                  "kind": "optional",
                  "type": "string",
                  "description": "The machine type (e.g., \"Hot\" or \"Cold\") to filter notifications for.",
                  "example": "Hot",
                  "default": "Hot"
                },
                {
                  "name": "MinAmount",
                  "kind": "optional",
                  "type": "string",
                  "description": "The minimum amount to filter notifications for.",
                  "example": "10000",
                  "default": "10000"
                }
              ]
            },
            {
              "name": "Type",
              "kind": "optional",
              "type": "integer",
              "description": "The type of webhook filter.",
              "example": 0,
              "default": 0
            },
            {
              "name": "WebhookUrl",
              "kind": "optional",
              "type": "string",
              "description": "The URL for the webhook endpoint.",
              "example": "http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot",
              "default": "http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot"
            },
            {
              "name": "Meta",
              "kind": "optional",
              "type": "object",
              "modelRef": "#/components/schemas/MetaTokenregisterWebhook",
              "customType": "MetaTokenregisterWebhook",
              "schema": [
                {
                  "name": "FunctionName",
                  "kind": "optional",
                  "type": "string",
                  "description": "The Function to be called",
                  "example": "registerWebhook",
                  "default": "registerWebhook"
                },
                {
                  "name": "RandomData",
                  "kind": "optional",
                  "type": "string",
                  "description": "Random Data",
                  "example": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229",
                  "default": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229"
                },
                {
                  "name": "Destination",
                  "kind": "optional",
                  "type": "string",
                  "description": "Id of the server",
                  "example": "",
                  "default": "b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea"
                },
                {
                  "name": "Time",
                  "kind": "optional",
                  "type": "string",
                  "description": "UTC Time of execution",
                  "example": "2021-02-07T18:37:46.948Z",
                  "default": "2021-02-07T18:37:46.948Z"
                },
                {
                  "name": "Source",
                  "kind": "optional",
                  "type": "string",
                  "description": "User public key",
                  "example": "",
                  "default": "048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99"
                },
                {
                  "name": "AccessToken",
                  "kind": "optional",
                  "type": "string",
                  "description": "Token used for authentication purposes",
                  "example": "dc677a163ffcb090c243c2e7574db515c2fe8a44e2e979987a0eaefd2646d34b",
                  "default": "dc677a163ffcb090c243c2e7574db515c2fe8a44e2e979987a0eaefd2646d34b"
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/registerWebhookRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "registerWebhookResponse",
            "schema": [
              {
                "name": "FunctionData",
                "kind": "optional",
                "type": "object",
                "example": "",
                "schema": [
                  {
                    "name": "Status",
                    "kind": "optional",
                    "type": "string",
                    "description": "Success/Failed",
                    "example": "Success",
                    "default": "Success"
                  },
                  {
                    "name": "WebhookId",
                    "kind": "optional",
                    "type": "string",
                    "description": "The ID of the created webhook",
                    "example": "978058c5b826badbde4b297a35744fb7",
                    "default": "978058c5b826badbde4b297a35744fb7"
                  }
                ]
              },
              {
                "name": "Meta",
                "kind": "optional",
                "type": "object",
                "modelRef": "#/components/schemas/MetaResponse",
                "customType": "MetaResponse",
                "schema": [
                  {
                    "name": "AccessToken",
                    "kind": "optional",
                    "type": "string",
                    "description": "The new access token generated after this operation",
                    "example": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
                    "default": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6"
                  },
                  {
                    "name": "Destination",
                    "kind": "optional",
                    "type": "string",
                    "description": "Id of the server",
                    "example": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
                    "default": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622"
                  },
                  {
                    "name": "Source",
                    "kind": "optional",
                    "type": "string",
                    "description": "User public key",
                    "example": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
                    "default": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355"
                  },
                  {
                    "name": "Time",
                    "kind": "optional",
                    "type": "string",
                    "description": "UTC Time of execution",
                    "example": "2021-02-14 09:58:52.320",
                    "default": "2021-02-14 09:58:52.320"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/registerWebhookResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'http://1.1.1.1/registerWebhook?webhook_url=http%3A%2F%2F192.168.1.25%3A5000%2Fwebhook%2FBTC%2FMainAccount%2FHot&type=integer&filter=%22{%5Cn%20%20%5C%22AccountIds%5C%22%3A%20[%5C%221%5C%22]%2C%5Cn%20%20%5C%22CoinSymbol%5C%22%3A%20%5C%22BTC%5C%22%2C%5Cn%20%20%5C%22Machine%5C%22%3A%20%5C%22Hot%5C%22%2C%5Cn%20%20%5C%22MinAmount%5C%22%3A%20%5C%2210000%5C%22%5Cn}%5Cn%22' \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"Filter\": {\n     \"CoinSymbol\": \"BTC\",\n     \"Machine\": \"Hot\",\n     \"MinAmount\": \"10000\"\n     },\n     \"WebhookUrl\": \"http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot\",\n     \"Meta\": {\n     \"FunctionName\": \"registerWebhook\",\n     \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n     \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n     \"Time\": \"2021-02-07T18:37:46.948Z\",\n     \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n     \"AccessToken\": \"dc677a163ffcb090c243c2e7574db515c2fe8a44e2e979987a0eaefd2646d34b\"\n     }\n     }'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"Filter\": {\n      \"CoinSymbol\": \"BTC\",\n      \"Machine\": \"Hot\",\n      \"MinAmount\": \"10000\"\n   },\n   \"WebhookUrl\": \"http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot\",\n   \"Meta\": {\n      \"FunctionName\": \"registerWebhook\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"dc677a163ffcb090c243c2e7574db515c2fe8a44e2e979987a0eaefd2646d34b\"\n   }\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"http://1.1.1.1/registerWebhook?webhook_url=http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot&type=integer&filter=\\\"{\\\\n  \\\\\\\"AccountIds\\\\\\\": [\\\\\\\"1\\\\\\\"],\\\\n  \\\\\\\"CoinSymbol\\\\\\\": \\\\\\\"BTC\\\\\\\",\\\\n  \\\\\\\"Machine\\\\\\\": \\\\\\\"Hot\\\\\\\",\\\\n  \\\\\\\"MinAmount\\\\\\\": \\\\\\\"10000\\\\\\\"\\\\n}\\\\n\\\"\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://1.1.1.1/registerWebhook?webhook_url=http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot&type=integer&filter=\\\"{\\n  \\\\\"AccountIds\\\\\": [\\\\\"1\\\\\"],\\n  \\\\\"CoinSymbol\\\\\": \\\\\"BTC\\\\\",\\n  \\\\\"Machine\\\\\": \\\\\"Hot\\\\\",\\n  \\\\\"MinAmount\\\\\": \\\\\"10000\\\\\"\\n}\\n\\\"\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"Filter\": {\n      \"CoinSymbol\": \"BTC\",\n      \"Machine\": \"Hot\",\n      \"MinAmount\": \"10000\"\n   },\n   \"WebhookUrl\": \"http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot\",\n   \"Meta\": {\n      \"FunctionName\": \"registerWebhook\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"dc677a163ffcb090c243c2e7574db515c2fe8a44e2e979987a0eaefd2646d34b\"\n   }\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://1.1.1.1/registerWebhook?webhook_url=http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot&type=integer&filter=\\\"{\\\\n  \\\\\\\"AccountIds\\\\\\\": [\\\\\\\"1\\\\\\\"],\\\\n  \\\\\\\"CoinSymbol\\\\\\\": \\\\\\\"BTC\\\\\\\",\\\\n  \\\\\\\"Machine\\\\\\\": \\\\\\\"Hot\\\\\\\",\\\\n  \\\\\\\"MinAmount\\\\\\\": \\\\\\\"10000\\\\\\\"\\\\n}\\\\n\\\"\"\n\npayload = json.dumps({\n   \"Filter\": {\n      \"CoinSymbol\": \"BTC\",\n      \"Machine\": \"Hot\",\n      \"MinAmount\": \"10000\"\n   },\n   \"WebhookUrl\": \"http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot\",\n   \"Meta\": {\n      \"FunctionName\": \"registerWebhook\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"dc677a163ffcb090c243c2e7574db515c2fe8a44e2e979987a0eaefd2646d34b\"\n   }\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// success\n{\n  \"FunctionData\": {\n    \"Status\": \"Success\",\n    \"WebhookId\": \"978058c5b826badbde4b297a35744fb7\"\n  },\n  \"Meta\": {\n    \"AccessToken\": \"a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6\",\n    \"Destination\": \"042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622\",\n    \"Source\": \"df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355\",\n    \"Time\": \"2021-02-14 09:58:52.320\"\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "MtbCdgPvost8R-7SRJHhZ",
      "type": "paragraph",
      "children": [
        {
          "text": "Registers a new webhook and returns a success/failed status"
        }
      ]
    },
    {
      "id": "c4PpfKCnr4UMDWI_-x1d6",
      "type": "bulleted-list",
      "children": [
        {
          "id": "PX-uXKzwkSK5lUV2C2wx8",
          "type": "list-item",
          "children": [
            {
              "id": "t6eHyhTNajsueLtvNBn5J",
              "type": "list-item-child",
              "children": [
                {
                  "text": "return - registration status"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": "mMjW0bIitK7U3QG4p_N5W",
      "type": "paragraph",
      "children": [
        {
          "text": "example:"
        }
      ]
    },
    {
      "id": "_NY2KSXgc6kBinBE7LdW3",
      "type": "paragraph",
      "children": [
        {
          "text": "*registerWebhook(\""
        },
        {
          "id": "YcfUDYqMIx7QF8uVSpHxP",
          "type": "link",
          "data": {
            "href": "http://192.168.1.22:8027\",0,{(\"BTC\",\"1\")})"
          },
          "children": [
            {
              "text": "http://192.168.1.22:8027\",0,{(\"BTC\",\"1\")})"
            }
          ]
        }
      ]
    }
  ]
}