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

# Refresh Auth Token

> Refreshes an expired access token using a valid refresh token.

This endpoint as well as `/api/token` will be used in tandem to provide authentication to all of our public endpoints.


## OpenAPI

````yaml POST /api/refresh
openapi: 3.1.0
info:
  title: Cair Health APIs
  description: APIs for the Cair Health platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://forecaster.cairhealth.com
security:
  - bearerAuth: []
paths:
  /api/refresh:
    post:
      description: Refreshes an expired access token using a valid refresh token.
      requestBody:
        description: Refresh token for generating new access token
        content:
          application/json:
            schema:
              type: object
              properties:
                refreshToken:
                  type: string
                  description: Latest refresh token
              required:
                - refreshToken
            example:
              refreshToken: xxxxxxxxxxxxx.xxxxxxxx
        required: true
      responses:
        '200':
          description: Authentication tokens refreshed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                    description: Access token to use in your API request
                  refreshToken:
                    type: string
                    description: Refresh token to refresh your access token
                  expiresAt:
                    type: string
                    format: date-time
                    description: Date and timestamp at which the access token will expire
                  refreshTokenExpiresAt:
                    type: string
                    format: date-time
                    description: Date and timestamp at which the refresh token will expire
              example:
                accessToken: xxxxxxxxxxxxx.xxxxxxxx
                refreshToken: xxxxxxxxxxxxx.xxxxxxxx
                expiresAt: '2025-03-24T18:38:47.781Z'
                refreshTokenExpiresAt: '2025-03-25T18:28:47.781Z'
        '401':
          description: Invalid or expired refresh token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````