Add Accounts under a Specific Resource

POST

This API adds one or more accounts under a specific resource in PAM360. The response confirms the successful addition of each account and provides their respective status.

Request URL

https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resources/<RESOURCEID>/accounts

ParameterDescriptionValues

RESOURCEID

The ID of the resource to which the account has to be added.
Type : Integer
Mandatory : Yes

Default Value : N/A

Header Parameters

{
"AUTHTOKEN" : "<<Authtoken-generated-from-PAM360>>",
"orgName"   : "<<org display name>>"
}

ParameterDescriptionValues

AUTHTOKEN

Authentication token for the user to authorize the API request.
Type : String
Mandatory : Yes

Default Value : N/A

orgName

Organization name available in PAM360.
Type : String
Mandatory : No

Default Value : The organization to which the user belongs.

Body Parameters

INPUT_DATA = {
"operation": {
	"Details": {
		"ACCOUNTLIST": [
		{
			"ACCOUNTNAME": "bestest013",
			"PASSWORD": "Pa$$ Word@124 ",
			"ACCOUNTPASSWORDPOLICY": "Strong",
			"ACCOUNTPASSWORDPOLICYID": 101,
			"COMMAN_SET": 1000,
			"RECORD_RDP_SESSIONS": true,
			"RECORD_CLI_SESSIONS": true,
			"DISABLE_PASSWORD_RESETS": true,
			"CONFIGURE_PASSWORD_RESET": true,
			"ACCOUNT_RESOURCE_GROUP_IDS": ["3002","3003"],
			"IIS_WEB_CONFIG_RESET": true,
			"IIS_APP_POOL_RESTART": true,
			"IIS_APP_POOL_RESET": true,
			"SERVICES_RESTART": true,
			"SERVICES_RESET": true,
			"SCHEDULED_TASK_RESET": true,
			"NOTES": "IT Security - BES PMP API Test",
			"TOTP_SECRET": "829 198",
			"TOTP_ALGORITHM": "SHA256",
			"TOTP_DIGITS": "6",
			"TOTP_VALIDITY": "30",
			"SAP_USER_TYPE": "A",
			"ACCOUNTCUSTOMFIELD": [
				{ 
					"CUSTOMLABEL": "Secure Account", 
					"CUSTOMVALUE": "YES" 
				}
			],
			"WEBSITE_SESSION_RECORDING": true,
			"GATEWAY_SESSION_RECORDING": true
		},
		
		{
			"ACCOUNTNAME": "bestest113",
			"PASSWORD": "Pa$$ Word@123 ",
			"ACCOUNTPASSWORDPOLICY": "Strong",
			"ACCOUNTPASSWORDPOLICYID": 101,
			"COMMAN_SET": 1000,
			"RECORD_RDP_SESSIONS": true,
			"RECORD_CLI_SESSIONS": true,
			"DISABLE_PASSWORD_RESETS": true,
			"CONFIGURE_PASSWORD_RESET": true,
			"ACCOUNT_RESOURCE_GROUP_IDS": ["3002","3003"],
			"IIS_WEB_CONFIG_RESET": true,
			"IIS_APP_POOL_RESTART": true,
			"IIS_APP_POOL_RESET": true,
			"SERVICES_RESTART": true,
			"SERVICES_RESET": true,
			"SCHEDULED_TASK_RESET": true,
			"NOTES": "IT Security - BES PMP API Test",
			"TOTP_SECRET": "829 198",
			"TOTP_ALGORITHM": "SHA256",
			"TOTP_DIGITS": "6",
			"TOTP_VALIDITY": "30",
			"ACCOUNTCUSTOMFIELD": [
				{ 
					"CUSTOMLABEL": "Secure Account", 
					"CUSTOMVALUE": "YES" 
				}
			],
			"WEBSITE_SESSION_RECORDING": false,
			"GATEWAY_SESSION_RECORDING": false
		}
		]
	}
}
}

ParametersDescriptionValues

ACCOUNTNAME

The name of the account to be created.
Type : String
Mandatory : Yes

Default Value : N/A

PASSWORD

Password for the account.
Type : String
Mandatory : No

Default Value : A password is automatically generated based on the configured password policy.

ACCOUNTPASSWORDPOLICY

Password policy applied to the account.
Type : String
Mandatory : No

Default Value : The password policy configured at the resource level.

RECORD_RDP_SESSIONS

Enables recording of RDP sessions for this account.
Type : Boolean
Mandatory : No

Default Value : N/A

RECORD_CLI_SESSIONS

Enables recording of CLI sessions for this account.
Type : Boolean
Mandatory : No

Default Value : N/A

DISABLE_PASSWORD_RESETS

Prevents automatic password resets.
Type : Boolean
Mandatory : No

Default Value : N/A

CONFIGURE_PASSWORD_RESET

Allows configuration of password reset for associated service accounts.
Type : Boolean
Mandatory : No

Default Value : N/A

ACCOUNT_RESOURCE_GROUP_IDS

The list of resource group IDs to which the account belongs.
Type : Integer Array
Mandatory : No

Default Value : N/A

IIS_WEB_CONFIG_RESET

Enables IIS Web Config reset during password reset.
Type : Boolean
Mandatory : No

Default Value : N/A

IIS_APP_POOL_RESTART

Restarts IIS Application Pool after password reset.
Type : Boolean
Mandatory : No

Default Value : N/A

IIS_APP_POOL_RESET

Resets IIS Application Pool during password reset.
Type : Boolean
Mandatory : No

Default Value : N/A

SERVICES_RESTART

Restarts associated services after password reset.
Type : Boolean
Mandatory : No

Default Value : N/A

SERVICES_RESET

Resets associated services during password reset.
Type : Boolean
Mandatory : No

Default Value : N/A

SCHEDULED_TASK_RESET

Resets scheduled tasks during password reset.
Type : Boolean
Mandatory : No

Default Value : N/A

NOTES

Additional notes related to the account.
Type : String
Mandatory : No

Default Value : N/A

TOTP_SECRET

Secret key for generating TOTP.
Type : String
Mandatory : No

Default Value : N/A

TOTP_ALGORITHM

Algorithm used for TOTP generation.
Type : String
Mandatory : No

Default Value : N/A

TOTP_DIGITS

Number of digits in TOTP.
Type : String
Mandatory : No

Default Value : N/A

TOTP_VALIDITY

Validity of TOTP in seconds.
Type : String
Mandatory : No

Default Value : N/A

SAP_USER_TYPE

Specifies the type of SAP user account to be added.
Type : String
Mandatory : No
Supported Version : 8500

Default Value : N/A
Allowed Value : A (Dialog User), B (System User), C (Communication User), S (Service User), L (Reference User)

ACCOUNTCUSTOMFIELD

Custom fields for the account. Each object should have a CUSTOMLABEL and CUSTOMVALUE.
Type : JSON
Mandatory : No

Default Value : N/A

WEBSITE_SESSION_RECORDING

Enables website session recording.
Type : Boolean
Mandatory : No

Default Value : N/A

GATEWAY_SESSION_RECORDING

Enables gateway session recording.
Type : Boolean
Mandatory : No

Default Value : N/A

Sample Request

cURLPythonPowerShell
curl -X POST "https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resources/901/accounts" -H "AUTHTOKEN:<<Authtoken-generated-from-PAM360>>" -H "Content-Type: application/json" -d "INPUT_DATA={\"operation\":{\"Details\":{\"ACCOUNTLIST\":[{\"ACCOUNTNAME\":\"bestest013\",\"PASSWORD\":\"Pa$$ Word@124 \",\"ACCOUNTPASSWORDPOLICY\":\"Strong\",\"ACCOUNTPASSWORDPOLICYID\":101,\"COMMAND_SET\":1000,\"RECORD_RDP_SESSIONS\":true,\"RECORD_CLI_SESSIONS\":true,\"DISABLE_PASSWORD_RESETS\":true,\"CONFIGURE_PASSWORD_RESET\":true,\"ACCOUNT_RESOURCE_GROUP_IDS\":[\"3002\",\"3003\"],\"IIS_WEB_CONFIG_RESET\":true,\"IIS_APP_POOL_RESTART\":true,\"IIS_APP_POOL_RESET\":true,\"SERVICES_RESTART\":true,\"SERVICES_RESET\":true,\"SCHEDULED_TASK_RESET\":true,\"NOTES\":\"IT Security - BES PMP API Test\",\"TOTP_SECRET\":\"829 198\",\"TOTP_ALGORITHM\":\"SHA256\",\"TOTP_DIGITS\":\"6\",\"TOTP_VALIDITY\":\"30\",\"SAP_USER_TYPE\":\"A\",\"ACCOUNTCUSTOMFIELD\":[{\"CUSTOMLABEL\":\"Secure Account\",\"CUSTOMVALUE\":\"YES\"}],\"WEBSITE_SESSION_RECORDING\":true,\"GATEWAY_SESSION_RECORDING\":true},{\"ACCOUNTNAME\":\"bestest113\",\"PASSWORD\":\"Pa$$ Word@123 \",\"ACCOUNTPASSWORDPOLICY\":\"Strong\",\"ACCOUNTPASSWORDPOLICYID\":101,\"COMMAND_SET\":1000,\"RECORD_RDP_SESSIONS\":true,\"RECORD_CLI_SESSIONS\":true,\"DISABLE_PASSWORD_RESETS\":true,\"CONFIGURE_PASSWORD_RESET\":true,\"ACCOUNT_RESOURCE_GROUP_IDS\":[\"3002\",\"3003\"],\"IIS_WEB_CONFIG_RESET\":true,\"IIS_APP_POOL_RESTART\":true,\"IIS_APP_POOL_RESET\":true,\"SERVICES_RESTART\":true,\"SERVICES_RESET\":true,\"SCHEDULED_TASK_RESET\":true,\"NOTES\":\"IT Security - BES PMP API Test\",\"TOTP_SECRET\":\"829 198\",\"TOTP_ALGORITHM\":\"SHA256\",\"TOTP_DIGITS\":\"6\",\"TOTP_VALIDITY\":\"30\",\"ACCOUNTCUSTOMFIELD\":[{\"CUSTOMLABEL\":\"Secure Account\",\"CUSTOMVALUE\":\"YES\"}],\"WEBSITE_SESSION_RECORDING\":false,\"GATEWAY_SESSION_RECORDING\":false}]}}}"
import requests

url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resources/603/accounts"

headers = {
	"AUTHTOKEN": "<<Authtoken-generated-from-PAM360>>",
	"Content-Type": "application/x-www-form-urlencoded"
}

data = {
	"INPUT_DATA": """{
	  "operation": {
		"Details": {
		  "ACCOUNTLIST": [
			{
			  "ACCOUNTNAME": "bestest013",
			  "PASSWORD": "Pa$$ Word@124 ",
			  "ACCOUNTPASSWORDPOLICY": "Strong",
			  "ACCOUNTPASSWORDPOLICYID": 101,
			  "RECORD_RDP_SESSIONS": true,
			  "RECORD_CLI_SESSIONS": true,
			  "DISABLE_PASSWORD_RESETS": true,
			  "CONFIGURE_PASSWORD_RESET": true,
			  "ACCOUNT_RESOURCE_GROUP_IDS": ["3002","3003"],
			  "IIS_WEB_CONFIG_RESET": true,
			  "IIS_APP_POOL_RESTART": true,
			  "IIS_APP_POOL_RESET": true,
			  "SERVICES_RESTART": true,
			  "SERVICES_RESET": true,
			  "SCHEDULED_TASK_RESET": true,
			  "NOTES": "IT Security - BES PMP API Test",
			  "SAP_USER_TYPE": "A",
			  "ACCOUNTCUSTOMFIELD": [ { "CUSTOMLABEL": "Secure Account", "CUSTOMVALUE": "YES" } ],
			  "WEBSITE_SESSION_RECORDING": true,
			  "GATEWAY_SESSION_RECORDING": true
			},
			{
			  "ACCOUNTNAME": "bestest113",
			  "PASSWORD": "Pa$$ Word@123 ",
			  "ACCOUNTPASSWORDPOLICY": "Strong",
			  "ACCOUNTPASSWORDPOLICYID": 101,
			  "RECORD_RDP_SESSIONS": true,
			  "RECORD_CLI_SESSIONS": true,
			  "DISABLE_PASSWORD_RESETS": true,
			  "CONFIGURE_PASSWORD_RESET": true,
			  "ACCOUNT_RESOURCE_GROUP_IDS": ["3002","3003"],
			  "IIS_WEB_CONFIG_RESET": true,
			  "IIS_APP_POOL_RESTART": true,
			  "IIS_APP_POOL_RESET": true,
			  "SERVICES_RESTART": true,
			  "SERVICES_RESET": true,
			  "SCHEDULED_TASK_RESET": true,
			  "NOTES": "IT Security - BES PMP API Test",
			  "ACCOUNTCUSTOMFIELD": [ { "CUSTOMLABEL": "Secure Account", "CUSTOMVALUE": "YES" } ],
			  "WEBSITE_SESSION_RECORDING": false,
			  "GATEWAY_SESSION_RECORDING": false
			}
		]
		}
	}
	}"""
}

response = requests.post(url, headers=headers, data=data, verify=True)

print("Status:", response.status_code)
print("Response:", response.text)
$Url = "https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resources/2101/accounts"
 
$headers = @{
 "AUTHTOKEN"   = "<<Authtoken-generated-from-PAM360>>"
 "Content-Type" = "application/x-www-form-urlencoded"
}
 
$body = @{
 INPUT_DATA = '{
   "operation": {
  "Details": {
    "ACCOUNTLIST": [
   {
     "ACCOUNTNAME": "bestest013",
     "PASSWORD": "Pa$$ Word@124 ",
     "ACCOUNTPASSWORDPOLICY": "Strong",
     "ACCOUNTPASSWORDPOLICYID": 101,
     "COMMAND_SET": 1000,
     "RECORD_RDP_SESSIONS": true,
     "RECORD_CLI_SESSIONS": true,
     "DISABLE_PASSWORD_RESETS": true,
     "CONFIGURE_PASSWORD_RESET": true,
     "ACCOUNT_RESOURCE_GROUP_IDS": ["3002","3003"],
     "IIS_WEB_CONFIG_RESET": true,
     "IIS_APP_POOL_RESTART": true,
     "IIS_APP_POOL_RESET": true,
     "SERVICES_RESTART": true,
     "SERVICES_RESET": true,
     "SCHEDULED_TASK_RESET": true,
     "NOTES": "IT Security - BES PMP API Test",
     "SAP_USER_TYPE": "A",
     "TOTP_SECRET": "HGFVHJGVJHGGH",
     "TOTP_ALGORITHM": "SHA256",
     "TOTP_DIGITS": "6",
     "TOTP_VALIDITY": "30",
     "ACCOUNTCUSTOMFIELD": [ {  "CUSTOMLABEL": "Secure Account",  "CUSTOMVALUE": "YES" } ],
     "WEBSITE_SESSION_RECORDING": true,
     "GATEWAY_SESSION_RECORDING": true
   },
   {
     "ACCOUNTNAME": "bestest113",
     "PASSWORD": "Pa$$ Word@123 ",
     "ACCOUNTPASSWORDPOLICY": "Strong",
     "ACCOUNTPASSWORDPOLICYID": 101,
     "COMMAND_SET": 1000,
     "RECORD_RDP_SESSIONS": true,
     "RECORD_CLI_SESSIONS": true,
     "DISABLE_PASSWORD_RESETS": true,
     "CONFIGURE_PASSWORD_RESET": true,
     "ACCOUNT_RESOURCE_GROUP_IDS": ["3002","3003"],
     "IIS_WEB_CONFIG_RESET": true,
     "IIS_APP_POOL_RESTART": true,
     "IIS_APP_POOL_RESET": true,
     "SERVICES_RESTART": true,
     "SERVICES_RESET": true,
     "SCHEDULED_TASK_RESET": true,
     "NOTES": "IT Security - BES PMP API Test",
     "TOTP_SECRET": "HGHDCGBJHHGVHJ",
     "TOTP_ALGORITHM": "SHA256",
     "TOTP_DIGITS": "6",
     "TOTP_VALIDITY": "30",
     "ACCOUNTCUSTOMFIELD": [ {  "CUSTOMLABEL": "Secure Account",  "CUSTOMVALUE": "YES" } ],
     "WEBSITE_SESSION_RECORDING": false,
     "GATEWAY_SESSION_RECORDING": false
   }
    ]
  }
   }
 }'
}
 
$response = Invoke-WebRequest -Uri $url -Headers $headers -Method POST -Body $body  
$response.Content

Sample Response

{
  "operation": {
    "name": "ADD ACCOUNTS",
    "result": {
      "status": "Success",
      "message": "Account added successfully"
    },
    "Details": {
      "bestest047": {
        "STATUS": "Account added successfully"
      },
      "bestest048": {
        "STATUS": "Account added successfully"
      }
    }
  }
}



Top