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 (max 255 chars). Must be unique and valid with DNS verification.
password stringPassword (8–72 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

Returns the token together with the new User Object.

json
{
  "data": {
    "token": "4|gK9jX2mNwZ7vB4fQpR3tYhD8cS5aL1uE0iO6nM9vA3e1f7g2",
    "user": {
      "email": "client@example.com",
      "phone": null,
      "role": "client",
      "firstName": null,
      "lastName": null,
      "billingAddress": null,
      "shippingAddress": null,
      "bankAccount": null,
      "company": null,
      "regions": null,
      "registrationNumber": null,
      "emailVerified": false,
      "newsletterSubscribed": false,
      "testimonyAlerts": null,
      "onboardingStatus": null
    }
  }
}

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 testimonies, creating offers, checkout, accepting offers, completing, cancelling and downloading testimonies and downloading invoices require a verified email — until then those endpoints respond with 403 Forbidden.

Error Handling ​

For invalid data:

422 Unprocessable Content

json
{
  "message": "E-mail musí byť platná e-mailová adresa. (a 3 ďalších chýb)",
  "errors": {
    "email": [
      "E-mail musí byť platná e-mailová adresa."
    ],
    "password": [
      "Heslo musí mať minimálne 8 znakov."
    ],
    "passwordConfirmation": [
      "Hodnota Heslo znova sa musí zhodovať s hodnotou z Heslo."
    ],
    "termsAgreed": [
      "Súhlas s podmienkami musí byť akceptovaný."
    ]
  }
}

If a user is already authenticated:

403 Forbidden

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

In production the message is the generic Forbidden (see Error Responses).

429 Too Many Requests — more than 5 requests per minute from one IP address.