Avatar

Using api to delete records does not trigger webhook

Dang Tien Quy

I am using webhook to fire notification, and it work well with other Kintone REST API, except Delete Records api. Webhook only trigger when i use the delete button in records table. Anyone has same problem?

Follow 3 followers
1

4 comments

Avatar
Sean Tachibana 2 votes

Hi Dang,

"Delete records" can be configured in the Webhook settings.
 
Setting Webhook:
 
However, it also states that "Processing records with REST APIs that are used to take actions on multiple records in bulk" in the caution column.
 
When deleting a record using the REST API, even deleting a single record, it requires to use the following API, which corresponds to manipulating multiple records at once.
 
Delete Records:
 
Therefore, even if you are deleting a single record using the REST API, it will not trigger the Webhook notification.
 
I hope this helps.
2
Comment actions Permalink
Avatar
Dang Tien Quy 1 vote

Hi Sean

So there is no way to trigger webhook when delete record by REST API, right?

1
Comment actions Permalink
Avatar
Sean Tachibana 0 votes

Hi Dang, 

 

No, Webhooks notification will not be triggered by the API for bulk deletion of records.

0
Comment actions Permalink
Avatar
William Sayama 1 vote

Sean is correct in stating that the Delete Records API will not cause webhooks to be fired as it's a bulk action.

Is your objective to let your endpoint server know when a record is deleted? (if you could share your scenario, that would be great!)
The only workaround I can think of for now is to call the Update Record API just before the Delete Records API, and update a flag inside the record to tell it that it will be deleted. That should fire a webhook to your endpoint telling it that a record is planned to be deleted.

1
Comment actions Permalink