How does one change a username via the API?

I was wondering: is it safe to change the system username?