> Solana Developer Platform docs, served as Markdown. The [docs index](https://platform.solana.com/docs.md) lists every page and [llms.txt](https://platform.solana.com/docs/ai/llms.txt) the key ones; [SKILL.md](https://platform.solana.com/SKILL.md) has the rules for building on SDP.

# Get wallet public key

Returns the persisted public key for an exact active walletId. walletId is required (400 without it); an API key with selected wallets gets 404 for a wallet it does not list.

`GET /v1/wallets/public-key`

Resolution is DB-backed only.

Requires an [API key](/docs/developing-with-sdp/authentication) with the `wallets.read` action.

## Query parameters

- **`walletId`** · `string` · required · min length 1 · example `privy_wallet_123`

  Provider wallet ID — the `walletId` field returned by GET /v1/wallets.

## Headers

- **`x-project-id`** · `string` · min length 1 · example `prj_example`

  Required for dashboard sessions. API keys use their assigned project.

## Responses

- **`200`** Wallet public key

  - **`publicKey`** · `string` · required · min length 32 · max length 44 · example `So11111111111111111111111111111111111111112`

    Base58-encoded Solana address.

- **`400`** Bad Request

  - **`error`** · `object` · required

    Standard error payload.

    - **`code`** · `string` · required

      Machine-readable error code.

    - **`message`** · `string` · required

      Human-readable error message.

    - **`details`** · `object`

      Optional error details for debugging.

      - **`*`** · `any`

  - **`meta`** · `object`

    - **`requestId`** · `string` · min length 1 · example `req_example`

      Request identifier for tracing.

- **`401`** Unauthorized

  Same fields as `400`.

- **`403`** Forbidden. Requires the `wallets.read` action: an API key must hold it (a module's `manage` or `execute` also covers its `read`), and a signed-in member's organization role must include it. Without it the error is INSUFFICIENT_PERMISSIONS and `error.details.action` names the action. Any other 403 names its own reason.

  Same fields as `400`.

- **`404`** Not Found

  Same fields as `400`.

- **`409`** Conflict

  Same fields as `400`.

- **`500`** Internal Server Error

  Same fields as `400`.

## Example request

```bash tab="cURL"
curl 'https://api.solana.com/v1/wallets/public-key?walletId=privy_wallet_123' \
  -H "Authorization: Bearer $SDP_API_KEY"
```

```ts tab="TypeScript"
const res = await fetch("https://api.solana.com/v1/wallets/public-key?walletId=privy_wallet_123", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.SDP_API_KEY}`
  }
});
```

```python tab="Python"
import os, requests

r = requests.get("https://api.solana.com/v1/wallets/public-key?walletId=privy_wallet_123",
  headers={"Authorization": f"Bearer {os.environ['SDP_API_KEY']}"})
```

## Example responses

```json tab="200"
{
  "publicKey": "So11111111111111111111111111111111111111112"
}
```

```json tab="403"
{
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Missing action: wallets.read",
    "details": {
      "action": "wallets.read"
    }
  },
  "meta": {
    "requestId": "req_example"
  }
}
```

Error responses use the [standard error shape](/docs/reference/conventions/errors).
