What USERNAME_OCCUPIED means
In the error table for the account.updateUsername method, the code is described as: this username is already used by another account, with response code 400. The same table lists USERNAME_INVALID (the username does not fit the format, see its own page) and USERNAME_NOT_MODIFIED (the requested username matches the current one).
How to find a free username
- Add digits, a year or a short word to the name. The longer it is, the better the chance it is free.
- Try the options in the Telegram app, in the profile settings: it shows right away whether a username is free.
- Keep the format rules in mind: Latin letters, digits and underscores, 5 to 32 characters.
What to do
- Pick another option and save it again.
- If the username is for sale on Fragment, Telegram returns
USERNAME_PURCHASE_AVAILABLE: it can be bought only there. - Do not run through options in a fast series, or you will get
FLOOD_WAIT.