latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

Authentication
API Token Management

Create API token for Dashboard

This function creates a WHM API token for WebPros Dashboard.

get/wp_dashboard_create_api_token

Query parameters

aclstring required

The privileges to assign to the token.

Note:

  • You can only assign privileges that you possess to the API token.
  • This function does not assign all of your privileges by default. The system will reject a request without an acl or acl-N value.
token_namestring required
Example:example

The API token's name.

Note:

This parameter's value cannot exceed 50 characters and may only contain alphanumeric characters, dashes (-), and underscores (_).

expires_atinteger
Example:1609372800

The API token's expiration time, in Unix Epoch format.

Note:

  • If you do not use this parameter or use the 0 value, the API token will not expire.
  • You must manually delete expired API tokens.
string ipv4
OR
string ipv6
OR
string cidr

One or more optional remote IP address or CIDR IP address ranges that can use this token.

Note:

If you do not use this parameter, the system does not limit which IP addressess can use this token.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "acls": [
      "kill-acct"
    ],
    "create_time": 1483625276,
    "expires_at": 1609372800,
    "name": "example",
    "token": "UWU28DCA23NKY76CN17MDPKM3O7EFQY8",
    "whitelist_ips": [
      "192.0.2.1",
      "192.0.2.2",
      "192.0.2.8/29",
      "2001:0db8:0000:0000:0000:0000:0000:0001",
      "2001:0db8:0000:0000:0000:0000:0000:0000/48"
    ]
  },
  "metadata": {
    "command": "wp_dashboard_create_api_token",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}