Generate and Fetch PAM360 Agent Key

POST

This API generates and fetches an agent key in PAM360. The response returns the generated agent key along with its expiry time.

Request URL

https://<Hostname-or-IP-address-of-PAM360-server>:<Port>/restapi/json/v1/agents/agentkey

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": {
		"generateAgentKey": "true",
		"validityPeriod": 3
		}
	}
}

ParametersDescriptionValues

generateAgentKey

Indicates whether an agent key should be generated.
Type : Boolean
Mandatory : Yes

Default Value : N/A

validityPeriod

Defines the time (in hours) for which the agent key remains valid and can be reused for multiple installations.
Type : Integer
Mandatory : No

Default Value : N/A

Sample Request

cURLPythonPowerShell
curl -X POST -H "AUTHTOKEN:<<Authtoken-generated-from-PAM360>>" -H "Content-Type:application/x-www-form-urlencoded" "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/agents/agentkey" --data-urlencode "INPUT_DATA={\"operation\":{\"details\":{\"generateAgentKey\":\"true\",\"validityPeriod\":3}}}"	
import requests
import json

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

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

payload = {
	"operation": {
		"details": {
			"generateAgentKey": "true",
			"validityPeriod": 3  
		}
	}
}

form_data = {
	"INPUT_DATA": json.dumps(payload)
}

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

print("Status Code:", response.status_code)
print("Response:", response.text)
		
$Url = "https://<Host-Name or IP-Address-of-PAM360-Server>:<Port>/restapi/json/v1/agents/agentkey"

$Headers = @{
	"AUTHTOKEN"    = "<<Authtoken-generated-from-PAM360>>"
	"Content-Type" = "application/x-www-form-urlencoded"
}

$Body = @{
	INPUT_DATA = '{"operation":{"details":{"generateAgentKey":"true","validityPeriod":3}}}'
}

$response = Invoke-RestMethod -Uri $Url -Method Post -Headers $Headers -Body $Body  

$response | ConvertTo-Json -Depth 5
		

Sample Response

{
	"operation": {
		"result": {
			"message": "Agent key fetched successfully.",
			"status": "Success",
			"statusCode": 20000
		},
		"Details": {
			"agentKey": "3361ddf199e75933",
			"agentKeyEndTime": "28/08/2025 18:14:49"
		},
		"name": "Fetch Agent Key"
	}
}



Top