Create cPanel API token

This function creates a new API token with full access to all of a cPanel account's features.

Note:

The token only grants access to the features that the account has access to. For example, if you disable the File Manager feature, the token can't access it.

Authorizations:
query Parameters
name
required
string <= 50 characters

The API token's name.

Note:

The name may only contain alphanumeric characters, dashes (-), and underscores (_).

Example: name=example
expires_at
integer <unix_timestamp>

The API token's expiration time.

Important:

  • When an API token expires the system does not delete it. You must manually delete expired API tokens.
  • If you do not use this parameter, the API token will not expire.
Example: expires_at=1609372800

Responses

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object

Request samples

uapi --output=jsonpretty \
  --user=username \
  Tokens \
  create_full_access \
  name='example'

Response samples

Content type
application/json
{
  • "apiversion": 3,
  • "func": "create_full_access",
  • "module": "Tokens",
  • "result": {
    • "data": {
      • "create_time": 1549467298,
      • "token": "JPQNSRU0DH448UJLGXH7KVJECC5QN9N9"
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}