Manage2 API Function - Add Group

Last modified: December 17, 2021


Description

This function adds a group to a Manage2 account.

Examples

XML

https://manage2.cpanel.net/XMLgroupAdd.cgi?group=NewGroup

JSON

https://manage2.cpanel.net/XMLgroupAdd.cgi?output=json&group=NewGroup

YAML

https://manage2.cpanel.net/XMLgroupAdd.cgi?output=yaml&group=NewGroup

1
2
3
4
5
6
7
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("[email protected]","123456luggage");
$response = (array)$cpl->addGroup(array(
    'group'   => 'NewGroup',
);
?>

1
2
3
4
5
use cPanelLicensing;
my $cpl = cPanelLicensing->new(user => "[email protected]", pass => "123456luggage");
my $response = $licenseManager->addGroup(
    'group'   => 'NewGroup',
);

<XMLgroupAdd reason="Added 'NewGroup' group." status="1" />

1
2
3
4
{
    "reason": "Added 'NewGroup' group.",
    "status": 1
}

1
2
3
---
reason: Added 'NewGroup' group.
status: 1

Parameters

This function accepts the following parameters:

Parameter Type Description Example
group string Required
The desired group name, up to 50 characters.
NewGroup
maingroup Boolean Default group to which new licenses are added unless a group is explicitly defined.
Whether the maingroup is True:
  • 1 — True.
  • 0 — False.
1
country string The country of the datacenter in which licenses in the group are hosted.
Note:
Country code must be in the form of ISO 3166-1 alpha-2
US
stateprov string The state or province of the datacenter in which licenses in the group are hosted.
Note:
Code must be in the form of ISO 3166-2
TX
city string The city name the datacenter in which licenses in the group are hosted. Houston
postcode string
The post code of the address of the datacenter in which licenses in the group are hosted.
77092
addr1 string
The street number and street name of the address of the datacenter in which licenses in the group are hosted.
1234 Virtual St
addr2 string The suite or apartment number of the address of the datacenter in which licenses in the group are hosted, if applicable. 716

Returns

This function returns the following values:

Return Type Description Example
reason string A message of success or failure. Added 'NewGroup' group.
status Boolean Whether the function succeeded:
  • 1 — The function succeeded.
  • 0 — The function failed.
1

Additional Documentation