Afaik, you can tack the shutdown reason on at the end of the shutdown command and not prompted. Doesn’t that work or is that something you specifically don’t want to/can’t do?
This assumes you use the TrueNAS command: midclt call system.shutdown "reason"
I assume the situation is based on just choosing “shut down” from the console menu. You’re right that an API command could just as well include text for a reason (and in fact would have to include such text, IIRC).
I was referring to the 10 option console menu, where option 10 is shutdown. (I vaguely recall option 9 is reboot… might have similar “reason” issues. Will check before submitting the bug.)