Register Client
Registers a new client and returns an authentication token.
Bot Protection
This endpoint requires a valid Cloudflare Turnstile token when bot protection is enabled. See the Turnstile Integration Guide for frontend setup instructions.
HTTP Request
POST /api/v1/auth/register/client
| Attribute | Description |
|---|---|
email string | Email address. Must be unique and valid with DNS verification. |
password string | Password (min. 8 chars, must include letters and numbers). |
passwordConfirmation string | Must match password. |
newsletterSubscribed boolean | Subscribe to newsletters (true or false). |
termsAgreed boolean | Must be true to accept terms of service. |
turnstileToken string | Cloudflare Turnstile verification token. |
Example Request
{
"email": "client@example.com",
"password": "SecurePass123",
"passwordConfirmation": "SecurePass123",
"newsletterSubscribed": false,
"termsAgreed": true
}Response
201 Created
{
"data": {
"token": "4|gK9jX2mNwZ7vB4fQpR3tYhD8cS5aL1uE0iO6nM9vA3e1f7g2"
}
}The token is a Bearer token that must be included in the Authorization header for all authenticated requests:
Authorization: Bearer 3|4UgEk8lXwa1D6rbYO8fqMfKhgnwdRuSqZb4Woz083ad0785fNote: After registration, a verification email is sent to the provided address. The token works immediately for most endpoints, but creating offers, checkout, accepting offers, completing, cancelling and downloading testimonies require a verified email — until then those endpoints respond with
403 Forbidden.
Error Handling
For invalid data:
422 Unprocessable Entity
{
"message": "E-mail musí byť platná emailová adresa. (a 3 ďalších chýb)",
"errors": {
"email": [
"E-mail musí byť platná emailová adresa."
],
"password": [
"Heslo musí mať minimálne 8 znakov.",
"Musíte potvrdiť Heslo."
],
"termsAgreed": [
"Súhlas s podmienkami musí byť akceptovaný."
]
}
}If a user is already authenticated:
403 Forbidden
{
"message": "Access denied for authenticated users."
}