Child pages
  • WHM API 1 Functions - validate_system_user
Skip to end of metadata
Go to start of metadata

Description

This function validates a system user for use on the target server.

Note:

For more information about how this function works with other functions in the transfer and restore process, read our Guide to Transfer and Restore API Functions documentation.

Examples 


 JSON API


https://hostname.example.com:2087/cpsess##########/json-api/validate_system_user?api.version=1&user=username

 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/validate_system_user?api.version=1&user=username
 Command Line
whmapi1 validate_system_user user=username


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)


{
  "data": {
    "valid_for_transfer": 1,
    "reserved": 1,
    "exists": 1,
    "valid_for_new": 1
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": "1",
    "command": "validate_system_user"
  }
}

 Output (XML)
<result>
    <data>
        <valid_for_transfer>1</valid_for_transfer>
        <reserved>1</reserved>
        <exists>1</exists>
        <valid_for_new>1</valid_for_new>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>validate_system_user</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
user
string

Required

The system username.

A valid username.
username

Returns

ReturnTypeDescriptionPossible valuesExample

valid_for_transfer

BooleanWhether the username is valid for a transferred account, but not a new account.
  • 1 — Valid for transfer, but not a new account.
  • 0 — Invalid.
1
reservedBooleanWhether the username is reserved.
  • 1 — Reserved.
  • 0Not reserved.
1
existsBooleanWhether the username exists on the server.
  • 1 — Exists.
  • 0 — Does not exist.
1
valid_for_newBooleanWhether the system can use the username to create a new account.
  • 1 — Usable.
  • 0 — Unusable.
1