Format raw alert webhook events (deprecated)
curl --request POST \
--url https://api.portalhq.io/api/v3/custodians/me/alerts/format \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "eip155",
"rawAlert": "{\"...\"}"
}
'import requests
url = "https://api.portalhq.io/api/v3/custodians/me/alerts/format"
payload = {
"chain": "eip155",
"rawAlert": "{\"...\"}"
}
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({chain: 'eip155', rawAlert: '{"..."}'})
};
fetch('https://api.portalhq.io/api/v3/custodians/me/alerts/format', 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.portalhq.io/api/v3/custodians/me/alerts/format",
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([
'chain' => 'eip155',
'rawAlert' => '{"..."}'
]),
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.portalhq.io/api/v3/custodians/me/alerts/format"
payload := strings.NewReader("{\n \"chain\": \"eip155\",\n \"rawAlert\": \"{\\\"...\\\"}\"\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.portalhq.io/api/v3/custodians/me/alerts/format")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"eip155\",\n \"rawAlert\": \"{\\\"...\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portalhq.io/api/v3/custodians/me/alerts/format")
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 \"chain\": \"eip155\",\n \"rawAlert\": \"{\\\"...\\\"}\"\n}"
response = http.request(request)
puts response.read_body[
{
"chainName": "sepolia",
"chainId": "eip155:11155111",
"from": "0xf428e1f82f18de15ef2861a4bdde42e755998ece",
"to": "0xdfd8302f44727a6348f702ff7b594f127de3a902",
"amount": "0.001",
"tokenSymbol": "USDC",
"assetType": "NON_NATIVE_TOKEN",
"direction": "OUTBOUND"
}
]{
"error": "<string>"
}{
"error": "<string>"
}Alert Webhooks
Format raw alert webhook events (deprecated)
deprecated
Deprecated. Use the alert webhooks endpoints instead.
Formats a raw webhook request body for wallet events, which may include one or many transactions at once.
POST
/
custodians
/
me
/
alerts
/
format
Format raw alert webhook events (deprecated)
curl --request POST \
--url https://api.portalhq.io/api/v3/custodians/me/alerts/format \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "eip155",
"rawAlert": "{\"...\"}"
}
'import requests
url = "https://api.portalhq.io/api/v3/custodians/me/alerts/format"
payload = {
"chain": "eip155",
"rawAlert": "{\"...\"}"
}
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({chain: 'eip155', rawAlert: '{"..."}'})
};
fetch('https://api.portalhq.io/api/v3/custodians/me/alerts/format', 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.portalhq.io/api/v3/custodians/me/alerts/format",
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([
'chain' => 'eip155',
'rawAlert' => '{"..."}'
]),
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.portalhq.io/api/v3/custodians/me/alerts/format"
payload := strings.NewReader("{\n \"chain\": \"eip155\",\n \"rawAlert\": \"{\\\"...\\\"}\"\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.portalhq.io/api/v3/custodians/me/alerts/format")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"eip155\",\n \"rawAlert\": \"{\\\"...\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portalhq.io/api/v3/custodians/me/alerts/format")
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 \"chain\": \"eip155\",\n \"rawAlert\": \"{\\\"...\\\"}\"\n}"
response = http.request(request)
puts response.read_body[
{
"chainName": "sepolia",
"chainId": "eip155:11155111",
"from": "0xf428e1f82f18de15ef2861a4bdde42e755998ece",
"to": "0xdfd8302f44727a6348f702ff7b594f127de3a902",
"amount": "0.001",
"tokenSymbol": "USDC",
"assetType": "NON_NATIVE_TOKEN",
"direction": "OUTBOUND"
}
]{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Portal API Key (Custodian API Key). Pass as a Bearer token in the Authorization header.
Body
application/json
Was this page helpful?
⌘I