Delete Monitor

Last modified on May 22, 2024

To delete a monitor, send a DELETE request to /devices/{id}, where {id} is the monitor ID.


Request URL



This operation requires authentication. The authenticating user’s role must allow the user to delete monitors.

Request Body


Response Body

Successful response contains status 0:

  "metadata": {
    "login": "[email protected]",
    "session": "ef770427109e343e",
    "status": "0",
    "message": "No errors."

Error response contains a non-zero status:

  "metadata": {
    "login": "[email protected]",
    "session": "ef770427109e343e",
    "status": "65",
    "message": "Invalid device.",

Code Examples


These commands delete monitor 1234 using different authentication types.

Using the session ID:

curl -X DELETE ""

Using the Authorization header with a bearer token:

curl -X DELETE -H "Authorization: Bearer BEARER_TOKEN"


This code deletes monitor with ID 1234.


import requests # Requests library –
import json
import base64

baseUrl = ''
login = '[email protected]' # Replace with your AlertSite login email
password = 'pa55w0rd' # Replace with your AlertSite password
monitorId = 1234 # ID of the monitor to delete

# Log in
payload = {'login': login, 'password': password}
r = + '/login', data=json.dumps(payload), headers={'Content-Type': 'application/json'})
session = r.json()['metadata']['session']

# Generate the bearer token to authenticate subsequent requests
# For Python 2.4-2.x:
# token = base64.b64encode(login + ':' + session)
# For Python 3.x:
token = base64.b64encode((login + ':' + session).encode('ascii')).decode('ascii')
# Delete the monitor
r = requests.delete(baseUrl + '/devices/' + str(monitorId), headers={'Authorization': 'Bearer ' + token})
result = r.json()['metadata']
if int(result['status']) == 0:
    print('Monitor {} has been deleted.'.format(monitorId))
    print('Error {status}: {message}'.format(**result))

See Also

AlertSite JSON API
Add Monitor
Get Monitors

Highlight search results