Cannot fathom the API for adding and removing group owners

The best and surest documentation for the API is Reverse engineer the Discourse API

Are you sure that you have a valid API key and that you are passing it correctly? A 404 error is expected if you are not properly authenticated.

Are you able to do any requests that require authorization?