# getPublicKey

> For the complete documentation index, see [llms.txt](https://bsvblockchain.com/docs/llms.txt).

**POST** `/getPublicKey`

Base URL: `http://localhost:3321`

Retrieves the public key

## Body

Content type: `application/json`

- `seekPermission` (boolean)
- `identityKey` (boolean)
- `protocolID` (any[])
- `keyID` (string)
- `privileged` (boolean)
- `privilegedReason` (string)
- `counterparty` (string)
- `forSelf` (boolean)

Example:

```json
{
  "seekPermission": true,
  "identityKey": true,
  "protocolID": [
    null
  ],
  "keyID": "string",
  "privileged": false,
  "privilegedReason": "string",
  "counterparty": "string",
  "forSelf": false
}
```

## Responses

### 200

The public key

- `publicKey` (string)

Example:

```json
{
  "publicKey": "string"
}
```

### 400

Invalid input

### 500

Internal server error