The register endpoint creates a new user account in the Ocha system. On success, the API returns a signed JWT token that can be used immediately to authenticate subsequent requests. Email addresses and display names must each be unique across all accounts; the API validates both before persisting the record.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/floriansalvi/HEIG-VD_Ocha-api/llms.txt
Use this file to discover all available pages before exploring further.
No authentication is required for this endpoint. It is publicly accessible.
POST Path: /api/v1/auth
Request body
The user’s email address. Must be a valid email format. Normalized to lowercase before storage. Must not already be registered.
The user’s password in plain text. Hashed with bcrypt before storage. Must meet all of the following rules:
- Minimum 8 characters
- At least one uppercase letter (A–Z)
- At least one lowercase letter (a–z)
- At least one digit (0–9)
- At least one special character (e.g.
!,@,#,_)
The user’s public display name. Must be between 3 and 30 characters. Only letters, numbers, and underscores (
_) are allowed. Must not already be taken.Optional phone number. Non-digit characters are stripped before validation. The cleaned value must contain at least 8 digits.
Response — 201 Created
Human-readable confirmation. Value:
"User successfully registered".Signed JWT authentication token. Include this in the
Authorization: Bearer <token> header for protected endpoints.Basic profile data for the newly created user.
Error codes
| Status | Meaning | Cause |
|---|---|---|
400 Bad Request | Missing required field | email, password, or display_name is absent or empty |
409 Conflict | Duplicate value | The email or display name is already registered |
422 Unprocessable Entity | Validation failure | Email format is invalid, password does not meet complexity rules, display name contains invalid characters or is out of range, or phone has fewer than 8 digits |
500 Internal Server Error | Unexpected error | An unhandled server-side error occurred |