> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# public/auth

> Authenticate using a Coinbase-issued credential.

**Only `POST` is supported.** Send the JSON-RPC request in the request body; query-string credentials are not accepted.



## OpenAPI

````yaml /api-reference/coinbase-deribit-app-api/adv-starbase-openapi.json post /public/auth
openapi: 3.1.0
info:
  description: Coinbase Retail Advanced Trade API for derivatives trading.
  title: Coinbase Retail Advanced Trade (Deribit) API
  version: 2.1.1
servers:
  - url: https://drb.coinbase.com/api/v2
security: []
tags:
  - description: Can only be used over websockets.
    name: WebSocket Only
  - description: Public methods can be used without authentication.
    name: Public
  - description: >-
      <p>Private methods require authentication. All requests must include a
      valid OAuth2 token.</p>

      <p>A token can be requested using the <a
      href="#public-auth">/public/auth</a> method.</p>

      <p>When using the websockets protocol, the token must be included as a
      parameter <code>access_token</code> in the message. When using REST (HTTP
      GET), the token may also be passed in the <code>Authorization</code>
      header.</p>
    name: Private
  - name: Authentication
  - name: Session Management
  - description: >-
      Subscription works as [notifications](#notifications), so users will
      automatically (after subscribing) receive messages from the server.
      Overview for each channel response format is described in
      [subscriptions](#subscriptions) section.
    name: Subscription Management
  - name: Account Management
  - name: Trading
  - name: Market Data
  - name: Wallet
paths:
  /public/auth:
    post:
      tags:
        - Authentication
        - Public
      description: >-
        Authenticate using a Coinbase-issued credential.


        **Only `POST` is supported.** Send the JSON-RPC request in the request
        body; query-string credentials are not accepted.
      requestBody:
        description: JSON-RPC request body
        required: true
        content:
          application/json:
            examples:
              request:
                description: JSON-RPC Request Example
                value:
                  id: 1
                  jsonrpc: '2.0'
                  method: public/auth
                  params:
                    grant_type: coinbase_cdp
                    token: ...
            schema:
              type: object
              properties:
                id:
                  description: The id that was sent in the request
                  type: integer
                  example: 1
                jsonrpc:
                  description: The JSON-RPC version (2.0)
                  type: string
                  enum:
                    - '2.0'
                method:
                  description: The method name
                  type: string
                  enum:
                    - public/auth
                params:
                  type: object
                  properties:
                    grant_type:
                      description: Coinbase grant type used to authenticate.
                      type: string
                      example: coinbase_cdp
                      enum:
                        - coinbase_cdp
                        - coinbase_oauth2
                    token:
                      description: Coinbase-issued credential matching `grant_type`.
                      type: string
                      example: ...
                  required:
                    - grant_type
                    - token
              required:
                - jsonrpc
                - id
                - method
                - params
      responses:
        '200':
          $ref: '#/components/responses/PublicAuthResponse'
      security: []
components:
  responses:
    PublicAuthResponse:
      description: Success response
      content:
        application/json:
          examples:
            response:
              description: Response example
              value:
                id: 9929
                jsonrpc: '2.0'
                result:
                  access_token: >-
                    a3f8c2e1d4b7f09e5c6a2d8b1e4f7c0a9d3b6e2f5a8c1d4e7b0f3a6c9d2e5f8
                  enabled_features: []
                  expires_in: 3600
                  refresh_token: >-
                    1582628593469.1GP4rQd0.A9Wa78o5kFRIUP49mScaD1CqHgiK50HOl2VA6kCtWa8BQZU5Dr03BhcbXPNvEh3I_MVixKZXnyoBeKJwLl8LXnfo180ckAiPj3zOclcUu4zkXuF3NNP3sTPcDf1B3C1CwMKkJ1NOcf1yPmRbsrd7hbgQ-hLa40tfx6Oa-85ymm_3Z65LZcnCeLrqlj_A9jM
                  scope: >-
                    wallet:user:read wallet:accounts:read
                    wallet:transactions:read wallet:buys:create
                  token_type: bearer
          schema:
            $ref: '#/components/schemas/PublicAuthResponse'
  schemas:
    PublicAuthResponse:
      type: object
      properties:
        id:
          description: The id that was sent in the request
          type: integer
        jsonrpc:
          description: The JSON-RPC version (2.0)
          type: string
          enum:
            - '2.0'
        result:
          type: object
          properties:
            access_token:
              description: >-
                Access token to be used for authentication of subsequent
                requests.
              type: string
              example: 843SehgeX5n6XxEU4XbABx4Cny5Akai5iHiJePTsvUw7
            enabled_features:
              $ref: '#/components/schemas/api_key_features'
            expires_in:
              description: Token lifetime in seconds
              type: integer
              example: 315360000
            google_login:
              description: The access token was acquired by logging in through Google.
              type: boolean
            mandatory_tfa_status:
              description: 2FA is required for privileged methods
              type: string
              example: enabled
            refresh_token:
              description: Can be used to request a new token (with a new lifetime)
              type: string
              example: 6faf8L36JdaSqsjCEEiwqifPpj6JB18RWwiWHrsGTZ91
            scope:
              description: Space-separated list of granted scopes
              type: string
            sid:
              description: Optional Session id
              type: string
            state:
              description: Copied from the input (if applicable)
              type: string
            token_type:
              description: Authorization type, always `bearer`
              type: string
              enum:
                - bearer
          required:
            - access_token
            - token_type
            - expires_in
            - scope
      required:
        - result
        - jsonrpc
    api_key_features:
      description: >-
        List of enabled advanced on-key features.<br><br><b>Available
        options:</b><br>- <code>restricted_block_trades</code>: Limit the
        block_trade read the scope of the API key to block trades that have been
        made using this specific API key<br>- <code>block_trade_approval</code>:
        Block trades created using this API key require additional user
        approval. Methods that use <code>block_rfq</code> scope are not affected
        by Block Trade approval feature
      type: array
      items:
        type: string

````