v2

latestOpenAPI 3.1.0Apache 2.02026-07-31441011.7 MB
Alerts

Create Alert

Create an Alert in a Tenderly project.

Learn more about the different types of Alert triggers.

post/v1/account/{accountSlug}/project/{projectSlug}/alert

Path parameters

accountSlugstring required

Account slug of the user

projectSlugstring required

Project slug of the account

Request body

namestring required

A name of the alert.

descriptionstring

Alert description.

color'#eeeeee' | '#34ace0' | '#ffda79' | '#ff5252' | '#33d9b2'

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
simple_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' required

Alert type.

enabledboolean

Whether the alert is currently active and monitoring

Example request

{
  "name": "Failed transaction in Contract XYZ",
  "description": "This alert tracks failed transactions on Mainnet",
  "color": "#eeeeee",
  "simple_type": "failed_tx",
  "enabled": true,
  "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"
    }
  ]
}

Response

A successful response.

Example response

{
  "alert": {
    "id": "d5d5c416-99df-4655-b45c-1e8652f619fa",
    "project_id": "dfdc391a-a15d-4590-9aef-8691259c7df4",
    "name": "Successful transaction in My new contract name",
    "description": "This alert tracks successful transactions on Mainnet",
    "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,
    "delivery_channels": [
      {
        "delivery_channel_id": "b16b4b75-e034-44c9-a053-f10d769a1d64",
        "enabled": true,
        "created_at": "2023-12-13T00:42:34.324117958Z"
      }
    ],
    "expressions": [
      {
        "expression": {
          "line_number": 123
        }
      }
    ]
  }
}