Skip to navigation

Open a session

Opens a session from a grant signed by the account owner. The grant’s signature is the authentication, so no token is needed.

The session key named in the grant can then sign in with POST /v1/auth for the granting account and for each listed subaccount, one token per account. A session can trade within its scopes and limits but can never withdraw or transfer funds.

grant is the SessionGrant message exactly as signed, with its camelCase field names. EVM-owned accounts sign it as EIP-712 (signature_type eip712, with the wallet’s current chain as signature_chain_id); Stark-owned accounts sign it as SNIP-12 (snip12) with their main key. Grants naming a builder are accepted from EVM-owned accounts only.

Every limit is stated in the grant: a positive decimal, or none for no cap. markets lists at least one market, * meaning every permitted market. The limits are stored exactly as signed, with no server defaults. The server accepts a number only for the limits it enforces: every other limit must be none, and markets ["*"], or the request returns LIMIT_INVALID. Builder grants follow the same rules. Where the server caps a limit, a value over the cap, or none, returns LIMIT_INVALID. A builder maxFeeRate of zero, with more than 8 decimal places, or over the server cap returns INVALID_GRANT. A grant naming a builder from an account that cannot approve builders yet returns SESSIONS_DISABLED.

A grant from a wallet with no Paradex account opens the account and its first session in one call. The account is deployed when it is first funded. It takes the checks onboarding takes, so it can also answer the onboarding errors below, and it lists no subaccounts. referral_code, marketing_code and utm work as on POST /v2/onboarding and are read only for such a request; they are not part of what the wallet signs, so a grant naming a builder ignores them. A PARADEX-PRIVY-ACCESS-TOKEN header skips the balance check for a verified Privy user’s wallet. Contract wallets cannot open an account this way.

Each grant can be used once: resubmitting it, or another grant with the same nonce, returns NONCE_REUSED. Every grant needs a fresh session key: a key once used by a session, even one revoked or expired, returns SESSION_KEY_IN_USE. The grant must use the field names exactly as defined, each once per object, or it returns INVALID_GRANT. A grant that names a builder also records the builder approval for every listed account; revoking the session later does not revoke that approval.

ErrorMeaning
INVALID_SIGNATUREThe signature is not the account owner’s (a contract wallet’s never is), does not match signature_type, or names an account that cannot be verified.
GRANT_EXPIREDexpiresAt has passed, or issuedAt is outside the accepted window.
INVALID_ENVIRONMENTThe grant is for another environment.
INVALID_CHAINThe grant is for another Paradex chain.
SCOPE_NOT_ALLOWEDA scope is unknown, reserved, or not allowed with a builder.
LIMIT_INVALIDA limit is malformed, missing, not none where the server does not enforce it, over the server ceiling, or the expiry is longer than allowed.
NONCE_REUSEDThe grant or its nonce was already used.
ACCOUNT_NOT_ELIGIBLEThe account or a listed subaccount cannot hold sessions.
INVALID_GRANTThe grant does not match the SessionGrant schema, or its builder maxFeeRate is zero, has more than 8 decimal places or is over the cap.
SESSION_KEY_IN_USEThe session key is, or was, a key of a listed account.
SESSION_LIMIT_REACHEDThe account holds the maximum number of active sessions; revoke one first.
BUILDER_APPROVAL_LIMIT_REACHEDA listed account holds the maximum number of live builder approvals.
BUILDER_APPROVAL_STALEThe builder approval was revoked after this grant was signed, or the grant would change the terms a live session with this builder runs on; revoke the approval first or sign a new grant.
SESSIONS_DISABLEDSessions, or builder approvals for a grant that names a builder, are not enabled for this account.
INVALID_MARKETING_CODEThe grant would open an account and marketing_code is not a known code.
INVALID_REQUEST_PARAMETERThe grant would open an account and marketing_code is not campaign:code, or utm lacks source or campaign.
INSUFFICIENT_MIN_CHAIN_BALANCEThe grant would open an account and the wallet does not hold the minimum balance.
ETHEREUM_ADDRESS_BLOCKEDThe account is blocked, or the grant would open an account and the wallet failed screening.
PARENT_ADDRESS_ALREADY_ONBOARDEDThe wallet that signed already owns a different account.
ONBOARDING_RATE_LIMITED429: too many new accounts; try again later.

Headers

PARADEX-PRIVY-ACCESS-TOKENstringOptional

Used only when the grant opens a new account: a Privy token for the signing wallet skips the balance check

Request

The signed grant
grantobjectRequired
The signed SessionGrant exactly as signed, with its camelCase field names.
signaturestringRequired

The owner’s signature: one 0x-hex r||s||v string for eip712; for snip12 the string ’[“0xr”,“0xs”]’, as orders carry it (a bare [r, s] array is also accepted).

signature_typeenumRequired

eip712 for EIP-191 (EVM-owned) accounts, snip12 for Stark-owned accounts.

Allowed values:
marketing_codestringOptional

Marketing code of the campaign the owner came through. Used only when this grant opens a new account; not signed.

referral_codestringOptional

Referral code of the user who referred the owner. Used only when this grant opens a new account; not signed.

signature_chain_idintegerOptional

The EIP-712 domain chainId the wallet signed with. Required for eip712, ignored for snip12.

utmobjectOptional

UTM tracking parameters. Used only when this grant opens a new account; not signed.

Response

OK
accountslist of stringsOptional

Every account the session can trade: the granting account, then its listed subaccounts.

expires_atintegerOptional
When the session expires, in milliseconds.
grant_idstringOptional

The grant id: the grant’s hash, 0x and 64 hex characters.

Errors

400
Bad Request Error
403
Forbidden Error
429
Too Many Requests Error