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, not previously compromised). |
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
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|4UgEk8lXwa1D6rbYO8fqMfKhgnwdRuSqZb4Woz083ad0785fNote: After registration, a verification email is sent to the provided address. However, the user can immediately use the token for authenticated requests - email verification is not required for API access.
Error Handling
For invalid data:
422 Unprocessable Entity
json
{
"message": "The email field must be a valid email address. (and 4 more errors)",
"errors": {
"email": [
"The email field must be a valid email address."
],
"phone": [
"The phone has already been taken."
],
"password": [
"The password field must be at least 8 characters.",
"The password field confirmation does not match."
],
"termsAgreed": [
"The terms agreed field must be accepted."
]
}
}If a user is already authenticated:
403 Forbidden
json
{
"message": "Access denied for authenticated users."
}