auth

User registration

Register a new user in Keycloak

post/api/auth/register

Request body

emailstring required

User email address

passwordstring required

User password (min 8 characters)

first_namestring required

User first name

last_namestring required

User last name

phonestring required

User phone number

birth_datestring required

User date of birth (YYYY-MM-DD format, required)

countrystring nullable

User country (optional)

reason_for_registrationstring required

Reason for registration

commercial_communications_consentboolean

Consent to receive commercial and promotional communications

email_verifiedboolean

Whether the email should be marked as verified. Defaults to False so that users must verify their email before accessing the app.

Example request

{
  "birth_date": "1990-01-01",
  "commercial_communications_consent": true,
  "email": "user@example.com",
  "email_verified": false,
  "enabled": true,
  "first_name": "John",
  "last_name": "Doe",
  "password": "SecurePass123!",
  "phone": "+39 333 1234567",
  "reason_for_registration": "WANT_TO_START_JOURNEY",
  "role": "patient"
}

Response

Successful Response

user_idstring required

Created user ID

emailstring required

User email

access_tokenstring required

JWT access token

refresh_tokenstring required

Refresh token

expires_ininteger required

Access token expiration time in seconds

refresh_expires_ininteger required

Refresh token expiration time in seconds

token_typestring

Token type

titlestring

Response title

messagestring

Response message

Example response

{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "email": "user@example.com",
  "expires_in": 300,
  "message": "Utente registrato con successo",
  "refresh_expires_in": 1800,
  "refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "user_id": "123e4567-e89b-12d3-a456-426614174000"
}

Changes