Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Manuelfg1985/Proyecto_Final_26/llms.txt

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

This endpoint uses Firestore’s updateDoc to partially or fully update an existing applicant document in the postulantes collection. Only the fields included in the request body are changed — all other fields remain untouched. A valid Bearer token is required; requests without a valid token are rejected by the authMiddleware before reaching the controller.
You only need to include the fields you want to change in the request body. Fields not present in the body will not be modified in Firestore.

Endpoint

MethodPUT
Path/api/postulantes/:id
AuthBearer token required
Content-Typeapplication/json

Path parameters

id
string
required
The Firestore document ID of the applicant to update. This is the same id returned when the record was created or listed.

Request headers

Authorization
string
required
JWT Bearer token. Format: Bearer <token>. Obtain a token from POST /api/auth/login.

Request body

Send any subset of applicant fields you wish to update. All fields are optional for this operation.
name
string
Updated first name of the applicant.
surname
string
Updated last name (surname) of the applicant.
email
string
Updated email address of the applicant.
birthdate
string
Updated date of birth.
telephone
string
Updated contact telephone number.
city
string
Updated city of residence.
province
string
Updated province of residence.
applied_position
string
Updated job position the applicant has applied for.
application_date
string
Updated application submission date.
status
string
Updated application status. Common values: "pending", "reviewed", "accepted", "rejected".

Responses

200 OK

The Firestore document was updated successfully.
{ "message": "User updated successfully" }

401 Unauthorized

Returned when the Authorization header is missing or does not start with Bearer .
{ "message": "Acceso denegado. No se proporcionó un token válido." }

403 Forbidden

Returned when the token is present but invalid or expired.
{ "message": "Token inválido o expirado" }

500 Internal Server Error

Returned when the Firestore updateDoc call fails — for example, if the document ID does not correspond to an existing document or a database error occurs.
{ "message": "Error updating user", "error": "..." }

Example

The following request updates only the status field of the applicant with ID abc123XyZ, leaving all other fields unchanged.

Request

curl -X PUT https://proyecto-final-26-6tn2.vercel.app/api/postulantes/abc123XyZ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"status": "reviewed"}'

Response — 200 OK

{ "message": "User updated successfully" }

Build docs developers (and LLMs) love