Run UAPI function through WHM API

This function calls a UAPI function through the WHM API. This function's output will match the UAPI function that it calls.

SecurityBasicAuth
Request
query Parameters
cpanel.function
required
string

The UAPI function to call.

Note:

You must include the UAPI function's required parameters. You can also include its optional parameters.

For example, to call the UAPI get_stats function with its required display parameter and the bandwidthusage and diskusage values:

display=bandwidthusage|diskusage

Example: cpanel.function=get_stats
cpanel.module
required
string

The UAPI function's cPanel module.

Example: cpanel.module=StatsBar
cpanel.user
required
string

The cPanel username to call with the UAPI function.

Example: cpanel.user=username
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/uapi_cpanel
Request samples
whmapi1 --output=jsonpretty \
  uapi_cpanel \
  cpanel.function='get_stats' \
  cpanel.module='StatsBar' \
  cpanel.user='username'
Response samples
application/json
{
  • "data": {
    • "uapi": {
      • "data": [
        • {
          • "_count": "0",
          • "_max": "unlimited",
          • "_maxed": 0,
          • "count": "0",
          • "feature": "addondomains",
          • "id": "addondomains",
          • "is_maxed": 0,
          • "item": "Addon Domains",
          • "max": "unlimited",
          • "maxed_phrase": "You are using your maximum allotment ([numf,_1]) of addon domains.",
          • "module": "Park",
          • "name": "addondomains",
          • "near_limit_phrase": "You are using [numf,_1] of [numf,_2] available addon [numerate,_2,domain,domains].",
          • "percent": 0,
          • "percent10": 0,
          • "percent20": 0,
          • "percent5": 0,
          • "phrase": "Addon Domains",
          • "role": "WebServer",
          • "zeroisunlimited": 0
          }
        ],
      • "errors": null,
      • "messages": null,
      • "metadata": {
        • "transformed": 1
        },
      • "status": 1,
      • "warnings": null
      }
    },
  • "metadata": {
    • "command": "uapi_cpanel",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}