Skip to main content
cURL
curl --request GET \
  --url https://test.deribit.com/api/v2/public/auth \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 9929,
  "method": "public/auth",
  "params": {
    "grant_type": "client_credentials",
    "client_id": "fo7WAPRm4P",
    "client_secret": "W0H6FJW4IRPZ1MOQ8FP6KMC5RZDUUKXS"
  }
}
'
{
  "jsonrpc": "2.0",
  "id": 9929,
  "result": {
    "access_token": "1582628593469.1MbQ-J_4.CBP-OqOwm_FBdMYj4cRK2dMXyHPfBtXGpzLxhWg31nHu3H_Q60FpE5_vqUBEQGSiMrIGzw3nC37NMb9d1tpBNqBOM_Ql9pXOmgtV9Yj3Pq1c6BqC6dU6eTxHMFO67x8GpJxqw_QcKP5IepwGBD-gfKSHfAv9AEnLJkNu3JkMJBdLToY1lrBnuedF3dU_uARm",
    "expires_in": 31536000,
    "refresh_token": "1582628593469.1GP4rQd0.A9Wa78o5kFRIUP49mScaD1CqHgiK50HOl2VA6kCtWa8BQZU5Dr03BhcbXPNvEh3I_MVixKZXnyoBeKJwLl8LXnfo180ckAiPj3zOclcUu4zkXuF3NNP3sTPcDf1B3C1CwMKkJ1NOcf1yPmRbsrd7hbgQ-hLa40tfx6Oa-85ymm_3Z65LZcnCeLrqlj_A9jM",
    "scope": "connection mainaccount",
    "enabled_features": [],
    "token_type": "bearer"
  }
}

Query Parameters

grant_type
enum<string>
required

Method of authentication

Available options:
client_credentials,
client_signature,
refresh_token
Example:

"client_credentials"

client_id
string
required

Required for grant type `client_credentials` and `client_signature`

Example:

"fo7WAPRm4P"

client_secret
string
required

Required for grant type `client_credentials`

Example:

"W0H6FJW4IRPZ1MOQ8FP6KMC5RZDUUKXS"

refresh_token
string
required

Required for grant type `refresh_token`

timestamp
integer
required

Required for grant type `client_signature`.

Provides time when request has been generated (milliseconds since the UNIX epoch).

signature
string
required

Required for grant type `client_signature`.

It's a cryptographic signature calculated over provided fields using user secret key. The signature should be calculated as an HMAC (Hash-based Message Authentication Code) with `SHA256` hash algorithm.

nonce
string

Optional for grant type `client_signature`.

Delivers user generated initialization vector for the server token.

data
string

Optional for grant type `client_signature`.

Contains any user specific value.

state
string

Will be passed back in the response.

scope
string

Describes type of the access for assigned token.

Possible values:

  • `connection`
  • `session:name`
  • `trade:[read, read_write, none]`
  • `wallet:[read, read_write, none]`
  • `account:[read, read_write, none]`
  • `expires:NUMBER`
  • `ip:ADDR`

Details are elucidated in Access scope

Example:

"connection"

Response

200 - application/json

Success response

jsonrpc
enum<string>
required

The JSON-RPC version (2.0)

Available options:
2.0
result
object
required
id
integer

The id that was sent in the request