curl 'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/alert' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
-H 'content-type: application/json' \
--data-raw '{"name":"Successful transaction in My new contract name","color":"#33d9b2","description":"","simple_type":"successful_tx","enabled":true,"expressions":[{"type":"contract_address","expression":{"address":"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c"}},{"type":"network","expression":{"network_id":"1"}},{"type":"tx_status","expression":{"transaction_success":true}}],"delivery_channels":[{"enabled":true,"id":"b16b4b75-e034-44c9-a053-f10d769a1d64"},{"enabled":true,"id":"f48f1f9f-1f74-4849-81cf-fce8bd3746b7"}]}' \
--compressedconst options = {
method: 'POST',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Successful transaction in My new contract name',
simple_type: 'successful_tx',
expressions: [
{
type: 'contract_address',
expression: {address: '0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c'}
},
{type: 'network', expression: {network_id: '1'}},
{type: 'tx_status', expression: {transaction_success: true}}
],
delivery_channels: [
{enabled: true, id: 'b16b4b75-e034-44c9-a053-f10d769a1d64'},
{enabled: true, id: 'f48f1f9f-1f74-4849-81cf-fce8bd3746b7'}
]
})
};
fetch('https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert"
payload = {
"name": "Successful transaction in My new contract name",
"simple_type": "successful_tx",
"expressions": [
{
"type": "contract_address",
"expression": { "address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c" }
},
{
"type": "network",
"expression": { "network_id": "1" }
},
{
"type": "tx_status",
"expression": { "transaction_success": True }
}
],
"delivery_channels": [
{
"enabled": True,
"id": "b16b4b75-e034-44c9-a053-f10d769a1d64"
},
{
"enabled": True,
"id": "f48f1f9f-1f74-4849-81cf-fce8bd3746b7"
}
]
}
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert"
payload := strings.NewReader("{\n \"name\": \"Successful transaction in My new contract name\",\n \"simple_type\": \"successful_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\": true\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}")
req, _ := http.NewRequest("POST", 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))
}{
"alert": {
"id": "d5d5c416-99df-4655-b45c-1e8652f619fa",
"project_id": "dfdc391a-a15d-4590-9aef-8691259c7df4",
"name": "Successful transaction in My new contract name",
"enabled": true,
"color": "#eeeeee",
"severity": "default",
"created_at": "2023-12-13T00:42:34.259670388Z",
"updated_at": "2023-12-13T00:42:34.259670468Z",
"is_editable": true,
"expressions": [
{
"line_number": 123,
"call_position": "first",
"type": "method_call",
"expression": {
"line_number": 123,
"call_position": "first"
}
}
],
"description": "This alert tracks successful transactions on Mainnet",
"delivery_channels": [
{
"delivery_channel_id": "b16b4b75-e034-44c9-a053-f10d769a1d64",
"enabled": true,
"created_at": "2023-12-13T00:42:34.324117958Z"
}
]
}
}{
"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": "9a7bbe06-7f6f-4a45-8c78-8d64b9a9d0e1",
"slug": "too_many_requests",
"message": "API Rate limit exceeded."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}Create Alert
Create an Alert in a Tenderly project.
Learn more about the different types of Alert triggers.
curl 'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/alert' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
-H 'content-type: application/json' \
--data-raw '{"name":"Successful transaction in My new contract name","color":"#33d9b2","description":"","simple_type":"successful_tx","enabled":true,"expressions":[{"type":"contract_address","expression":{"address":"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c"}},{"type":"network","expression":{"network_id":"1"}},{"type":"tx_status","expression":{"transaction_success":true}}],"delivery_channels":[{"enabled":true,"id":"b16b4b75-e034-44c9-a053-f10d769a1d64"},{"enabled":true,"id":"f48f1f9f-1f74-4849-81cf-fce8bd3746b7"}]}' \
--compressedconst options = {
method: 'POST',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Successful transaction in My new contract name',
simple_type: 'successful_tx',
expressions: [
{
type: 'contract_address',
expression: {address: '0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c'}
},
{type: 'network', expression: {network_id: '1'}},
{type: 'tx_status', expression: {transaction_success: true}}
],
delivery_channels: [
{enabled: true, id: 'b16b4b75-e034-44c9-a053-f10d769a1d64'},
{enabled: true, id: 'f48f1f9f-1f74-4849-81cf-fce8bd3746b7'}
]
})
};
fetch('https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert"
payload = {
"name": "Successful transaction in My new contract name",
"simple_type": "successful_tx",
"expressions": [
{
"type": "contract_address",
"expression": { "address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c" }
},
{
"type": "network",
"expression": { "network_id": "1" }
},
{
"type": "tx_status",
"expression": { "transaction_success": True }
}
],
"delivery_channels": [
{
"enabled": True,
"id": "b16b4b75-e034-44c9-a053-f10d769a1d64"
},
{
"enabled": True,
"id": "f48f1f9f-1f74-4849-81cf-fce8bd3746b7"
}
]
}
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/alert"
payload := strings.NewReader("{\n \"name\": \"Successful transaction in My new contract name\",\n \"simple_type\": \"successful_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\": true\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}")
req, _ := http.NewRequest("POST", 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))
}{
"alert": {
"id": "d5d5c416-99df-4655-b45c-1e8652f619fa",
"project_id": "dfdc391a-a15d-4590-9aef-8691259c7df4",
"name": "Successful transaction in My new contract name",
"enabled": true,
"color": "#eeeeee",
"severity": "default",
"created_at": "2023-12-13T00:42:34.259670388Z",
"updated_at": "2023-12-13T00:42:34.259670468Z",
"is_editable": true,
"expressions": [
{
"line_number": 123,
"call_position": "first",
"type": "method_call",
"expression": {
"line_number": 123,
"call_position": "first"
}
}
],
"description": "This alert tracks successful transactions on Mainnet",
"delivery_channels": [
{
"delivery_channel_id": "b16b4b75-e034-44c9-a053-f10d769a1d64",
"enabled": true,
"created_at": "2023-12-13T00:42:34.324117958Z"
}
]
}
}{
"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": "9a7bbe06-7f6f-4a45-8c78-8d64b9a9d0e1",
"slug": "too_many_requests",
"message": "API Rate limit exceeded."
}
}{
"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
Body
Create 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.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
Extended alert information returned by the API
Alert object containing all details of the created alert
Show child attributes
Show child attributes