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

# Refresh Token

> Generates a new access token using a valid refresh token.

### Request Body

- **refresh_token** (`string`, required): A valid refresh token obtained from the Login endpoint.
    

### Response

- **status**:
    
    - **code** (`integer`): Status code (`0` indicates success).
        
    - **message** (`string`): Status message.
        
    - **details** (`array`): Additional details.
        
- **access_token**:
    
    - **token** (`string`): New JWT access token.
        
    - **valid_to_time** (`string`): Expiration time of the new access token in ISO 8601 format.



## OpenAPI

````yaml post /takeprofit.partner.external.auth.v1.AuthApi.Refresh
openapi: 3.0.0
info:
  title: TakeProfit Partner API
  description: TakeProfit Partner API documentation
  version: 0.1-beta
servers:
  - url: https://api.dev.tpinf.in
    description: Development environment
  - url: https://api.takeprofit.com
    description: '''Production environment'''
security: []
tags:
  - name: Partner API
  - name: Credentials
    description: >-
      The Credentials API allows partners to authenticate and obtain access
      tokens required for accessing other secured endpoints. This documentation
      provides details on how to use the authentication endpoints, including
      request and response formats.


      ## Overview


      The Authentication API provides two primary endpoints:


      1. **Create Token**: Authenticates a partner using their API key and
      returns an access token and a refresh token.
          
      2. **Refresh Token**: Generates a new access token using a valid refresh
      token.
  - name: Link
    description: >-
      The Link API allows partners to manage the linkage between their own
      securities and the securities provided by TakeProfit. This includes
      creating, retrieving, and deleting links between securities.
  - name: Reference API
    description: Set of APIs to get reference info such as exchanges, securities.
  - name: Marketdata API
    description: Set of APIs to get marketdata such as historical candles
  - name: Widgets
    description: |-
      Describe how to use TakeProfit Backend API from Widgets.

      Each request to API must has 'accesstoken' header with valid JWT-token.

      Describe here how to obtain JWT for widget.
paths:
  /takeprofit.partner.external.auth.v1.AuthApi.Refresh:
    post:
      tags:
        - Credentials
      summary: Refresh Token
      description: >-
        Generates a new access token using a valid refresh token.


        ### Request Body


        - **refresh_token** (`string`, required): A valid refresh token obtained
        from the Login endpoint.
            

        ### Response


        - **status**:
            
            - **code** (`integer`): Status code (`0` indicates success).
                
            - **message** (`string`): Status message.
                
            - **details** (`array`): Additional details.
                
        - **access_token**:
            
            - **token** (`string`): New JWT access token.
                
            - **valid_to_time** (`string`): Expiration time of the new access token in ISO 8601 format.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                refresh_token: YOUR_REFRESH_TOKEN_HERE
      responses:
        '200':
          description: OK
          headers:
            content-type:
              schema:
                type: string
                example: application/json
            grpc-accept-encoding:
              schema:
                type: string
                example: identity,deflate,gzip
            grpc-encoding:
              schema:
                type: string
                example: identity
            date:
              schema:
                type: string
                example: Wed, 30 Oct 2024 12:27:45 GMT
            x-envoy-upstream-service-time:
              schema:
                type: integer
                example: '8'
            access-control-expose-headers:
              schema:
                type: string
                example: grpc-status, grpc-message, x-grpc-details, my-test
            my-little-header:
              schema:
                type: string
                example: my-test
            access-control-allow-origin:
              schema:
                type: string
                example: '*'
            grpc-status:
              schema:
                type: integer
                example: '0'
            grpc-message:
              schema:
                type: string
                example: OK
            content-length:
              schema:
                type: integer
                example: '983'
            server:
              schema:
                type: string
                example: envoy
          content:
            application/json:
              schema:
                type: object
              example:
                status:
                  code: 0
                  message: ''
                  details: []
                access_token:
                  token: VALID_ACCESS_TOKEN
                  valid_to_time: '2024-10-30T12:57:45Z'

````