Session Keys

private/set_session_key

Authorizes a new session key for a wallet from a signed action, granting it a set of on-chain (protocol) scopes and off-chain scopes with an expiry, an optional label, an optional IP allowlist, and an optional list of subaccounts it may act on (defaults to all of the wallet's subaccounts). Send the signed action fields (nonce, signer, signature, signature expiry, and module) alongside the requested scopes; the endpoint returns the registered key's public address and its granted scopes, expiry, allowlist, label, and subaccounts.

post/private/set_session_key

Request

  • Base URL: https://api.derive.xyz/v3
  • URL: https://api.derive.xyz/v3/private/set_session_key
  • Auth: none declared

Request body

expiry_secinteger required
ip_whiteliststring[] nullable
labelstring nullable
noncestring required
offchain_scopesstring[] required

Off-chain scopes which are validated in backend only

protocol_scopesstring[] required

Scopes granted to the session key, validated by the protocol. Each is a string like "trade:orderbook:all".

public_session_keystring required

Session key address being authorized.

signaturestring required

0x-prefixed hex, 65-byte r||s||v.

signature_expiry_secinteger required
signerstring required
subaccount_idsinteger[] nullable
walletstring required

Wallet the session key is being registered for.

Response

Success

expiry_secinteger required
ip_whiteliststring[] required
labelstring nullable
offchain_scopesstring[] required
protocol_scopesstring[] required
public_session_keystring required
subaccount_idsinteger[] required

Subaccounts the key may act on. Empty/omitted request (all subaccounts) is expanded to the wallet's current subaccount list.

Changes

No recorded changes to this operation across all 1 revision of this API.