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

# Generate Short Token

> Generate a short-lived token (5 minutes) from the current bearer token. Use this to embed authentication context in URLs without exposing the full JWT. The short token can be exchanged back to the original bearer token using the resolve endpoint.



## OpenAPI

````yaml /openapi/public/openapi-tools.json post /short-token/generate
openapi: 3.0.3
info:
  title: MileApp Tools API
  version: 3.0.0
  description: Utility endpoints for secure URL embedding and token management.
  contact:
    name: MileApp Support
    email: support@mile.app
servers:
  - url: https://apiweb.mile.app/api/v3
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Short Token
    description: >-
      Generate and resolve short-lived tokens for secure URL parameter
      embedding. Replaces direct bearer-token embedding to prevent token
      exposure in logs, browser history, and external service trails.
paths:
  /short-token/generate:
    post:
      tags:
        - Short Token
      summary: Generate Short Token
      description: >-
        Generate a short-lived token (5 minutes) from the current bearer token.
        Use this to embed authentication context in URLs without exposing the
        full JWT. The short token can be exchanged back to the original bearer
        token using the resolve endpoint.
      operationId: generateShortToken
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    description: Status of response.
                    type: boolean
                  message:
                    description: Message of API response.
                    type: string
                  data:
                    description: Short token data.
                    type: object
                    properties:
                      shortToken:
                        description: The generated short token string.
                        type: string
                      expiresAt:
                        description: >-
                          Unix timestamp when the short token expires (5 minutes
                          from generation).
                        type: integer
                example:
                  status: true
                  message: Success.
                  data:
                    shortToken: abc123def456ghi789
                    expiresAt: 1705732800
        '400':
          description: Bad Request - Bearer token missing
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    description: Status of response.
                    type: boolean
                  message:
                    description: Message of API response.
                    type: string
                example:
                  status: false
                  message: Bearer token is required
        '401':
          description: Unauthorized - Invalid bearer token
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    description: Status of response.
                    type: boolean
                  message:
                    description: Message of API response.
                    type: string
                example:
                  status: false
                  message: Unauthorized
      deprecated: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````