How does network server determine API port?

In the Application Server you can configure the bind API server port - default is 8001. How does the network server know this port, as I don’t see anything in the configuration for the network server?

  # Settings for the "internal api"
  # This is the API used by ChirpStack Network Server to communicate with ChirpStack Application Server
  # and should not be exposed to the end-user.
  # ip:port to bind the api server

I believe it is negotiated/shared when the network server is added to the application server ( I seem to recall needing to delete and re-add the NS when changing that value, but I could be misremembering.

That would make sense that it’s communicated upon creation in the application server