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

# Refresh Token

> Exchange refresh token for new access token.

This endpoint accepts both SDK and Developer refresh tokens and returns
a new access token of the same type. Implements refresh token rotation:
the old refresh token is revoked and a new one is issued.

Args:
    payload: Request containing the refresh token
    db: Database session

Returns:
    TokenResponse with new access token and new refresh token

Raises:
    401: If the refresh token is invalid or revoked



## OpenAPI

````yaml https://api.openwearables.io/openapi.json post /api/v1/token/refresh
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/token/refresh:
    post:
      tags:
        - 'External: Token'
      summary: Refresh Token
      description: |-
        Exchange refresh token for new access token.

        This endpoint accepts both SDK and Developer refresh tokens and returns
        a new access token of the same type. Implements refresh token rotation:
        the old refresh token is revoked and a new one is issued.

        Args:
            payload: Request containing the refresh token
            db: Database session

        Returns:
            TokenResponse with new access token and new refresh token

        Raises:
            401: If the refresh token is invalid or revoked
      operationId: refresh_token_api_v1_token_refresh_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefreshTokenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RefreshTokenRequest:
      properties:
        refresh_token:
          type: string
          title: Refresh Token
      type: object
      required:
        - refresh_token
      title: RefreshTokenRequest
      description: Request to exchange refresh token for new access token.
    TokenResponse:
      properties:
        access_token:
          type: string
          title: Access Token
        token_type:
          type: string
          title: Token Type
          default: bearer
        refresh_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Refresh Token
        expires_in:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expires In
      type: object
      required:
        - access_token
      title: TokenResponse
      description: Token response with optional refresh token.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````