Automate the adding of webhooks

We’d like to automate some docker hub configuration parameters for Docker Hub and select repos.

I’ve looked at the API and I can’t see a way to script this. Does anyone know of anything?

We could poll the repo, but this is obviously less efficient. If this is the way is there limit to how regularly we should poll?