Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CLINTONARMANDO/apiregistropendientes/llms.txt

Use this file to discover all available pages before exploring further.

The API uses stateless JWT authentication. Every protected endpoint requires an Authorization: Bearer <token> header. Obtain a token by calling POST /auth with your employee DNI and password, then include it in all subsequent requests.

POST /auth

Authenticate an employee and receive a signed JWT token along with the full user object.

Request body

dni
string
required
The employee’s national identity number (DNI). Used as the unique login identifier.
password
string
required
The employee’s password in plain text. Transmitted over HTTPS.

Response — 200 OK

token
string
required
Signed JWT. Include this value in the Authorization header of every subsequent request as Bearer <token>.
nombre
string
Full name of the authenticated employee.
email
string
Email address of the authenticated employee.
rol
string
The role identifier string assigned to this user (e.g., ADMIN, TECNICO).

Error responses

StatusCause
401 UnauthorizedDNI not found in the system
401 UnauthorizedPassword does not match
401 UnauthorizedAccount exists but vigente is false
Inactive employees (vigente: false) cannot log in even if their credentials are correct. Contact your system administrator to reactivate the account.

Examples

curl --request POST \
  --url https://api.example.com/auth \
  --header 'Content-Type: application/json' \
  --data '{
    "dni": "12345678",
    "password": "s3cr3tP@ss"
  }'
Successful response:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "nombre": "María López",
  "email": "maria.lopez@empresa.com",
  "rol": "ADMIN"
}

GET /auth/validar-token

Verify that a JWT token is still valid and retrieve the associated user object. Use this endpoint to check session status or re-hydrate user data on application load.

Request headers

Authorization
string
required
The bearer token obtained from POST /auth. Format: Bearer <token>.

Response — 200 OK

Returns the plain string "Token válido y usuario activo" when the token is valid and the associated user account is active.

Error responses

StatusCause
401 UnauthorizedToken is missing, malformed, or expired
401 UnauthorizedUser account was deactivated after token was issued
Call this endpoint at app startup rather than decoding the JWT client-side. It confirms the user’s account is still active in addition to verifying the token signature.

Examples

curl --request GET \
  --url https://api.example.com/auth/validar-token \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'

Build docs developers (and LLMs) love