Is there API to create webhooks using scripts?

Hello, I am working on a project that needs automatically add webhooks on the user’s behalf. Is there a way to create webhooks automatically via API?

Here is the user documentation to create webhooks: ◉ User Guide: Webhooks I would like to have a way to create it using API.