Skip to main content

AddPolicyGroup

July 21, 2025

This API lets you add (create) a new Policy Group and optionally allocate it to User Group(s), returned is the PolicyGroupID that can be used with UpdatePolicyGroup.do.

The settings can be found on the AhsayCBS web console at:

  • Backup / Restore > Users, Groups & Policies > Policy Group

URL

https://CBS.EXAMPLE.COM/obs/api/json/AddPolicyGroup.do

Available Since Version: 9.1

Parameters

Key Type Description
SysUser String Username of an AhsayCBS System User with Admin or API role.
SysPwd String Password matching SysUser.
Name String Name of the policy group.
Owner String SubAdmin name if Policy is to be assigned to a SubAdmin.
UserGroupIDList Array of Strings Array of User Group ID.
Return Values
Key Type Description
Status String "OK" or "Error"
Message String Error message, it only appears if status displays "Error".
ExptType String The type of exception, will only be displayed if the status is "Error".
PolicyGroupID String ID of the policy group.
Examples

Example 1

INPUT

{
	"SysUser":"system",
	"SysPwd":"system1",
	"Name":"Default settings",
	"Owner":"",
	"UserGroupIDList":["1"]
}

OUTPUT

{
	"Status":"Error",
	"Message":"[Error] Parameter Name, Default settings, already exists!",
	"ExptType":"com.ahsay.cbs.mT"
}

Example 2

INPUT

{
	"SysUser":"system",
	"SysPwd":"system1",
	"Name":"UG Test",
	"Owner":"test",
	"UserGroupIDList":["1686621934417"]
}

OUTPUT

{
	"Status":"OK",
	"PolicyGroupID":"1686621934417"
}

Example 3

INPUT

{
	"SysUser":"system",
	"SysPwd":"system1",
	"Name":"UG Test",
	"Owner":"test",
	"UserGroupIDList":["1","3"]
}

OUTPUT

{
	"Status":"Error",
	"Message":"[Error] Parameter UserGroupID, 3 is not a 13-digit format!",
	"ExptType":"com.ahsay.obs.core.dbs.DbsException"
}

Example 4

INPUT

{
	"SysUser":"system",
	"SysPwd":"system1",
	"Name":"UG Test",
	"Owner":"test",
	"UserGroupIDList":[0]
}

OUTPUT

{
	"Status":"OK",
	"Message":"JSONArray[0] is not a String (class java.lang.Integer : 0).",
	"ExptType":"org.json.JSONException"
}

Example 5

INPUT

{
	"SysUser":"api",
	"SysPwd":"pwd",
	"Name":"UG Test",
	"Owner":0,
	"UserGroupIDList":["1"]
}

OUTPUT

{
	"Status":"OK",
	"Message":"[Error] Parameter Owner ‘0’ is not a valid owner.",
	"ExptType":"com.ahsay.obs.core.dbs.DbsException"
}