Skip to main content
POST
/
rpc
/
Indexer
/
UpdateWebhookListener
UpdateWebhookListener
curl --request POST \
  --url https://amoy-indexer.sequence.app/rpc/Indexer/UpdateWebhookListener \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filters": {
    "accounts": [
      "0xe6eB28398CCBe46aA505b62b96822c2Ce8DAABf4"
    ],
    "contractAddresses": [
      "0x9bec34c1f7098e278afd48fedcf13355b854364a"
    ],
    "tokenIDs": [
      "100"
    ],
    "events": [
      "Transfer(address indexed from, address indexed to, uint256 indexed tokenId)"
    ]
  },
  "projectId": 31396,
  "url": "https://webhook.site/#!/view/a2859143-0a52-4b69-98f2-a58733e4dcf0"
}
'
import requests

url = "https://amoy-indexer.sequence.app/rpc/Indexer/UpdateWebhookListener"

payload = {
    "filters": {
        "accounts": ["0xe6eB28398CCBe46aA505b62b96822c2Ce8DAABf4"],
        "contractAddresses": ["0x9bec34c1f7098e278afd48fedcf13355b854364a"],
        "tokenIDs": ["100"],
        "events": ["Transfer(address indexed from, address indexed to, uint256 indexed tokenId)"]
    },
    "projectId": 31396,
    "url": "https://webhook.site/#!/view/a2859143-0a52-4b69-98f2-a58733e4dcf0"
}
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({
    filters: {
      accounts: ['0xe6eB28398CCBe46aA505b62b96822c2Ce8DAABf4'],
      contractAddresses: ['0x9bec34c1f7098e278afd48fedcf13355b854364a'],
      tokenIDs: ['100'],
      events: ['Transfer(address indexed from, address indexed to, uint256 indexed tokenId)']
    },
    projectId: 31396,
    url: 'https://webhook.site/#!/view/a2859143-0a52-4b69-98f2-a58733e4dcf0'
  })
};

fetch('https://amoy-indexer.sequence.app/rpc/Indexer/UpdateWebhookListener', 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://amoy-indexer.sequence.app/rpc/Indexer/UpdateWebhookListener",
  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([
    'filters' => [
        'accounts' => [
                '0xe6eB28398CCBe46aA505b62b96822c2Ce8DAABf4'
        ],
        'contractAddresses' => [
                '0x9bec34c1f7098e278afd48fedcf13355b854364a'
        ],
        'tokenIDs' => [
                '100'
        ],
        'events' => [
                'Transfer(address indexed from, address indexed to, uint256 indexed tokenId)'
        ]
    ],
    'projectId' => 31396,
    'url' => 'https://webhook.site/#!/view/a2859143-0a52-4b69-98f2-a58733e4dcf0'
  ]),
  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://amoy-indexer.sequence.app/rpc/Indexer/UpdateWebhookListener"

	payload := strings.NewReader("{\n  \"filters\": {\n    \"accounts\": [\n      \"0xe6eB28398CCBe46aA505b62b96822c2Ce8DAABf4\"\n    ],\n    \"contractAddresses\": [\n      \"0x9bec34c1f7098e278afd48fedcf13355b854364a\"\n    ],\n    \"tokenIDs\": [\n      \"100\"\n    ],\n    \"events\": [\n      \"Transfer(address indexed from, address indexed to, uint256 indexed tokenId)\"\n    ]\n  },\n  \"projectId\": 31396,\n  \"url\": \"https://webhook.site/#!/view/a2859143-0a52-4b69-98f2-a58733e4dcf0\"\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://amoy-indexer.sequence.app/rpc/Indexer/UpdateWebhookListener")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"filters\": {\n    \"accounts\": [\n      \"0xe6eB28398CCBe46aA505b62b96822c2Ce8DAABf4\"\n    ],\n    \"contractAddresses\": [\n      \"0x9bec34c1f7098e278afd48fedcf13355b854364a\"\n    ],\n    \"tokenIDs\": [\n      \"100\"\n    ],\n    \"events\": [\n      \"Transfer(address indexed from, address indexed to, uint256 indexed tokenId)\"\n    ]\n  },\n  \"projectId\": 31396,\n  \"url\": \"https://webhook.site/#!/view/a2859143-0a52-4b69-98f2-a58733e4dcf0\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://amoy-indexer.sequence.app/rpc/Indexer/UpdateWebhookListener")

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  \"filters\": {\n    \"accounts\": [\n      \"0xe6eB28398CCBe46aA505b62b96822c2Ce8DAABf4\"\n    ],\n    \"contractAddresses\": [\n      \"0x9bec34c1f7098e278afd48fedcf13355b854364a\"\n    ],\n    \"tokenIDs\": [\n      \"100\"\n    ],\n    \"events\": [\n      \"Transfer(address indexed from, address indexed to, uint256 indexed tokenId)\"\n    ]\n  },\n  \"projectId\": 31396,\n  \"url\": \"https://webhook.site/#!/view/a2859143-0a52-4b69-98f2-a58733e4dcf0\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": true,
  "listener": {
    "id": 2435835685,
    "projectID": 31396,
    "url": "https://webhook.site/#!/view/a2859143-0a52-4b69-98f2-a58733e4dcf0",
    "filters": {
      "events": [
        "Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"
      ],
      "contractAddresses": [
        "0x9bec34c1f7098e278afd48fedcf13355b854364a"
      ],
      "accounts": [
        "0xe6eb28398ccbe46aa505b62b96822c2ce8daabf4"
      ],
      "tokenIDs": [
        "100"
      ]
    },
    "name": "webhook.site #b5cf2f",
    "updatedAt": "2024-10-10T20:52:58.924369913Z",
    "active": true
  }
}
{
  "error": "WebrpcEndpoint",
  "code": 0,
  "msg": "endpoint error",
  "status": 400,
  "cause": "<string>"
}
{
  "error": "WebrpcBadResponse",
  "code": -5,
  "msg": "bad response",
  "status": 500,
  "cause": "<string>"
}

Authorizations

Authorization
string
header
required

Secret JWT token for authenticating requests obtained from Sequence Builder - should not be exposed publicly.

Body

application/json
listener
object
projectId
number

Response

OK

status
boolean