Verify User's Email
Verifies a user’s email address. A verification email is sent upon registration with a link that must be clicked to confirm.
HTTP Request
POST /api/v1/auth/email/verify/:userId/:hash
| Parameter | Description |
|---|---|
userId string | Unique identifier for the user |
hash string | Verification hash received in the email link |
The URL is signed: it must be called exactly as it appears in the email, including its expires and signature query parameters. The request has no body and needs no Authorization header.
Response
204 No Content
Indicates the email was verified successfully. The call is idempotent — an address that is already verified answers 204 No Content as well.
Frontend Integration
When the user clicks the verification link, they are redirected to your frontend. Your app should:
- Capture the
urlparameter from the query string. - Make a
POSTrequest to that URL to verify the email. - If the response is
204 No Content, inform the user of successful verification. - Handle potential errors (
403 Forbidden,422 Unprocessable Content) — see below.
Example Verification Link
https://your-app.com/auth/verify-email?url={verificationUrl}Replace {verificationUrl} with the URL from the email.
Example Verification URL
https://your-app.com/auth/verify-email?url=https%3A%2F%2Fapi.brunago.sk%2Fapi%2Fv1%2Fauth%2Femail%2Fverify%2F01J5X3Y8ZK2Q4R6T8V0W2X4Y6Z%2F973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b%3Fexpires%3D1715821904%26signature%3D20db38a62ea793d49a07cb04f330d028676a489e81bbb282e30c03c6596eb936Example Password Reset Link
https://your-app.com/auth/reset-password?token=2f6cb81e40a9f0d203cb60119022db8754444a9a9b02eef31adee79403dede3c&email=pavol.paska%40gmail.com(The origin is the backend's FRONTEND_URL; the /auth/verify-email and /auth/reset-password paths are configured there as FRONTEND_VERIFY_EMAIL_PATH and FRONTEND_RESET_PASSWORD_PATH.)
Error Handling
422 Unprocessable Content — the link does not match any user, or the hash does not match the user's current email address (for example after the address was changed again):
{
"message": "Overovací odkaz je neplatný."
}403 Forbidden — the signature is missing or invalid, or the link has expired (links are valid for 60 minutes). Offer the user to resend the verification email.
{
"message": "Invalid signature."
}In production the message is the generic Forbidden (see Error Responses).