Unable to register endpoint as event publisher

I am writing one app where I want to publish events to UBX and in another app I want to subscribe to those events. I am trying to register endpoint through API but getting an error. Here is how I am doing. I register custom endpoint in UBX UI and it shows pending status. I took generated auth key for that endpoint. Now through my app I am calling REST API to UBX URL with JSON