The Auth service handles user registration, login, session management, and credential operations. Its base URL is configured via REACT_APP_AUTH_API_BASE_URL (default: https://api.makakoo.com/ma-authentication-ms/v1/api).
All requests require the Api-Key header. Endpoints that operate on an authenticated session also require Authorization: Bearer <token>.
Login
Authenticate a user with username and password. Returns access and refresh tokens.
Request headers: Api-Key
The user’s email address or phone number.
curl -X POST https://api.makakoo.com/ma-authentication-ms/v1/api/oauth/token \
-H "Content-Type: application/json" \
-H "Api-Key: <your_api_key>" \
-d '{"username": "[email protected]", "password": "secret"}'
data.attributes.accessToken
Short-lived JWT used to authenticate subsequent requests.
data.attributes.refreshToken
Long-lived token used to obtain a new access token when the current one expires.
The authenticated user’s email address.
data.attributes.firstName
The user’s first name.
Rate limiting: Login attempts are rate-limited per username. Exceeding the limit returns 429 Too Many Requests.
Register
Create a new user account. Depending on the registration method, the response may indicate that account activation is required before the user can log in.
Request headers: Api-Key
Email address or phone number for the new account.
Password for the new account.
Registration method. Use "phone" for phone-based registration; omit or use "email" for email-based registration.
curl -X POST https://api.makakoo.com/ma-authentication-ms/v1/api/users \
-H "Content-Type: application/json" \
-H "Api-Key: <your_api_key>" \
-d '{"username": "[email protected]", "password": "secret"}'
On success without activation required — returns 200 with tokens (same shape as Login).
On success with activation required — returns 201:
The new user’s ID. Pass this to the account activation endpoints.
201 when activation is required.
Human-readable message describing the next step.
true when the account must be activated before logging in.
Rate limiting: Registration attempts are rate-limited per username.
Activate Account (Email)
POST /users/{userId}/activate/email
Activate a newly registered account using the 6-digit verification code sent by email.
Request headers: Api-Key
The user ID returned from the registration response.
The 6-digit verification code from the activation email.
Response: Returns tokens and user data in the same shape as the Login response.
Activate Account (Phone)
POST /users/{userId}/activate/phone
Activate a newly registered account using the 6-digit verification code sent by SMS.
Request headers: Api-Key
The user ID returned from the registration response.
The 6-digit verification code from the SMS.
Response: Returns tokens and user data in the same shape as the Login response.
Resend Activation Code
POST /users/{userId}/resend_activation
Resend the activation code to the user’s email or phone.
Request headers: Api-Key
The user ID returned from the registration response.
Logout
Revoke the current access token, effectively ending the session.
Request headers: Api-Key, Authorization: Bearer <token>
curl https://api.makakoo.com/ma-authentication-ms/v1/api/oauth/token/revoke \
-H "Api-Key: <your_api_key>" \
-H "Authorization: Bearer <access_token>"
Response: 200 OK. If the token was already expired, returns 401 — in both cases, clear locally stored tokens.
Refresh Token
POST /oauth/token/refresh
Exchange a refresh token for a new access token and refresh token pair.
Request headers: Api-Key
The refresh token from a previous login or refresh response.
curl -X POST https://api.makakoo.com/ma-authentication-ms/v1/api/oauth/token/refresh \
-H "Content-Type: application/json" \
-H "Api-Key: <your_api_key>" \
-d '{"refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..."}'
Response: Returns the same shape as Login with new accessToken and refreshToken values.
Check Token Info
Verify that an access token is valid and retrieve its associated claims.
Request headers: Api-Key, Authorization: Bearer <token>
curl https://api.makakoo.com/ma-authentication-ms/v1/api/oauth/token/info \
-H "Api-Key: <your_api_key>" \
-H "Authorization: Bearer <access_token>"
Response: 200 OK with token claims on success, 401 Unauthorized if expired or invalid.
Validate Email
GET /users/validate/email
Check whether an email address is valid and available for registration.
Request headers: Api-Key
The email address to validate.
true if the email address is syntactically valid.
true if an account with this email address already exists.
Rate limiting: Validation requests are rate-limited per address.
Validate Phone
GET /users/validate/phone
Check whether a phone number is valid and available for registration.
Request headers: Api-Key
The phone number without country code.
The country calling code (e.g., "1" for US/Canada, "44" for UK).
true if the phone number is valid.
true if an account with this phone number already exists.
Request Password Reset
POST /users/password/reset_request
Send a password reset email to the specified address.
Request headers: Api-Key
The email address associated with the account.
curl -X POST https://api.makakoo.com/ma-authentication-ms/v1/api/users/password/reset_request \
-H "Content-Type: application/json" \
-H "Api-Key: <your_api_key>" \
-d '{"email": "[email protected]"}'
Response: 200 OK. The response does not confirm whether the email exists to prevent enumeration.
Rate limiting: Password reset requests are rate-limited per email address.
Reset Password with Token
POST /users/password/reset
Set a new password using the reset token from the password reset email. Does not require an existing session.
Request headers: Api-Key
The user’s email address.
The reset token from the password reset email.
Change Password (Authenticated)
POST /users/password/change
Change the password for the currently authenticated user.
Request headers: Api-Key, Authorization: Bearer <token>