Authenticate with a password-protected short URL to receive a JWT access token. This token is required to manage the URL (change password, delete, pause, view details, etc.).
The endpoint looks up the URL code in the database
Verifies that the URL has a password set (rejects unprotected URLs)
Validates the provided password against the stored hash (using PBKDF2-SHA256)
Generates a JWT token containing the URL’s database ID
Returns the access token with a default expiration time
Token Expiration: Access tokens expire after the configured TOKEN_EXPIRE duration (default: 5 minutes). Use the /refresh_token endpoint to obtain a new token before expiration.
Once you receive the access token, include it in subsequent authenticated requests:
curl -X GET https://api.example.com/details \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
This endpoint only works for password-protected URLs. If you try to login to a URL that was created without a password (empty url_pass), you’ll receive a 400 Bad Request error.