Run multiple WHM API 1 functions

This function combines calls for multiple WHM API 1 functions.

SecurityBasicAuth
Request
query Parameters
command
required
string

The WHM API 1 function to call.

Important:

Specify a command parameter for each function.

Note:

Include the function's input parameters as a URI-encoded list after the function name. For example, to call the killdns function with a domain parameter value of example.com directly you would use:

killdns?domain=example.com

To call this function using the batch function, URI-encode the command and pass it as part of the batch function:

/json-api/batch?api.version=1&command=killdns%3Fdomain%3Dexample.com

You can call the same function multiple times within a single batch API call. For example:

/json-api/batch?api.version=1&command=version&command=version&command=version

Example: command=version
abort_on_error
integer
Default: 0

Whether to stop processing remaining commands in the batch when a command returns an error.

  • 1 — Do not process remaining commands in the batch when an error occurs.
  • 0 — When an error occurs, process the remaining commands in the batch.
Enum: 0 1
Example: abort_on_error=0
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/batch
Request samples
whmapi1 --output=jsonpretty \
  batch \
  command='version'
Response samples
application/json
{
  • "data": {
    • "result": [
      • {
        • "data": {
          • "hostname": "example-hosting.com"
          },
        • "metadata": {
          • "command": "gethostname",
          • "reason": "OK",
          • "result": 1,
          • "version": 1
          }
        },
      • {
        • "data": {
          • "version": "11.88.0.1"
          },
        • "metadata": {
          • "command": "version",
          • "reason": "OK",
          • "result": 1,
          • "version": 1
          }
        }
      ]
    },
  • "metadata": {
    • "command": "batch",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}