Create a New Resource
This API is used to create a new resource in PAM360. The response confirms the successful creation of the resource and provides its unique resource ID.
Request URL
https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resources
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": {
"RESOURCENAME": "Windows Server",
"ACCOUNTNAME": "Administrator",
"RESOURCETYPE": "Windows",
"PASSWORD": "Test123#@!",
"NOTES": "Testing API",
"RESOURCEURL": "http://windowsserver/adminconsole",
"LOCATION": "India",
"DNSNAME": "localhost",
"DEPARTMENT": "IT",
"RESOURCEDESCRIPTION": "Resource",
"DOMAINNAME": "localhost",
"RESOURCEGROUPNAME": "group",
"ENABLEPRIVATEKEY": true,
"RESOURCEPASSWORDPOLICY": "Strong",
"ACCOUNTPASSWORDPOLICY": "Strong",
"OWNERNAME": "admin",
"RECORD_CONFIGURED_RESOURCE_URL": "https://localhost",
"DISABLE_TAB_DUPLICATION": true,
"WEBSITE_SESSION_RECORDING": true,
"GATEWAY_SESSION_RECORDING": true,
"SAP_USER_TYPE": "A",
"RESOURCECUSTOMFIELD": [
{
"CUSTOMLABEL": "Secure Resource",
"CUSTOMVALUE": "YES"
}
],
"ACCOUNTCUSTOMFIELD": [
{
"CUSTOMLABEL": "Secure Account",
"CUSTOMVALUE": "YES"
}
]
}
}
}| Parameters | Description | Values |
|---|---|---|
RESOURCENAME | Name of the resource to be added. | Default Value : N/A |
ACCOUNTNAME | Name of the account associated with the resource. | Default Value : N/A |
RESOURCETYPE | Type of the resource being created. | Default Value : The default resource type configured in PAM360. |
PASSWORD | Password for the associated account. | Default Value : A password is automatically generated based on the configured password policy. |
NOTES | Additional details of the account. | Default Value : N/A |
RESOURCEURL | The URL linked to the resource. | Default Value : N/A |
LOCATION | Location of the resource. | Default Value : N/A |
DNSNAME | DNS name of the resource. | Default Value : N/A |
DEPARTMENT | Department to which the resource belongs. | Default Value : N/A |
RESOURCEDESCRIPTION | Description of the resource. | Default Value : N/A |
DOMAINNAME | Domain associated with the resource. | Default Value : N/A |
RESOURCEGROUPNAME | Name of the resource group where the resource will be added. | Default Value : N/A |
ENABLEPRIVATEKEY | Specifies whether private key usage is enabled for the resource. | Default Value : N/A |
RESOURCEPASSWORDPOLICY | Password policy to be assigned to the resource. | Default Value : The resource will use the password policy configured as default in PAM360. |
ACCOUNTPASSWORDPOLICY | Password policy to be assigned to the account. | Default Value : The account will use the password policy configured as default in PAM360. |
OWNERNAME | Name of the resource owner. | Default Value : N/A | RECORD_CONFIGURED_ | Enables session recording for the configured resource URL. When enabled, recording starts as soon as the resource URL is launched, including the login window, for sessions initiated through the PAM360 interface. | Default Value : False |
DISABLE_TAB_DUPLICATION | Specifies whether duplicate tabs for the resource are disabled. | Default Value : False |
WEBSITE_SESSION_RECORDING | Specifies whether website session recording is enabled. | Default Value : False |
GATEWAY_SESSION_RECORDING | Specifies whether gateway session recording is enabled. | Default Value : False |
SAP_USER_TYPE | Specifies the type of SAP user account to be created. | Default Value : N/A |
RESOURCECUSTOMFIELD | Custom fields for the resource. Each object should have a CUSTOMLABEL and CUSTOMVALUE. | Default Value : N/A |
ACCOUNTCUSTOMFIELD | Custom fields for the account. Each object should have a CUSTOMLABEL and CUSTOMVALUE. | Default Value : N/A |
Sample Request
curl -X POST -H "AUTHTOKEN: <<Authtoken-generated-from-PAM360>>" -H "Content-Type: text/json" "https://<Host-Name OR IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/resources" --data-urlencode "INPUT_DATA={\"operation\":{\"Details\":{\"RESOURCENAME\":\"Windows Server1\",\"ACCOUNTNAME\":\"Administrator\",\"RESOURCETYPE\":\"Windows\",\"PASSWORD\":\"Test@123\",\"RESOURCEPASSWORDPOLICY\":\"Strong\",\"ACCOUNTPASSWORDPOLICY\":\"Strong\",\"RESOURCECUSTOMFIELD\":[{\"CUSTOMLABEL\":\"Secure Resource\",\"CUSTOMVALUE\":\"YES\"}],\"ACCOUNTCUSTOMFIELD\":[{\"CUSTOMLABEL\":\"Secure Account\",\"CUSTOMVALUE\":\"YES\"}]}}}"
#!/usr/bin/env python3
import requests
import urllib3
import json
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def main():
config = {
"auth_token": "<<Authtoken-generated-from-PAM360>>",
"host_name": "https://<Host-Name OR IP-Address-of-PAM360-Server>:<Port>"
}
session = requests.Session()
session.verify = True
try:
test_url = f"{config['host_name']}/restapi/json/v1/resources"
headers = {
"AUTHTOKEN": config["auth_token"],
"Content-Type": "text/json"
}
# INPUT_DATA payload
payload = {
"INPUT_DATA": json.dumps({
"operation": {
"Details": {
"RESOURCENAME": "Windows Server1",
"ACCOUNTNAME": "Administrator",
"RESOURCETYPE": "Windows",
"PASSWORD": "Test@123",
"RESOURCEPASSWORDPOLICY": "Strong",
"ACCOUNTPASSWORDPOLICY": "Strong",
"RESOURCECUSTOMFIELD": [
{"CUSTOMLABEL": "Secure Resource", "CUSTOMVALUE": "YES"}
],
"ACCOUNTCUSTOMFIELD": [
{"CUSTOMLABEL": "Secure Account", "CUSTOMVALUE": "YES"}
]
}
}
})
}
response = session.post(test_url, headers=headers, data=payload, timeout=10)
print(response.text)
except Exception as e:
print(f"Error: {e}")
session.close()
if __name__ == "__main__":
main()# API config $authToken = "<<Authtoken-generated-from-PAM360>>"
$url = "https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/resources" # Headers $headers = @{ "AUTHTOKEN"=$authToken; "Content-Type"="application/x-www-form-urlencoded" } # INPUT_DATA payload (fixed, compact) $inputData = @{ operation = @{ Details = @{ "RESOURCENAME"="Windows Server1"; "ACCOUNTNAME"="Administrator"; "RESOURCETYPE"="Windows"; "PASSWORD"="Test@123"; "RESOURCEPASSWORDPOLICY"="Strong"; "ACCOUNTPASSWORDPOLICY"="Strong"; "RESOURCECUSTOMFIELD"=@(@{ "CUSTOMLABEL"="Secure Resource"; "CUSTOMVALUE"="YES" }); "ACCOUNTCUSTOMFIELD"=@(@{ "CUSTOMLABEL"="Secure Account"; "CUSTOMVALUE"="YES" }) } } } | ConvertTo-Json -Depth 10 -Compress # Form-encoded body $body = "INPUT_DATA=$inputData" # Send POST request $response = Invoke-RestMethod -Uri $url -Method Post -Headers $headers -Body $body # Show response $response | ConvertTo-Json -Depth 5
Sample Response
{
"operation": {
"result": {
"message": "Resource pmp-centos6-ptuser1 has been added successfully",
"status": "Success"
},
"Details": {
"RESOURCEID": "304"
},
"name": "CREATE RESOURCE"
}
}