Saltar al contenido principal
POST
/
v1
/
notification
/
usage_alert
Update Usage Alert Config
import requests

url = "https://api.diga.io/v1/notification/usage_alert"

payload = {
    "enabled": True,
    "percent": 50,
    "notification_email": "jsmith@example.com"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "enabled": true,
  "percent": 50,
  "updated_at": "2023-11-07T05:31:56Z"
}

Autorizaciones

Authorization
string
header
requerido

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Cuerpo

application/json
enabled
boolean
requerido

Whether the usage alert is enabled

Ejemplo:

true

percent
integer
requerido

Percentage of included minutes USED at which the alert will fire (1-99)

Rango requerido: 1 <= x <= 99
Ejemplo:

80

notification_email
string<email>
requerido

The email address to send usage alert notifications to

Ejemplo:

"contact@diga.io"

Respuesta

Successful Response

id
string<uuid>
requerido

The unique identifier for the notification

enabled
boolean
requerido

Whether the usage alert is enabled

percent
integer
requerido

Percentage of included minutes USED at which the alert is triggered (1-99)

Rango requerido: 1 <= x <= 99
Ejemplos:

80

75

updated_at
string<date-time>
requerido

The timestamp when the configuration was last updated