Skip to content

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

AttributeDescription
email stringEmail address. Must be unique and valid with DNS verification.
password stringPassword (min. 8 chars, must include letters and numbers).
passwordConfirmation stringMust match password.
newsletterSubscribed booleanSubscribe to newsletters (true or false).
termsAgreed booleanMust be true to accept terms of service.
turnstileToken stringCloudflare Turnstile verification token.

Example Request ​

json
{
  "email": "client@example.com",
  "password": "SecurePass123",
  "passwordConfirmation": "SecurePass123",
  "newsletterSubscribed": false,
  "termsAgreed": true
}

Response ​

201 Created

json
{
  "data": {
    "token": "4|gK9jX2mNwZ7vB4fQpR3tYhD8cS5aL1uE0iO6nM9vA3e1f7g2"
  }
}

The token is a Bearer token that must be included in the Authorization header for all authenticated requests:

plaintext
Authorization: Bearer 3|4UgEk8lXwa1D6rbYO8fqMfKhgnwdRuSqZb4Woz083ad0785f

Note: 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

json
{
  "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

json
{
  "message": "Access denied for authenticated users."
}