curl --request PATCH \
--url https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId} \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"name": "Failed transaction in Contract XYZ",
"simple_type": "failed_tx",
"expressions": [
{
"type": "contract_address",
"expression": {
"address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c"
}
},
{
"type": "network",
"expression": {
"network_id": "1"
}
},
{
"type": "tx_status",
"expression": {
"transaction_success": false
}
}
],
"delivery_channels": [
{
"enabled": true,
"id": "b16b4b75-e034-44c9-a053-f10d769a1d64"
},
{
"enabled": true,
"id": "f48f1f9f-1f74-4849-81cf-fce8bd3746b7"
}
],
"description": "This alert tracks failed transactions on Mainnet",
"color": "#eeeeee",
"enabled": true
}
'import requests
url = "https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}"
payload = {
"name": "Failed transaction in Contract XYZ",
"simple_type": "failed_tx",
"expressions": [
{
"type": "contract_address",
"expression": { "address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c" }
},
{
"type": "network",
"expression": { "network_id": "1" }
},
{
"type": "tx_status",
"expression": { "transaction_success": False }
}
],
"delivery_channels": [
{
"enabled": True,
"id": "b16b4b75-e034-44c9-a053-f10d769a1d64"
},
{
"enabled": True,
"id": "f48f1f9f-1f74-4849-81cf-fce8bd3746b7"
}
],
"description": "This alert tracks failed transactions on Mainnet",
"color": "#eeeeee",
"enabled": True
}
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Failed transaction in Contract XYZ',
simple_type: 'failed_tx',
expressions: [
{
type: 'contract_address',
expression: {address: '0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c'}
},
{type: 'network', expression: {network_id: '1'}},
{type: 'tx_status', expression: {transaction_success: false}}
],
delivery_channels: [
{enabled: true, id: 'b16b4b75-e034-44c9-a053-f10d769a1d64'},
{enabled: true, id: 'f48f1f9f-1f74-4849-81cf-fce8bd3746b7'}
],
description: 'This alert tracks failed transactions on Mainnet',
color: '#eeeeee',
enabled: true
})
};
fetch('https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}', 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.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Failed transaction in Contract XYZ',
'simple_type' => 'failed_tx',
'expressions' => [
[
'type' => 'contract_address',
'expression' => [
'address' => '0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c'
]
],
[
'type' => 'network',
'expression' => [
'network_id' => '1'
]
],
[
'type' => 'tx_status',
'expression' => [
'transaction_success' => false
]
]
],
'delivery_channels' => [
[
'enabled' => true,
'id' => 'b16b4b75-e034-44c9-a053-f10d769a1d64'
],
[
'enabled' => true,
'id' => 'f48f1f9f-1f74-4849-81cf-fce8bd3746b7'
]
],
'description' => 'This alert tracks failed transactions on Mainnet',
'color' => '#eeeeee',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Key: <api-key>"
],
]);
$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.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}"
payload := strings.NewReader("{\n \"name\": \"Failed transaction in Contract XYZ\",\n \"simple_type\": \"failed_tx\",\n \"expressions\": [\n {\n \"type\": \"contract_address\",\n \"expression\": {\n \"address\": \"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c\"\n }\n },\n {\n \"type\": \"network\",\n \"expression\": {\n \"network_id\": \"1\"\n }\n },\n {\n \"type\": \"tx_status\",\n \"expression\": {\n \"transaction_success\": false\n }\n }\n ],\n \"delivery_channels\": [\n {\n \"enabled\": true,\n \"id\": \"b16b4b75-e034-44c9-a053-f10d769a1d64\"\n },\n {\n \"enabled\": true,\n \"id\": \"f48f1f9f-1f74-4849-81cf-fce8bd3746b7\"\n }\n ],\n \"description\": \"This alert tracks failed transactions on Mainnet\",\n \"color\": \"#eeeeee\",\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Access-Key", "<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.patch("https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}")
.header("X-Access-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Failed transaction in Contract XYZ\",\n \"simple_type\": \"failed_tx\",\n \"expressions\": [\n {\n \"type\": \"contract_address\",\n \"expression\": {\n \"address\": \"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c\"\n }\n },\n {\n \"type\": \"network\",\n \"expression\": {\n \"network_id\": \"1\"\n }\n },\n {\n \"type\": \"tx_status\",\n \"expression\": {\n \"transaction_success\": false\n }\n }\n ],\n \"delivery_channels\": [\n {\n \"enabled\": true,\n \"id\": \"b16b4b75-e034-44c9-a053-f10d769a1d64\"\n },\n {\n \"enabled\": true,\n \"id\": \"f48f1f9f-1f74-4849-81cf-fce8bd3746b7\"\n }\n ],\n \"description\": \"This alert tracks failed transactions on Mainnet\",\n \"color\": \"#eeeeee\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Access-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Failed transaction in Contract XYZ\",\n \"simple_type\": \"failed_tx\",\n \"expressions\": [\n {\n \"type\": \"contract_address\",\n \"expression\": {\n \"address\": \"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c\"\n }\n },\n {\n \"type\": \"network\",\n \"expression\": {\n \"network_id\": \"1\"\n }\n },\n {\n \"type\": \"tx_status\",\n \"expression\": {\n \"transaction_success\": false\n }\n }\n ],\n \"delivery_channels\": [\n {\n \"enabled\": true,\n \"id\": \"b16b4b75-e034-44c9-a053-f10d769a1d64\"\n },\n {\n \"enabled\": true,\n \"id\": \"f48f1f9f-1f74-4849-81cf-fce8bd3746b7\"\n }\n ],\n \"description\": \"This alert tracks failed transactions on Mainnet\",\n \"color\": \"#eeeeee\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"id": "510b9e97-5d94-430b-9904-1c6db2a473b2",
"project_id": "dfdc391a-a15d-4590-9aef-8691259c7df4",
"name": "Failed transaction in TetherToken",
"description": "",
"enabled": true,
"color": "#ff5252",
"severity": "danger",
"created_at": "2023-12-13T12:30:57.416129Z",
"delivery_channels": [
{
"delivery_channel_id": "b16b4b75-e034-44c9-a053-f10d769a1d64",
"delivery_channel": {
"id": "b16b4b75-e034-44c9-a053-f10d769a1d64",
"type": "email",
"owner_id": "7d5e8b1f-8bf8-4eae-a70f-fb7d354b1cc2",
"project_id": null,
"label": "Email: vanja@tenderly.co",
"reference_id": "vanja@tenderly.co",
"enabled": true,
"created_at": "2022-04-13T14:30:10.920586Z",
"information": {
"email": "vanja@tenderly.co",
"emails": [
"vanja@tenderly.co"
]
}
},
"enabled": true,
"created_at": "2023-12-13T12:31:04.794397Z"
}
],
"is_editable": true,
"updated_at": "2023-12-13T12:31:04.799929504Z",
"expressions": [
{
"type": "contract_address",
"expression": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"transaction_type": null
}
},
{
"type": "network",
"expression": {
"network_id": "1"
}
},
{
"type": "tx_status",
"expression": {
"transaction_success": false
}
}
]
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "bad_request",
"message": "Bad request input parameters"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "insufficient_permissions",
"message": "Insufficient permissions"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "resource_not_found",
"message": "The resource you requested could not be found."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}Update Alert
Update an existing Alert. You need to provide the Alert ID.
curl --request PATCH \
--url https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId} \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"name": "Failed transaction in Contract XYZ",
"simple_type": "failed_tx",
"expressions": [
{
"type": "contract_address",
"expression": {
"address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c"
}
},
{
"type": "network",
"expression": {
"network_id": "1"
}
},
{
"type": "tx_status",
"expression": {
"transaction_success": false
}
}
],
"delivery_channels": [
{
"enabled": true,
"id": "b16b4b75-e034-44c9-a053-f10d769a1d64"
},
{
"enabled": true,
"id": "f48f1f9f-1f74-4849-81cf-fce8bd3746b7"
}
],
"description": "This alert tracks failed transactions on Mainnet",
"color": "#eeeeee",
"enabled": true
}
'import requests
url = "https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}"
payload = {
"name": "Failed transaction in Contract XYZ",
"simple_type": "failed_tx",
"expressions": [
{
"type": "contract_address",
"expression": { "address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c" }
},
{
"type": "network",
"expression": { "network_id": "1" }
},
{
"type": "tx_status",
"expression": { "transaction_success": False }
}
],
"delivery_channels": [
{
"enabled": True,
"id": "b16b4b75-e034-44c9-a053-f10d769a1d64"
},
{
"enabled": True,
"id": "f48f1f9f-1f74-4849-81cf-fce8bd3746b7"
}
],
"description": "This alert tracks failed transactions on Mainnet",
"color": "#eeeeee",
"enabled": True
}
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Failed transaction in Contract XYZ',
simple_type: 'failed_tx',
expressions: [
{
type: 'contract_address',
expression: {address: '0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c'}
},
{type: 'network', expression: {network_id: '1'}},
{type: 'tx_status', expression: {transaction_success: false}}
],
delivery_channels: [
{enabled: true, id: 'b16b4b75-e034-44c9-a053-f10d769a1d64'},
{enabled: true, id: 'f48f1f9f-1f74-4849-81cf-fce8bd3746b7'}
],
description: 'This alert tracks failed transactions on Mainnet',
color: '#eeeeee',
enabled: true
})
};
fetch('https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}', 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.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Failed transaction in Contract XYZ',
'simple_type' => 'failed_tx',
'expressions' => [
[
'type' => 'contract_address',
'expression' => [
'address' => '0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c'
]
],
[
'type' => 'network',
'expression' => [
'network_id' => '1'
]
],
[
'type' => 'tx_status',
'expression' => [
'transaction_success' => false
]
]
],
'delivery_channels' => [
[
'enabled' => true,
'id' => 'b16b4b75-e034-44c9-a053-f10d769a1d64'
],
[
'enabled' => true,
'id' => 'f48f1f9f-1f74-4849-81cf-fce8bd3746b7'
]
],
'description' => 'This alert tracks failed transactions on Mainnet',
'color' => '#eeeeee',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Key: <api-key>"
],
]);
$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.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}"
payload := strings.NewReader("{\n \"name\": \"Failed transaction in Contract XYZ\",\n \"simple_type\": \"failed_tx\",\n \"expressions\": [\n {\n \"type\": \"contract_address\",\n \"expression\": {\n \"address\": \"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c\"\n }\n },\n {\n \"type\": \"network\",\n \"expression\": {\n \"network_id\": \"1\"\n }\n },\n {\n \"type\": \"tx_status\",\n \"expression\": {\n \"transaction_success\": false\n }\n }\n ],\n \"delivery_channels\": [\n {\n \"enabled\": true,\n \"id\": \"b16b4b75-e034-44c9-a053-f10d769a1d64\"\n },\n {\n \"enabled\": true,\n \"id\": \"f48f1f9f-1f74-4849-81cf-fce8bd3746b7\"\n }\n ],\n \"description\": \"This alert tracks failed transactions on Mainnet\",\n \"color\": \"#eeeeee\",\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Access-Key", "<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.patch("https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}")
.header("X-Access-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Failed transaction in Contract XYZ\",\n \"simple_type\": \"failed_tx\",\n \"expressions\": [\n {\n \"type\": \"contract_address\",\n \"expression\": {\n \"address\": \"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c\"\n }\n },\n {\n \"type\": \"network\",\n \"expression\": {\n \"network_id\": \"1\"\n }\n },\n {\n \"type\": \"tx_status\",\n \"expression\": {\n \"transaction_success\": false\n }\n }\n ],\n \"delivery_channels\": [\n {\n \"enabled\": true,\n \"id\": \"b16b4b75-e034-44c9-a053-f10d769a1d64\"\n },\n {\n \"enabled\": true,\n \"id\": \"f48f1f9f-1f74-4849-81cf-fce8bd3746b7\"\n }\n ],\n \"description\": \"This alert tracks failed transactions on Mainnet\",\n \"color\": \"#eeeeee\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert/{alertId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Access-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Failed transaction in Contract XYZ\",\n \"simple_type\": \"failed_tx\",\n \"expressions\": [\n {\n \"type\": \"contract_address\",\n \"expression\": {\n \"address\": \"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c\"\n }\n },\n {\n \"type\": \"network\",\n \"expression\": {\n \"network_id\": \"1\"\n }\n },\n {\n \"type\": \"tx_status\",\n \"expression\": {\n \"transaction_success\": false\n }\n }\n ],\n \"delivery_channels\": [\n {\n \"enabled\": true,\n \"id\": \"b16b4b75-e034-44c9-a053-f10d769a1d64\"\n },\n {\n \"enabled\": true,\n \"id\": \"f48f1f9f-1f74-4849-81cf-fce8bd3746b7\"\n }\n ],\n \"description\": \"This alert tracks failed transactions on Mainnet\",\n \"color\": \"#eeeeee\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"id": "510b9e97-5d94-430b-9904-1c6db2a473b2",
"project_id": "dfdc391a-a15d-4590-9aef-8691259c7df4",
"name": "Failed transaction in TetherToken",
"description": "",
"enabled": true,
"color": "#ff5252",
"severity": "danger",
"created_at": "2023-12-13T12:30:57.416129Z",
"delivery_channels": [
{
"delivery_channel_id": "b16b4b75-e034-44c9-a053-f10d769a1d64",
"delivery_channel": {
"id": "b16b4b75-e034-44c9-a053-f10d769a1d64",
"type": "email",
"owner_id": "7d5e8b1f-8bf8-4eae-a70f-fb7d354b1cc2",
"project_id": null,
"label": "Email: vanja@tenderly.co",
"reference_id": "vanja@tenderly.co",
"enabled": true,
"created_at": "2022-04-13T14:30:10.920586Z",
"information": {
"email": "vanja@tenderly.co",
"emails": [
"vanja@tenderly.co"
]
}
},
"enabled": true,
"created_at": "2023-12-13T12:31:04.794397Z"
}
],
"is_editable": true,
"updated_at": "2023-12-13T12:31:04.799929504Z",
"expressions": [
{
"type": "contract_address",
"expression": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"transaction_type": null
}
},
{
"type": "network",
"expression": {
"network_id": "1"
}
},
{
"type": "tx_status",
"expression": {
"transaction_success": false
}
}
]
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "bad_request",
"message": "Bad request input parameters"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "insufficient_permissions",
"message": "Insufficient permissions"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "resource_not_found",
"message": "The resource you requested could not be found."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}Authorizations
An API key is a token that a client provides when making API calls. Send it as the X-Access-Key request header on any endpoint:
curl '<API_ENDPOINT>' \ -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \ ...
Learn how to generate API access tokens at Tenderly Docs.
Path Parameters
Account slug of the user
Project slug of the account
Alert Id to get info for
Body
Update alert payload
A name of the alert.
"Failed transaction in Contract XYZ"
Alert type.
successful_tx, failed_tx, allowlisted_callers, blocklisted_callers, log_emitted, erc20_transfer_log_emitted, emitted_log_parameter, function_called, called_function_parameter, state_change, eth_balance, tx_value, view_function "failed_tx"
List of conditions that trigger the alert when met
Defines a specific condition to monitor on the blockchain
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
[ { "type": "contract_address", "expression": { "address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c" } }, { "type": "network", "expression": { "network_id": "1" } }, { "type": "tx_status", "expression": { "transaction_success": false } } ]
List of notification channels where alerts will be sent
Show child attributes
Show child attributes
[ { "enabled": true, "id": "b16b4b75-e034-44c9-a053-f10d769a1d64" }, { "enabled": true, "id": "f48f1f9f-1f74-4849-81cf-fce8bd3746b7" } ]
Alert description.
"This alert tracks failed transactions on Mainnet"
Hex color indicating the severity of the alert. It can be one of the following severity types:
- Default: #eeeeee
- Info: #34ace0
- Warning: #ffda79
- Danger: #ff5252
- Success: #33d9b2
#eeeeee, #34ace0, #ffda79, #ff5252, #33d9b2 "#eeeeee"
Whether the alert is currently active and monitoring
true
Response
A successful response.
An object with details about updated alert.
Was this page helpful?