Skip to main content
GET
/
refresh_token
Refresh Token
curl --request GET \
  --url https://api.example.com/refresh_token
{
  "access_token": "<string>",
  "token_type": "<string>"
}
This endpoint allows you to obtain a new access token without re-authenticating with your password. You must provide a valid (but possibly soon-to-expire) Bearer token.
This endpoint requires authentication. Include a valid Bearer token in the Authorization header.

Authentication

This endpoint uses HTTPBearer security. Include the access token you want to refresh:
Authorization: Bearer <access_token>

Response

access_token
string
The newly generated access token (JWT)
token_type
string
The token type, always “bearer”

Status Codes

  • 200: New token generated successfully
  • 404: Invalid or expired token (cannot refresh)
  • 403: Invalid or expired token

Requirements

This endpoint only works for protected short URLs (URLs created with a password). The following conditions must be met:
  • The Bearer token must be valid and not expired
  • The URL associated with the token must exist
  • The URL must have a password set (password-protected URLs only)

How It Works

  1. Validates the provided Bearer token
  2. Retrieves the URL code from the token
  3. Verifies the URL exists and has a password
  4. Generates a new access token with a fresh expiration time
  5. Returns the new token
curl -X GET https://api.example.com/refresh_token \
  -H "Authorization: Bearer <access_token>"

Token Lifecycle

  • Tokens expire after a configured period (default: 5 minutes)
  • Use this endpoint to refresh before expiration
  • The new token will have a fresh expiration time
  • You can use the new token for all authenticated endpoints

Build docs developers (and LLMs) love