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 creates a new applicant document in the Firestore postulantes collection. The request body is validated through the User model class, which sets default values for application_date (current date/time) and status ("pending") if they are not provided. The Firestore document id is auto-generated by Firebase. A valid Bearer token is required — unauthenticated requests will be rejected by the authMiddleware.
You must obtain a valid JWT token before calling this endpoint. Send a POST request to /api/auth/login with your credentials to receive a token, then include it in the Authorization header as Bearer <token>.

Endpoint

MethodPOST
Path/api/postulantes
AuthBearer token required
Content-Typeapplication/json

Request headers

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

Request body

name
string
required
First name of the applicant.
surname
string
required
Last name (surname) of the applicant.
email
string
required
Email address of the applicant.
birthdate
string
required
Date of birth of the applicant. Recommended format: "YYYY-MM-DD".
telephone
string
required
Contact telephone number of the applicant.
city
string
required
City of residence of the applicant.
province
string
required
Province of residence of the applicant.
applied_position
string
required
Job position the applicant is applying for.
application_date
string
Date and time the application was submitted. Defaults to the current date/time at the moment the record is created if omitted.
status
string
Initial status of the application. Defaults to "pending" if omitted.

Responses

201 Created

The applicant was successfully stored in Firestore. The response echoes back all fields that were written (excluding the auto-generated id).
{
  "message": "User created successfully",
  "data": {
    "name": "María",
    "surname": "González",
    "email": "[email protected]",
    "birthdate": "1990-05-15",
    "telephone": "+54 11 1234-5678",
    "city": "Buenos Aires",
    "province": "Buenos Aires",
    "applied_position": "Frontend Developer",
    "application_date": "2024-06-01T10:30:00.000Z",
    "status": "pending"
  }
}

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 write operation fails.
{ "message": "Error creating user", "error": "..." }

Example

Request

curl -X POST https://proyecto-final-26-6tn2.vercel.app/api/postulantes \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "María",
    "surname": "González",
    "email": "[email protected]",
    "birthdate": "1990-05-15",
    "telephone": "+54 11 1234-5678",
    "city": "Buenos Aires",
    "province": "Buenos Aires",
    "applied_position": "Frontend Developer"
  }'

Response — 201 Created

{
  "message": "User created successfully",
  "data": {
    "name": "María",
    "surname": "González",
    "email": "[email protected]",
    "birthdate": "1990-05-15",
    "telephone": "+54 11 1234-5678",
    "city": "Buenos Aires",
    "province": "Buenos Aires",
    "applied_position": "Frontend Developer",
    "application_date": "2024-06-01T10:30:00.000Z",
    "status": "pending"
  }
}

Build docs developers (and LLMs) love