private/set_session_key
Changed onAuthorizes 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.
Request
- Base URLhttps://api.derive.xyz/v3
- AuthAPI key in header X-DeriveWallet and API key in header X-DeriveTimestamp and API key in header X-DeriveSignature
Request body
Request parameters for registering a scoped session key. Address fields are 0x-prefixed hex strings.
Off-chain scopes which are validated in backend only
Scopes granted to the session key, validated by the protocol. Each is a string like "trade:orderbook:all".
Session key address being authorized.
0x-prefixed hex, 65-byte r||s||v.
Wallet the session key is being registered for.
Response
Success
Subaccounts the key may act on. Empty/omitted request (all subaccounts) is expanded to the wallet's current subaccount list.
Changes
- info
the endpoint scheme security
DeriveWallet AND DeriveTimestamp AND DeriveSignaturewas added to the API - info
added the media type
application/jsonfor the response with the status
- info