The Auth API handles all identity operations: creating new accounts, exchanging credentials for a JWT token pair, rotating tokens, invalidating sessions, and retrieving the currently authenticated user’s profile. All protected endpoints expect aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JorLOrT/rappi2/llms.txt
Use this file to discover all available pages before exploring further.
Bearer token in the Authorization header.
POST /api/auth/register
Create a new user account. If norol_id is provided the account is assigned the default Cliente role and a linked Cliente record is created automatically.
Authentication: none required.
Request body
Unique username. Maximum 50 characters.
Unique email address.
Plain-text password. Hashed with bcrypt before storage.
Display name used for the auto-created
Cliente record. Defaults to username when omitted.Phone number stored on the
Cliente record. Only used when the assigned role is Cliente.ID of the role to assign. Defaults to the
Cliente role when omitted.National ID / CC stored on the
Cliente record. Only used when the assigned role is Cliente.Response — 201 Created
Returns aUsuarioResponse object.
Auto-incremented user ID.
Username chosen at registration.
Email address.
ID of the assigned role.
ID of the linked
Cliente record, or null for non-client roles.Whether the account is active. Always
true on creation.ISO 8601 timestamp of account creation.
Embedded role object including its permissions.
POST /api/auth/login
Exchange credentials for a JWT token pair.This endpoint uses
application/x-www-form-urlencoded encoding (OAuth2 password flow), not JSON. Send username and password as form fields, not a JSON body.Request body (form-encoded)
The account username.
The account password.
Response — 200 OK
Short-lived JWT for authenticating API requests. Send as
Authorization: Bearer <token>.Long-lived opaque token for obtaining a new token pair via
/api/auth/refresh.Always
"bearer".Lifetime of the access token in seconds.
POST /api/auth/refresh
Exchange a valid refresh token for a new token pair. The submitted refresh token is immediately revoked and replaced with a new one (token rotation). Authentication: none required (the refresh token itself is the credential).Request body
A non-revoked, non-expired refresh token previously issued by
/api/auth/login or this endpoint.Response — 200 OK
Returns a newTokenPair identical in shape to the login response.
New short-lived JWT.
New long-lived refresh token. The previously submitted token is revoked.
Always
"bearer".Lifetime of the new access token in seconds.
POST /api/auth/logout
Revoke a refresh token to invalidate the session. The corresponding access token continues to work until it naturally expires; revoke it client-side by discarding it. Authentication: none required (submitting the token to revoke is sufficient).Request body
The refresh token to revoke. If it is already revoked or not found the request still returns success.
Response — 200 OK
GET /api/auth/me
Return the full profile of the currently authenticated user, including the embedded role and its permissions. Authentication:Bearer token required.
Response — 200 OK
Returns aUsuarioResponse object. See the register response fields above for the full field list.