As I understand it is not possible to change the group of states as in the status menu with the api - all the states must be changed by hand. But these status menu states must be stored somewhere (e. g. in the users config or so).