Delete a Report

Last updated on 24 February, 2021

With LogicMonitor’s REST API you can programmatically delete your LogicMonitor reports.

As with all of our API calls, authentication is required.

HTTP Method:DELETE

URI: /report/reports/{id}

Example Request 1: Delete a report

The following Python script will delete the report with an id of 33:

#!/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 = '/report/reports/33'

#Construct URL 
url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath 

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

#Concatenate Request details
requestVars = httpVerb + epoch + resourcePath

print requestVars

#Construct signature
hmac1 = hmac.new(AccessKey.encode(),msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest()
signature = base64.b64encode(hmac1.encode())

#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

Example Response

The following is an example response for Example Request 1 above:

Response Status: 200
Response Body: {
  "status" : 200,
  "errmsg" : "OK",
  "data" : null
}