---
openapi: 3.0.1
info:
  title: Trading API v4
  description: APIs related to trading operations
  version: v4
paths:
  /frontoffice/api/v4/access-token:
    post:
      tags:
        - TokenProxyControllerV4
      description: "Refresh access token using the API Token"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BBP.TradingServer.TradingApi.Models.Token.v4.RefreshTokenRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.TradingServer.TradingApi.Models.Token.v4.RefreshTokenResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
        '500':
          description: Internal Server Error
components:
  schemas:
    BBP.Platform.Http.ErrorData:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          $ref: '#/components/schemas/BBP.Platform.Http.ErrorData.ErrorDetails'
      additionalProperties: false
    BBP.Platform.Http.ErrorData.ErrorDetails:
      type: object
      properties:
        source:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        stackTrace:
          type: string
          nullable: true
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.Token.v4.RefreshTokenRequest:
      type: object
      required:
        - token
      properties:
        token:
          type: string
          description: "API Token to use for obtaining a new access token"
          minLength: 1
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.Token.v4.RefreshTokenResponse:
      type: object
      required:
        - accessToken
        - expiresIn
        - tokenType
      properties:
        accessToken:
          type: string
          description: "New access token"
        expiresIn:
          type: integer
          description: "Access token lifetime in seconds"
          example: 3600
        tokenType:
          type: string
          description: "Type of token, e.g. Bearer"
          example: Bearer
      additionalProperties: false
