Alerts

About Alerts

Kazoo enables automatic alerting for significant events and situations, ensuring users have instant insight into the status of their accounts. In general, alerts are automatically generated for provisioning errors, financials notifications (low balance, payment token, etc.), system alerts and port actions (port_requests, port_suspended, etc.).

In addition to fetch current alerts of the account, you can manually generate a new alert via API. This offers flexibility in tailoring the alerting system to specific needs or requirements.

Please note that if the config value of enabled under alert system configuration is set to false, alerts are not generated.

Schema

KeyDescriptionTypeDefaultRequiredSupport Level
titleTitle of the alertstring()true
messageAlert descriptionstring()true
categoryCategory of the alert (Ex: port_action_required, port_suspended, low_balance, no_payment_token, expired_payment_token)string()false
metadata.[].nameName of the port requeststring()false
metadata.[].stateStatus of the port requeststring()false
metadata.[].transitionTransition of the port requestarray(object())false
metadata.[].availableAvailable dollars of the accountnumber()false
metadata.[].thresholdLow balance threshold dollarsnumber()false
metadataMetadata of the alertarray(object())false
levelNotification level of the alertstring()infofalse
expiration_dateTimestamp, in Gregorian seconds, of when the alert is expiringinteger()false
from.[].typeType of the originator (‘account’, ‘user’)string()true
from.[].valueID of the originator (AccountID or OwnerID)string()true
fromProperties related to originator of the alertarray(object())true
to.[].typeType of the recipient (‘admins’, ‘user’, ‘resellers’)string()true
to.[].valueID of the recipient (AccountID or ResellerID)string()true
toProperties related to recipient of the alertarray(object())true

Fetch

GET /v2/accounts/{ACCOUNT_ID}/alerts

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/alerts
{
    "auth_token": "{AUTH_TOKEN}",
    "data": [
        {
            "id": "{ALERT_ID}",
            "key": [
                "admins",
                "{ACCOUNT_ID}"
            ],
            "value": {
                "id": "{ALERT_ID}",
                "title": "kazoo telemetry grace period active",
                "message": "kazoo telemetry will automatically enable in 6 days.",
                "category": "kazoo_telemetry",
                "from": [
                    {
                        "type": "account",
                        "value": "{ACCOUNT_ID}"
                    }
                ]
            },
            "clearable": true
        }
    ],
    "request_id": "{REQUEST_ID}",
    "revision": "{REVISION}",
    "status": "success"
}

Create

PUT /v2/accounts/{ACCOUNT_ID}/alerts

curl -v -X PUT \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -d '{
            "data": {
                "title": "Provisioning Error",
                "message": "Error trying to provision device",
                "from": [
                    {
                        "type": "account",
                        "value": "{ACCOUNT_ID}"
                    }
                ],
                "to": [
                    {
                        "type": "admins",
                        "value": "{ACCOUNT_ID}"
                    }
                ]
            }
        }' \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/alerts
{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "title": "Provisioning Error",
        "message": "Error trying to provision device",
        "from": [
            {
                "type": "account",
                "value": "{ACCOUNT_ID}"
            }
        ],
        "to": [
            {
                "type": "admins",
                "value": "{ACCOUNT_ID}"
            }
        ],
        "id": "{ALERT_ID}"
    },
    "request_id": "{REQUEST_ID}",
    "revision": "{REVISION}",
    "status": "success"
}

Fetch

GET /v2/accounts/{ACCOUNT_ID}/alerts/{ALERT_ID}

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/alerts/{ALERT_ID}
{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "title": "kazoo telemetry grace period active",
        "message": "kazoo telemetry will automatically enable in 6 days.",
        "from": [
            {
                "type": "account",
                "value": "{ACCOUNT_ID}"
            }
        ],
        "to": [
            {
                "type": "admins",
                "value": "{ACCOUNT_ID}"
            }
        ],
        "category": "kazoo_telemetry",
        "id": "{ALERT_ID}"
    },
    "request_id": "{REQUEST_ID}",
    "revision": "{REVISION}",
    "status": "success"
}

Remove

Clear/Remove system alerts and manually configured alerts (If clearable value of alert is set to true, you can remove the alert)

DELETE /v2/accounts/{ACCOUNT_ID}/alerts/{ALERT_ID}

curl -v -X DELETE \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/alerts/{ALERT_ID}

On this page