Http api for Consul federation with mesh gateway


I am trying to federate multiple consul clusters with mesh gateway.
To register the gateway service I only saw this command
"consul connect envoy -gateway=mesh -register -service “dc1-mesh-gw…”, but not how I can achieve the same through the http api.

Can someone point me to the right api call?