I want to implement a webhook which is triggered while publishing a entry

Is there any way to stop publishing of an entry with weebhooks?
Because I want it to be published only when the status code of the weebhook is 200.
But with 400,404,500 is still published
Thanks!