Configuring Wifi Settings From Outside the LAN

This may well be a horribly simple question to answer but it’s not amazingly clear from the RouterOS documentation, Github libraries, or StackOverflow posts.

We have a lab set up where we are looking to experiment with a number of Mikrotik devices for a project which does some basic diagnostic work for this conceptual scenario:

  1. There are 50 offices, and each has an access point.
  2. A remote IT engineer needs to be able to log into a custom dashboard from wherever (e.g. home, cafe etc).
  3. Each hub needs to ping an external API every minute to report its status, which appears within the dashboard. Diagnostic data from RouterOS needs to be emitted regularly.
  4. The engineer needs to be able to change the SSID and password for each device individually, or each at once, from within the dashboard. Other settings may be useful, but just these for now.

All the examples (e.g. PHP APIs) seem to document sending requests/queries to the device within the LAN or DMZ. For example, by doing a POST to http://192.168.1.10 or other local IP.

A: How can we set up a 1min “status” ping to an external API with a dump of info from the OS?
B: How can we send REST commands to the device inside the LAN from outside?

Thanks in advance!