v3

latestOpenAPI 3.0.02026-07-311784111.3 MB
Authentication
Public

Retrieve an OAuth access token, to be used for authentication of 'private' requests.

📖 Related Article: Authentication

Authentication Methods:

Three methods of authentication are supported:

  • client_credentials - Using the client id and client secret that can be found on the API page on the website. This is the simplest method, suitable for server-to-server applications and quick setup.

  • client_signature - Enhanced security method that uses a cryptographic signature instead of sending the client secret directly. You generate an HMAC-SHA256 signature of a string containing a timestamp, a random nonce, and optional data, using your Client Secret as the key. This method requires `client_id`, `timestamp` (current time in milliseconds), `nonce`, `signature`, and optionally a `data` field. Deribit verifies the signature instead of requiring the raw secret. Best for enhanced security, asymmetric key pairs, and avoiding secret transmission. See the Client Signature (WebSocket) guide for detailed signature calculation instructions.

  • refresh_token - Using a refresh token that was received from an earlier invocation. This allows you to obtain a new access token without re-supplying your Client ID and Client Secret. Best for long-lived sessions, token renewal, and avoiding re-authentication.

Response:

The response will contain an access token, expiration period (number of seconds that the token is valid) and a refresh token that can be used to get a new set of tokens.

Try in API console

get/public/auth

Query parameters

grant_type'client_credentials' | 'client_signature' | 'refresh_token' required
Example:client_credentials

Method of authentication

client_idstring required
Example:fo7WAPRm4P

Required for grant type `client_credentials` and `client_signature`

client_secretstring required
Example:W0H6FJW4IRPZ1MOQ8FP6KMC5RZDUUKXS

Required for grant type `client_credentials`

refresh_tokenstring required

Required for grant type `refresh_token`

timestampinteger required

Required for grant type `client_signature`.

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

signaturestring 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.

noncestring

Optional for grant type `client_signature`.

Delivers user generated initialization vector for the server token.

datastring

Optional for grant type `client_signature`.

Contains any user specific value.

statestring

Will be passed back in the response.

scopestring
Example:connection

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

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": 315360000,
    "refresh_token": "6faf8L36JdaSqsjCEEiwqifPpj6JB18RWwiWHrsGTZ91",
    "mandatory_tfa_status": "enabled"
  }
}