Create a New Resource

POST

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>>"
}

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": {
			"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"
				}
			]
		}
	}
}

ParametersDescriptionValues

RESOURCENAME

Name of the resource to be added.
Type : String
Mandatory : Yes

Default Value : N/A

ACCOUNTNAME

Name of the account associated with the resource.
Type : String
Mandatory : No

Default Value : N/A

RESOURCETYPE

Type of the resource being created.
Type : String
Mandatory : No

Default Value : The default resource type configured in PAM360.

PASSWORD

Password for the associated account.
Type : String
Mandatory : No

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

NOTES

Additional details of the account.
Type : String
Mandatory : No

Default Value : N/A

RESOURCEURL

The URL linked to the resource.
Type : URL
Mandatory : No

Default Value : N/A

LOCATION

Location of the resource.
Type : String
Mandatory : No

Default Value : N/A

DNSNAME

DNS name of the resource.
Type : String
Mandatory : No

Default Value : N/A

DEPARTMENT

Department to which the resource belongs.
Type : String
Mandatory : No

Default Value : N/A

RESOURCEDESCRIPTION

Description of the resource.
Type : String
Mandatory : No

Default Value : N/A

DOMAINNAME

Domain associated with the resource.
Type : String
Mandatory : No

Default Value : N/A

RESOURCEGROUPNAME

Name of the resource group where the resource will be added.
Type : String
Mandatory : No

Default Value : N/A

ENABLEPRIVATEKEY

Specifies whether private key usage is enabled for the resource.
Type : Boolean
Mandatory : No

Default Value : N/A

RESOURCEPASSWORDPOLICY

Password policy to be assigned to the resource.
Type : String
Mandatory : No

Default Value : The resource will use the password policy configured as default in PAM360.
Allowed Value : The password policies available in PAM360.

ACCOUNTPASSWORDPOLICY

Password policy to be assigned to the account.
Type : String
Mandatory : No

Default Value : The account will use the password policy configured as default in PAM360.
Allowed Value : The password policies available in PAM360.

OWNERNAME

Name of the resource owner.
Type : String
Mandatory : No

Default Value : N/A

RECORD_CONFIGURED_
RESOURCE_URL

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.
Type : Boolean
Mandatory : No
Supported Version : 7500

Default Value : False

DISABLE_TAB_DUPLICATION

Specifies whether duplicate tabs for the resource are disabled.
Type : Boolean
Mandatory : No
Supported Version : 7500

Default Value : False

WEBSITE_SESSION_RECORDING

Specifies whether website session recording is enabled.
Type : Boolean
Mandatory : No
Supported Version : 7500

Default Value : False

GATEWAY_SESSION_RECORDING

Specifies whether gateway session recording is enabled.
Type : Boolean
Mandatory : No
Supported Version : 7500

Default Value : False

SAP_USER_TYPE

Specifies the type of SAP user account to be created.
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)

RESOURCECUSTOMFIELD

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

Default Value : N/A

ACCOUNTCUSTOMFIELD

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

Default Value : N/A

Sample Request

cURLPythonPowerShell
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"
  }
}



Top