BREAGEN Logo
User Management Service

Authentication Management

The Authentication Management service handles user authentication, registration, token management, and account verification operations.

Authentication Operations

Activate User Account POST /api/v1/auth/{userId}/active

Resource URL/api/v1/auth/{userId}/active
Response FormatJSON
Requires AuthenticationNo
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequired
userIdID of user to activateYes

Request Body

{
	"verificationCode": "123456"
}

Example Request

curl -X 'POST' \
'https://um.braegen.ai/api/v1/auth/1/active' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '"123456"'

Example Response

{
	"success": true,
	"status": "200 OK",
	"message": "User activated successfully",
	"data": {
		"userId": 1,
		"isActive": true
	}
}

Register New User POST /api/v1/auth/register

Resource URL/api/v1/auth/register
Response FormatJSON
Requires AuthenticationNo
Rate LimitedYes
HTTPSYes

Request Body (multipart/form-data)

FieldTypeRequiredDescription
emailstringYesUser's email address
passwordstringYesUser's password
firstNamestringYesUser's first name
middleNamestringNoUser's middle name
lastNamestringNoUser's last name
phoneNumberstringNoUser's phone number
filebinaryNoProfile picture

Example Request

curl -X 'POST' \
'https://um.braegen.ai/api/v1/auth/register' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected]' \
-F 'password=password123' \
-F 'firstName=John' \
-F 'lastName=Doe' \
-F '[email protected]'

Example Response

{
	"success": true,
	"status": "200 OK",
	"message": "User registered successfully",
	"data": {
		"id": 1,
		"email": "[email protected]",
		"firstName": "John",
		"lastName": "Doe"
	},
	"emailSent": true
}

Refresh Authentication Token POST /api/v1/auth/refresh-token

Resource URL/api/v1/auth/refresh-token
Response FormatJSON
Requires AuthenticationYes (Refresh Token)
Rate LimitedYes
HTTPSYes

Request Body

{
	"refresh_token": "eyJhbGciOiJIUzI1..."
}

Example Request

curl -X 'POST' \
'https://um.braegen.ai/api/v1/auth/refresh-token' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '"eyJhbGciOiJIUzI1..."'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"access_token": "eyJhbGciOiJIUzI1...",
		"refresh_token": "eyJhbGciOiJIUzI1..."
	}
}

Logout User POST /api/v1/auth/logout

Resource URL/api/v1/auth/logout
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'POST' \
'https://um.braegen.ai/api/v1/auth/logout' \
-H 'accept: */*' \
-H 'Authorization: Bearer {token}'

Example Response

{
	"success": true,
	"status": "200 OK",
	"message": "Logged out successfully",
	"data": null
}

Form Authentication POST /api/v1/auth/form-authenticate

Resource URL/api/v1/auth/form-authenticate
Response FormatJSON
Requires AuthenticationNo
Rate LimitedYes
HTTPSYes

Query Parameters

ParameterTypeRequiredDescription
usernamestringYesUser's email/username
passwordstringYesUser's password

Example Request

curl -X 'POST' \
'https://um.braegen.ai/api/v1/auth/[email protected]&password=password123' \
-H 'accept: */*'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"access_token": "eyJhbGciOiJIUzI1...",
		"refresh_token": "eyJhbGciOiJIUzI1..."
	}
}

Authenticate User POST /api/v1/auth/authenticate

Resource URL/api/v1/auth/authenticate
Response FormatJSON
Requires AuthenticationNo
Rate LimitedYes
HTTPSYes

Request Body

{
	"email": "[email protected]",
	"password": "password123"
}

Example Request

curl -X 'POST' \
'https://um.braegen.ai/api/v1/auth/authenticate' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
    "email": "[email protected]",
    "password": "password123"
}'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"access_token": "eyJhbGciOiJIUzI1...",
		"refresh_token": "eyJhbGciOiJIUzI1..."
	}
}

Resend Verification Code GET /api/v1/auth/{userId}/resend-verify-code

Resource URL/api/v1/auth/{userId}/resend-verify-code
Response FormatJSON
Requires AuthenticationNo
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequired
userIdID of user to resend verification codeYes

Example Request

curl -X 'GET' \
'https://um.braegen.ai/api/v1/auth/1/resend-verify-code' \
-H 'accept: */*'

Example Response

{
	"success": true,
	"status": "200 OK",
	"message": "Verification code sent successfully",
	"data": {
		"userId": 1
	},
	"emailSent": true
}

HTTP Response Codes

HTTP CodeMessage
200Success
400Bad Request
401Unauthorized
403Invalid Input
404Invalid or not found type

Common Error Responses

Invalid Credentials

{
	"success": false,
	"status": "401 UNAUTHORIZED",
	"message": "Invalid email or password",
	"data": null
}

Invalid Token

{
	"success": false,
	"status": "401 UNAUTHORIZED",
	"message": "Invalid or expired token",
	"data": null
}

Registration Error

{
	"success": false,
	"status": "400 BAD_REQUEST",
	"message": "Email already registered",
	"data": null
}

Verification Error

{
	"success": false,
	"status": "400 BAD_REQUEST",
	"message": "Invalid verification code",
	"data": null
}