---
title: "private/edit_session_key"
method: POST
path: "/private/edit_session_key"
tags: ["Session Keys"]
---

# private/edit_session_key

`POST /private/edit_session_key`

## Request

- Base URL: `https://api.derive.xyz/v3`
- URL: `https://api.derive.xyz/v3/private/edit_session_key`
- Auth: API key in header `X-DeriveWallet` and API key in header `X-DeriveTimestamp` and API key in header `X-DeriveSignature`

Updates an existing session key's label, IP allowlist, and/or off-chain scopes for a given wallet; it cannot change on-chain (protocol) scopes, for which you must re-register with private/set_session_key. Editing only the label needs account-info permission, while changing the IP allowlist or off-chain scopes requires admin/owner authorization. Returns the updated session key details.

## Request body

- EditSessionKeyRequest
  - `ip_whitelist` string[], nullable
  - `label` string, nullable: Send `null` to clear the label; omit the field to leave it unchanged.
  - `offchain_scopes` string[], nullable
  - `public_session_key` string, required
  - `wallet` string, required

## Response `200`

Success

- SessionKey
  - `expiry_sec` integer, required
  - `ip_whitelist` string[], required
  - `label` string, required
  - `offchain_scopes` string[], required: Off-chain scopes (read-tier capabilities).
  - `protocol_scopes` string[], required: Protocol-level (on-chain authority) scopes.
  - `public_session_key` string, required
  - `registered_sec` integer, required
  - `subaccount_ids` integer[], required: Subaccounts this key may act on. An empty stored value means "all subaccounts" and is expanded to the wallet's current subaccount list.

## Other responses

- `default`: JSON-RPC error (see Error Codes)

## Changes

- **2026-10-20** `0c500202be49`: 2 info
  - the endpoint scheme security `DeriveWallet AND DeriveTimestamp AND DeriveSignature` was added to the API
  - added the media type `application/json` for the response with the status `default`

[Operation history](https://skmtc.dev/lyra/apis/derive-v3-api/changes/private/edit_session_key/post.md)

---

[API](https://skmtc.dev/lyra/apis/derive-v3-api.md) - [All operations](https://skmtc.dev/lyra/apis/derive-v3-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lyra/apis/derive-v3-api/revisions/415f8a73b10c?raw)
