Skip to navigation

Set a session's IP allowlist

Owner’s main-key session only. Replaces the list on every account the session covers; allowed_cidrs is required, and an empty list lifts the restriction. Requests made with the session, and its sign-ins, from an IP outside a non-empty list are refused: 403 IP_NOT_ALLOWED over REST, permission denied over the websocket. Takes effect within seconds. Open websockets from an IP outside a non-empty list are closed with code 4035, which runs their cancel-on-disconnect. A 5xx means the list may be stored but not announced; repeat the request.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

grant_idstringRequired
Grant id

Request

Replacement CIDR list
allowed_cidrslist of stringsOptional

Full replacement list. Empty = unrestricted.

Response

OK
accountslist of stringsOptional
allowed_cidrslist of stringsOptional

The owner-set IP allowlist (CIDRs). Requests made with the session, and its sign-ins, from any other IP are refused with IP_NOT_ALLOWED. Empty means no restriction. Not part of the signed grant.

builderobjectOptional

The approved builder; null for a grant without one.

expires_atintegerOptional
Expiry in milliseconds.
grant_idstringOptional
issued_atintegerOptional
When the owner signed the grant, in milliseconds.
labelstringOptional
The label the front end chose when it asked for the grant.
limitsobjectOptional
open_order_countintegerOptional

Resting orders and untriggered stops this session placed, for display only: a revoke with cancel_orders also ends its TWAPs and open RFQs, which this leaves out. On the first page of GET /v2/sessions only, for an active or revoked session. Omitted for an expired session, on a later page, and whenever the count is unknown (the feature is off for the account, or the orders could not all be read), so a missing count never reads as zero.

passkey_credential_idstringOptional

The WebAuthn credential id of the passkey that opened the session, as GET /v2/passkeys lists it; omitted for any other source. Revoking that passkey revokes the session and stops it opening another.

revoked_atintegerOptional

Revocation time in milliseconds; 0 while not revoked.

scopeslist of stringsOptional
sourceenumOptional

What opened the session: an app, a builder, an API client or a passkey.

Allowed values:
stateenumOptional
Allowed values:

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error