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

# Refresh access token

> Obtain a new access token using a refresh token.

**How it works:**
- Provide your refresh token received from the /oauth/token endpoint
- Receive a new Bearer token and optionally a new refresh token
- Use this to maintain long-lived sessions without re-authentication

**Security:**
- Always use HTTPS
- Store refresh tokens securely (encrypted)
- Refresh tokens should be treated as sensitive as passwords




## OpenAPI

````yaml /api-reference/openapi.json post /oauth/refresh
openapi: 3.0.0
info:
  title: Teleship
  description: >

    Teleship is a leading cross-border logistics provider offering seamless
    global commerce solutions through our comprehensive API.


    With Teleship's API, developers can integrate our cross-border shipping
    services, trade engine, and logistics solutions directly into their
    applications.


    **Key Features:**

    - Cross-border shipping solutions for international commerce

    - Real-time shipping rates and delivery estimates

    - End-to-end shipment tracking with detailed status updates

    - Automated customs compliance and product classification

    - Real-time event notifications through webhooks


    **Why Teleship?**

    - API-first: Developer-friendly integration with comprehensive documentation

    - Enterprise-ready: Built for businesses of all sizes

    - Secure: Enterprise-grade security and compliance

    - Integrated: Seamless connection with e-commerce, ERP, and fulfillment
    systems


    Start shipping globally with Teleship's powerful cross-border logistics API.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.teleship.com
security: []
tags: []
paths:
  /oauth/refresh:
    post:
      tags:
        - Authentication
      summary: Refresh access token
      description: |
        Obtain a new access token using a refresh token.

        **How it works:**
        - Provide your refresh token received from the /oauth/token endpoint
        - Receive a new Bearer token and optionally a new refresh token
        - Use this to maintain long-lived sessions without re-authentication

        **Security:**
        - Always use HTTPS
        - Store refresh tokens securely (encrypted)
        - Refresh tokens should be treated as sensitive as passwords
      operationId: refreshToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - refreshToken
              properties:
                refreshToken:
                  type: string
                  description: The refresh token obtained from /oauth/token
                  example: AMf-vBx...
      responses:
        '200':
          description: Refreshed Token Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                    description: New JWT access token for API authentication
                    example: eyJhbGciOiJSUzI1NiIsImtpZCI6...
                  expirationTime:
                    type: number
                    description: New token expiration timestamp
                    example: 1717702808582
                  expiresIn:
                    type: number
                    description: Time until token expiration in milliseconds
                    example: 3600000
                  tokenType:
                    type: string
                    description: Type of token (always Bearer)
                    example: Bearer
                  refreshToken:
                    type: string
                    description: New refresh token (may be rotated)
                    example: AMf-vBx...
        '401':
          description: Invalid or expired refresh token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseMessagesDto'
components:
  schemas:
    ResponseMessagesDto:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ErrorResponseDto'
      required:
        - messages
    ErrorResponseDto:
      type: object
      properties:
        code:
          type: number
        level:
          type: string
          enum:
            - error
            - warning
            - info
          example: error
          description: Error level
          default: error
        timestamp:
          format: date-time
          type: string
          example: '2024-01-01T00:00:00.00Z'
        message:
          type: string
          example: An error occurred
        details:
          example:
            - Missing required field
          type: array
          items:
            type: string
      required:
        - code
        - level
        - timestamp
        - message
        - details

````