Creating consumers in Konnect from a plugin

I created a custom plugin to authenticate my users who provide Basic auth with the existing authentication service in my company. Now I want to be able to create a consumer in Kong for the authenticated users.
My alternative is to have a synchronization process from the existing authentication service to kong to have the users updated every time there is a change.
Because Kong is not the one who holds the user database, it is easier to handle adding/removing users on-demand depending on the response from my authentication server from the custom plugin.
Any suggestion here.
I already have a working prototype that uses the event infrastructure to call the kong konnect consumer api to create a new consumer, and I provision the Kong API key through a vault to make it secure. I still don’t know how to identify my control plane id automatically, but for now it is in the plugin config.
Any idea is welcomed.
Thank you very much.