Change AT to API and back to AT without XCTU

2 Xbee S2C units, local and remote. The local is connected to a microprocessor (No PC) - These have to be transparent mode most of the time. Occasionally, I need to change the pins on the remote device. Can I put the local Xbee in API mode (can’t use XTCU), change the pins on the remote Xbee, then put the local back in API mode? This needs to be done by sending commands from the microprocessor through the UART interface to the local Xbee.

I assume I need AT commands that will change the local to API mode and API commands that change it back to transparent mode. I have tried +++ ATAP=1, ATWR, ATCN - didn’t work.