There is an api end point to delete webbooks one by one.. any end point to delete all in once?
Hi @Sunil Patel
You're correct, deleting webhooks (see here) is not one of the supported bulk operations; you would need to write a script to loop through them all.
Here is a python script to loop through and delete all inactive webhooks. If you want to delete all active webhooks, change the line if j['data'][x]['enabled'] == False: to if j['data'][x]['enabled'] == True:
If you want to delete both inactive and active webhooks, take out that line all together.
Is it well written? Probably not. But it gets the job done.
Note: the 'whArray' will print twice. One will the IDs of all inactive webhooks. The second time should print blank if successful. This will also create a file titled 'SSwebhookdata.json' that contains all the data for the webhooks. Was this necessary? Probably not but it's the only thing I could get to work.
smartsheet_client = smartsheet.Smartsheet('SMARTSHEET TOKEN HERE')
IndexResult = smartsheet_client.Webhooks.list_webhooks(
results = str(IndexResult)
response = json.loads(results)
with open('SSwebhookdata.json', 'w') as f:
with open('SSwebhookdata.json', 'r') as string:
j = my_dict
x = -1
indexArray = 
whArray = 
for each in j['data']:
x += 1
for x in indexArray:
if j['data'][x]['enabled'] == False:
for each in whArray:
©2022. All Rights Reserved Smartsheet Inc.