Webhook only if CI passes


is there any way to send a webhook if and only if all the stages of my CI pipeline passes? I know that the actual webhook can send the status, but I don’t want that, I want that the webhook to be sent only when the pipeline passes all the stages.

In the other side, I would also want the opposite, a webhook that is sent if and only if the CI (any stage) fails.