There are no option to create CLI users within NSX Manager UI. So only option is to do this via API. There are several reasons why you might want to do this:
RBAC for each person login in via SSH.
Monitoring solution that might need to query using CLI commands or check filesystem on appliance.
Auditor/Pen tester wanting access.
1) Connect to NSX manager via SSH. Login, enter privileged mode and then configuration mode to create the user account as shown:
Login as: admin
user api_username password plaintext Password01!
2) Grant the user account access to the web-interface (API):
user api_username privilege web-interface
3) Start a browser and connect to the NSX manager using the ‘admin’ account. This is needed to validate self-signed cert. You can skip this step if you are using software like Postman, where you can tick a box to ignore self-signed cert warnings.
4) Start a Rest API Client and input these:
Basic Authentication - use admin account and it's password or any others that has NSX Enterprise Admin Role.