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.
  [application_server.api]
  # ip:port to bind the api server
  bind="0.0.0.0:8001"

I believe it is negotiated/shared when the network server is added to the application server (https://www.chirpstack.io/application-server/use/network-servers/). 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