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

# Refresh session tokens

> Exchange a valid refresh token for a new access token, socket token, and rotated refresh token. The supplied refresh token is consumed and replaced; an expired or unknown token returns 401.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/auth/refresh
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/auth/refresh:
    post:
      tags:
        - Auth
      summary: Refresh session tokens
      description: >-
        Exchange a valid refresh token for a new access token, socket token, and
        rotated refresh token. The supplied refresh token is consumed and
        replaced; an expired or unknown token returns 401.
      operationId: post_auth_refresh
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthRefreshTokenRequest'
      responses:
        '200':
          description: Token refreshed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthRefreshResponse'
        '400':
          description: Missing refresh token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
        '401':
          description: Invalid, expired, or inactive refresh token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
        '403':
          description: Account disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
components:
  schemas:
    AuthRefreshTokenRequest:
      type: object
      properties:
        refreshToken:
          type: string
          description: >-
            Raw refresh token previously returned by login/refresh; consumed and
            rotated server-side. Expired or unknown tokens return 401.
      required:
        - refreshToken
      additionalProperties: false
      example:
        refreshToken: rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9
    AuthRefreshResponse:
      type: object
      description: >-
        Refresh-token rotation envelope. Adds `socketToken` for
        re-authenticating the realtime socket alongside the new HTTP tokens.
      properties:
        token:
          type: string
        socketToken:
          type: string
        refreshToken:
          type: string
        sessionConfig:
          $ref: '#/components/schemas/AuthSessionConfig'
        user:
          $ref: '#/components/schemas/AuthUserSummary'
      required:
        - token
        - socketToken
        - refreshToken
        - sessionConfig
        - user
      additionalProperties: true
      example:
        token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Zjdi...
        socketToken: st_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
        refreshToken: rt_64d2f9c5e8a1d4e001a0b1c2e6f7a8b9
        sessionConfig:
          enabled: true
          idleTimeoutMinutes: 30
        user:
          id: 5f7b1c2e8a1d4e0012c3b4a5
          email: admin@acme.example
          organizationId: 64a1b2c3d4e5f60012345678
          accessRole: ADMIN
    AuthErrorResponse:
      type: object
      description: >-
        Generic error envelope returned by Auth endpoints. Most paths include
        only `error`; a few add `details`/`code` for diagnostic context.
      properties:
        error:
          type: string
        details:
          type: string
        code:
          type: string
      required:
        - error
      additionalProperties: true
      example:
        error: Invalid or expired token
        code: TOKEN_EXPIRED
    AuthSessionConfig:
      type: object
      description: >-
        Resolved session configuration returned alongside tokens. Mirrors the
        org-level idle-timeout / SSO renewal policy so the client can enforce
        it.
      properties:
        enabled:
          type: boolean
        idleTimeoutMinutes:
          type: number
        tokenExpiryHours:
          type: number
        warningTimeMinutes:
          type: number
        idleTrackingEnabled:
          type: boolean
        ssoSilentRenewalEnabled:
          type: boolean
        ssoFallbackBehavior:
          type: string
        passwordSilentRenewalEnabled:
          type: boolean
        passwordFallbackBehavior:
          type: string
      required:
        - enabled
      additionalProperties: true
      example:
        enabled: true
        idleTimeoutMinutes: 30
        tokenExpiryHours: 8
        warningTimeMinutes: 2
        idleTrackingEnabled: true
        ssoSilentRenewalEnabled: true
        ssoFallbackBehavior: redirect
        passwordSilentRenewalEnabled: false
        passwordFallbackBehavior: logout
    AuthUserSummary:
      type: object
      description: Compact User payload returned with auth tokens.
      properties:
        id:
          type: string
        email:
          type: string
          format: email
        fullName:
          type: string
        organizationId:
          type: string
        workosOrganizationId:
          type: string
        accessRole:
          type: string
        departmentId:
          type: string
        workosUserId:
          type: string
        conversationOpenPreference:
          type: string
      required:
        - id
        - email
        - organizationId
        - accessRole
      additionalProperties: true
      example:
        id: 5f7b1c2e8a1d4e0012c3b4a5
        email: admin@acme.example
        fullName: Acme Admin
        organizationId: 64a1b2c3d4e5f60012345678
        accessRole: ADMIN
        conversationOpenPreference: split

````