Authentication
Public

Generates a token for a new named session. This method can be used only with session scoped tokens.

Rules:

  • The refresh token must have session scope; a connection scope refresh token is rejected with -32602 on refresh_token.
  • session_name longer than 64 bytes is truncated (not rejected). The truncated name must differ from the current session name, otherwise the call fails with -32602 on session_name.
  • The forked session keeps the scope of the original token with only the session name replaced, and receives a fresh access token and refresh token.
  • Unlike public/auth and public/exchange_token, the forked access token is not installed on the current WebSocket connection: the connection keeps its current authentication until you authenticate it with the new token.
  • An invalid, expired or already-replaced refresh token returns -32602 on refresh_token; session_not_found means the session of the token no longer exists.

📖 More Details: Fork and Exchange Tokens

Try in API console

get/public/fork_token

Request

  • Base URL
    https://test.deribit.com/api/v2
  • URL
    https://test.deribit.com/api/v2/public/fork_token
  • Auth
    none declared

Query parameters

refresh_tokenstring required
Example:1568800656974.1CWcuzUS.MGy49NK4hpTwvR1OYWfpqMEkH4T4oDg4tNIcrM7KdeyxXRcSFqiGzA_D4Cn7mqWocHmlS89FFmUYcmaN2H7lNKKTnhRg5EtrzsFCCiuyN0Wv9y-LbGLV3-Ojv_kbD50FoScQ8BDXS5b_w6Ir1MqEdQ3qFZ3MLcvlPiIgG2BqyJX3ybYnVpIlrVrrdYD1-lkjLcjxOBNJvvUKNUAzkQ

Refresh token

session_namestring required
Example:forked_session_name

Name of the new session (truncated to 64 bytes). Must differ from the current session name.

Response

Success response

jsonrpc'2.0' required

The JSON-RPC version (2.0)

idinteger

The id that was sent in the request

Example response

{
  "result": {
    "access_token": "843SehgeX5n6XxEU4XbABx4Cny5Akai5iHiJePTsvUw7",
    "expires_in": 900,
    "refresh_token": "6faf8L36JdaSqsjCEEiwqifPpj6JB18RWwiWHrsGTZ91"
  }
}

Changes

No recorded changes to this operation across all 11 revisions of this API.