Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Esteban-Mendez-j/Proyecto-Docker/llms.txt

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

The Users API provides endpoints for registering new accounts, reading user profile data, updating account details, and deleting users. Most write operations require an authenticated session via the jwtToken cookie. See Authenticate with SearchJobs API for details on how to obtain and send that cookie.

Create a user

Registers a new user account. This endpoint is public — no authentication is required.
POST /api/usuarios/add
Content-Type: application/json
nombre
string
required
The user’s full name. Maximum 50 characters.
correo
string
required
The user’s email address. Must be unique across all accounts. Maximum 100 characters.
contrasena
string
required
The user’s password. Maximum 15 characters. Required on account creation.
telefono
string
The user’s phone number. Must be unique if provided. Maximum 15 characters.
imagen
string
required
URL or path to the user’s profile image. Maximum 255 characters. Required on account creation.
descripcion
string
A short bio or description for the user’s profile. Maximum 400 characters.
roles
string[]
List of roles to assign to the user (e.g., ["ROLE_CANDIDATO"]). The first entry becomes the primary role.
Returns the created user as a UsuarioDTO object with HTTP 201 Created.
idUsuario
number
The numeric ID assigned to the new user.
nombre
string
The user’s full name.
correo
string
The user’s email address.
telefono
string
The user’s phone number.
imagen
string
URL or path to the user’s profile image.
descripcion
string
The user’s bio or description.
roles
string[]
All roles assigned to the user.
fechaRegistro
string
The date the account was created (YYYY-MM-DD).
isActive
boolean
Whether the account is currently active.
curl -X POST https://searchjobs.up.railway.app/api/usuarios/add \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Ana García",
    "correo": "ana@email.com",
    "contrasena": "securepass",
    "telefono": "3001234567",
    "imagen": "https://example.com/img/ana.jpg",
    "roles": ["ROLE_CANDIDATO"]
  }'
Example response (201 Created):
{
  "idUsuario": 101,
  "nombre": "Ana García",
  "correo": "ana@email.com",
  "telefono": "3001234567",
  "imagen": "https://example.com/img/ana.jpg",
  "descripcion": null,
  "roles": ["ROLE_CANDIDATO"],
  "fechaRegistro": "2026-05-16",
  "isActive": true
}

Get the current user’s role

Returns the role of the user associated with the jwtToken cookie. If the cookie is absent or invalid, returns ROLE_INVITADO without an error.
GET /api/usuarios/rol
Authentication: Optional. Send the jwtToken cookie to get the authenticated user’s role.
rolPrincipal
string
The user’s primary role. One of CANDIDATO, EMPRESA, ADMIN, SUPER_ADMIN, or ROLE_INVITADO.
roles
string[]
All roles assigned to the user.
id
number
The authenticated user’s numeric ID. Not present when not authenticated.
curl -b cookies.txt https://searchjobs.up.railway.app/api/usuarios/rol
Example response (authenticated):
{
  "rolPrincipal": "EMPRESA",
  "roles": ["ROLE_EMPRESA"],
  "id": 55
}
Example response (not authenticated):
{
  "rolPrincipal": "ROLE_INVITADO",
  "roles": ["ROLE_INVITADO"]
}

Get current user’s name and profile image

Returns the display name and profile image of the authenticated user. Requires a valid jwtToken cookie.
GET /api/usuarios/datos
Authentication: Required. The jwtToken cookie must be present and valid.
status
number
HTTP status code. 200 on success, 404 if no session is found.
nombre
string
The authenticated user’s full name.
imagen
string
URL or path to the user’s profile image.
curl -b cookies.txt https://searchjobs.up.railway.app/api/usuarios/datos
Example response (authenticated):
{
  "status": 200,
  "nombre": "Ana García",
  "imagen": "https://example.com/img/ana.jpg"
}
Example response (no session):
{
  "status": 404,
  "mensaje": "No ha iniciado sesion"
}

Get a user by ID

Returns full profile data for a specific user by their numeric ID.
GET /api/usuarios/edit/{idUsuario}
Authentication: Required.
idUsuario
number
required
The numeric ID of the user to retrieve.
Returns a UsuarioDTO object. See Create a user for the full list of response fields.
curl -b cookies.txt https://searchjobs.up.railway.app/api/usuarios/edit/101
Example response:
{
  "idUsuario": 101,
  "nombre": "Ana García",
  "correo": "ana@email.com",
  "telefono": "3001234567",
  "imagen": "https://example.com/img/ana.jpg",
  "descripcion": "Desarrolladora frontend",
  "roles": ["ROLE_CANDIDATO"],
  "fechaRegistro": "2026-05-16",
  "isActive": true
}

Update a user

Updates the profile data for an existing user. Send only the fields you want to change alongside any required fields.
PUT /api/usuarios/edit/{idUsuario}
Content-Type: application/json
Authentication: Required.
idUsuario
number
required
The numeric ID of the user to update.
The request body accepts the same fields as Create a user. Fields not included in the request retain their existing values. Returns the updated user’s idUsuario with HTTP 200 OK.
body
number
The numeric ID of the updated user.
curl -b cookies.txt -X PUT https://searchjobs.up.railway.app/api/usuarios/edit/101 \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Ana García López",
    "correo": "ana@email.com",
    "imagen": "https://example.com/img/ana-new.jpg"
  }'
Example response:
101

Delete a user

Permanently removes a user from the system. Returns no body on success.
DELETE /api/usuarios/delete/{idUsuario}
Authentication: Required.
idUsuario
number
required
The numeric ID of the user to delete.
Returns HTTP 204 No Content on success.
curl -b cookies.txt -X DELETE https://searchjobs.up.railway.app/api/usuarios/delete/101

Logout

Invalidates the current session and clears authentication cookies. See Logout in the authentication guide for the full reference.
POST /api/usuarios/cerrarSesion
curl -b cookies.txt -X POST https://searchjobs.up.railway.app/api/usuarios/cerrarSesion
Example response:
{
  "status": 401,
  "mensaje": "Sesión Cerrada"
}

Build docs developers (and LLMs) love