---
title: "Generate and Fetch PAM360 Agent Key"
method: POST
path: "/restapi/json/v1/agents/agentkey"
tags: ["Server"]
---

# Generate and Fetch PAM360 Agent Key

`POST /restapi/json/v1/agents/agentkey`

## Request

- Base URL: `https://Hostname:Port`
- URL: `https://Hostname:Port/restapi/json/v1/agents/agentkey`
- Auth: API key in header `AUTHTOKEN`
- TypeScript: <https://skmtc.dev/manageengine/apis/pam360-rest-api/docs/restapi/json/v1/agents/agentkey/post.ts> (a function with typed inputs; its response is checked against the schema)

This API is used to generate a new PAM360 Agent Key which is essential for secure agent-based operations. You can specify the validity period for the agent key in days. The generated key can be used by PAM360 agents for authenticating and establishing secure communication.

## Headers

- `orgName` string

## Request body `application/x-www-form-urlencoded`

- GenerateAgentKeyRequest
  - `INPUT_DATA` object: JSON object containing details for generating an agent key
    - `operation` object
      - `details` object
        - `generateAgentKey` string: Flag to indicate whether to generate an agent key
        - `validityPeriod` integer: Validity period of the generated key in days

## Response `200`

OK

- AgentKeyResponse
  - `operation` object
    - `result` OperationResult
      - `message` string: Result message describing the operation outcome
      - `status` string: Operation status
    - `Details` object
      - `agentKey` string: Generated agent key
      - `agentKeyEndTime` string: Expiration time of the agent key
    - `name` string

---

[API](https://skmtc.dev/manageengine/apis/pam360-rest-api.md) - [All operations](https://skmtc.dev/manageengine/apis/pam360-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/manageengine/apis/pam360-rest-api/revisions/44a47abb4bdb?raw)
