Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
WHM API 1 Functions - start_profile_activation - Developer Documentation - cPanel Documentation
Child pages
  • WHM API 1 Functions - start_profile_activation
Skip to end of metadata
Go to start of metadata

Description

This function activates a server profile.

Note:

  • In cPanel & WHM version 82 and earlier, you cannot use this function if accounts exist on the server.
  • For a list of the server's available profiles, use the get_available_profiles function.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/start_profile_activation?api.version=1&code=MAILNODE&optional=%7B%22SpamFilter%22%3A1%2C+%22DNS%22%3A0%7D
 Command Line
whmapi1 start_profile_activation code=MAILNODE optional=%7B%22SpamFilter%22%3A1%2C+%22DNS%22%3A0%7D


Notes:

  • Unless otherwise noted, 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":{  
      "log_id":"17053.10418168.1533478604"
   },
   "metadata":{  
      "version":1,
      "command":"start_profile_activation",
      "reason":"OK",
      "result":1
   }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
codestring

Required

The code value of the server profile.

  • STANDARDNODE — The Standard Node profile.
  • DATABASENODE — The Database Node profile.
  • MAILNODE — The Mail Node profile.
  • DNSNODE — The DNS Node profile.
MAILNODE
optionalJSON

The optional roles to enable or disable with the profile, in JSON format.

Note:

  • This parameter does not enable optional roles for profiles that do not possess any optional roles. For a list of profiles and their optional roles, read our How to Use Server Profiles documentation.
  • You must URI-encode this return.

If you do not pass this parameter, the system disables a profile's optional roles, if any exist.

  • 0 — Disable role.
  • 1 — Enable role.

%7B%22SpamFilter%22%3A1%2C+%22DNS%22%3A0%7D

Returns

ReturnTypeDescriptionPossible valuesExample
log_idstring

The profile activation log ID.

The system creates the log files in the /var/cpanel/logs/activate_profile/ directory.

A valid log ID.

17053.10418168.1533478604