Skip to main content
PATCH
/
v1
/
account
/
{accountSlug}
/
project
/
{projectSlug}
/
alert
/
{alertId}
Update Alert
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
}
'
{
  "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
        }
      }
    ]
  }
}

Authorizations

X-Access-Key
string
header
required

An API key is a token that a client provides when making API calls. The key can be sent as a request header:

curl 'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate' \
  -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
  ...

Learn how to generate API access tokens at Tenderly Docs.

Path Parameters

accountSlug
string
required

Account slug of the user

projectSlug
string
required

Project slug of the account

alertId
string
required

Alert Id to get info for

Body

application/json

Update alert payload

name
string
required

A name of the alert.

Example:

"Failed transaction in Contract XYZ"

simple_type
enum<string>
required

Alert type.

Available options:
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
Example:

"failed_tx"

expressions
expressions · object[]
required

List of conditions that trigger the alert when met

Defines a specific condition to monitor on the blockchain

Example:
[
  {
    "type": "contract_address",
    "expression": {
      "address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c"
    }
  },
  {
    "type": "network",
    "expression": { "network_id": "1" }
  },
  {
    "type": "tx_status",
    "expression": { "transaction_success": false }
  }
]
delivery_channels
delivery_channels · object[]
required

List of notification channels where alerts will be sent

Example:
[
  {
    "enabled": true,
    "id": "b16b4b75-e034-44c9-a053-f10d769a1d64"
  },
  {
    "enabled": true,
    "id": "f48f1f9f-1f74-4849-81cf-fce8bd3746b7"
  }
]
description
string

Alert description.

Example:

"This alert tracks failed transactions on Mainnet"

color
enum<string>

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
Available options:
#eeeeee,
#34ace0,
#ffda79,
#ff5252,
#33d9b2
Example:

"#eeeeee"

enabled
boolean

Whether the alert is currently active and monitoring

Example:

true

Response

A successful response.

An object with details about updated alert.