Delete a Widget

Last updated on 18 November, 2020


You can use LogicMonitor’s REST API to programmatically delete widgets from your LogicMonitor dashboards. As with all of our API calls, authentication is required.


URI: /dashboard/widgets/{id}


#!/bin/env python

import requests
import json
import hashlib
import base64
import time
import hmac

#Account Info
AccessId ='YQQ75w6Mxx9zWIeAMq5H'
AccessKey ='f)!Z}%spR=6en+4^s2$t32r-3=NpdQ]2T{-deI)8'
Company = 'api'

#Request Info
httpVerb ='DELETE'
resourcePath = '/dashboard/widgets/174'

#Construct URL 
url = 'https://'+ Company +'' + resourcePath

#Get current time in milliseconds
epoch = str(int(time.time() * 1000))

#Concatenate Request details
requestVars = httpVerb + epoch + resourcePath

#Construct signature
hmac1 =,msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest()

#Construct headers
auth = 'LMv1 ' + AccessId + ':' + signature.decode() + ':' + epoch
headers = {'Content-Type':'application/json','Authorization':auth}

#Make request
response = requests.delete(url, headers=headers)

#Print status and body of response
print('Response Status:',response.status_code)
print('Response Body:',response.content)
Python 3
In This Article