Add Accounts under a Specific Resource
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
| Parameter | Description | Values |
|---|---|---|
RESOURCEID | The ID of the resource to which the account has to be added. | Default Value : N/A |
Header Parameters
{
"AUTHTOKEN" : "<<Authtoken-generated-from-PAM360>>",
"orgName" : "<<org display name>>"
}| Parameter | Description | Values |
|---|---|---|
AUTHTOKEN | Authentication token for the user to authorize the API request. | Default Value : N/A |
orgName | Organization name available in PAM360. | 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
}
]
}
}
}| Parameters | Description | Values |
|---|---|---|
ACCOUNTNAME | The name of the account to be created. | Default Value : N/A |
PASSWORD | Password for the account. | Default Value : A password is automatically generated based on the configured password policy. |
ACCOUNTPASSWORDPOLICY | Password policy applied to the account. | Default Value : The password policy configured at the resource level. |
RECORD_RDP_SESSIONS | Enables recording of RDP sessions for this account. | Default Value : N/A |
RECORD_CLI_SESSIONS | Enables recording of CLI sessions for this account. | Default Value : N/A |
DISABLE_PASSWORD_RESETS | Prevents automatic password resets. | Default Value : N/A |
CONFIGURE_PASSWORD_RESET | Allows configuration of password reset for associated service accounts. | Default Value : N/A |
ACCOUNT_RESOURCE_GROUP_IDS | The list of resource group IDs to which the account belongs. | Default Value : N/A |
IIS_WEB_CONFIG_RESET | Enables IIS Web Config reset during password reset. | Default Value : N/A |
IIS_APP_POOL_RESTART | Restarts IIS Application Pool after password reset. | Default Value : N/A |
IIS_APP_POOL_RESET | Resets IIS Application Pool during password reset. | Default Value : N/A |
SERVICES_RESTART | Restarts associated services after password reset. | Default Value : N/A |
SERVICES_RESET | Resets associated services during password reset. | Default Value : N/A |
SCHEDULED_TASK_RESET | Resets scheduled tasks during password reset. | Default Value : N/A |
NOTES | Additional notes related to the account. | Default Value : N/A |
TOTP_SECRET | Secret key for generating TOTP. | Default Value : N/A |
TOTP_ALGORITHM | Algorithm used for TOTP generation. | Default Value : N/A |
TOTP_DIGITS | Number of digits in TOTP. | Default Value : N/A |
TOTP_VALIDITY | Validity of TOTP in seconds. | Default Value : N/A |
SAP_USER_TYPE | Specifies the type of SAP user account to be added. | Default Value : N/A |
ACCOUNTCUSTOMFIELD | Custom fields for the account. Each object should have a CUSTOMLABEL and CUSTOMVALUE. | Default Value : N/A |
WEBSITE_SESSION_RECORDING | Enables website session recording. | Default Value : N/A |
GATEWAY_SESSION_RECORDING | Enables gateway session recording. | Default Value : N/A |
Sample Request
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"
}
}
}
}