> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/CKoldo/Vacaciones-front/llms.txt
> Use this file to discover all available pages before exploring further.

# Personal API

> Endpoints for listing, creating, and deleting employee (personal) records.

The Personal API manages the employee roster. Each employee record holds identifying information and a hire date that is used to calculate their vacation period.

<Note>
  All endpoints require a valid `Authorization: Bearer <token>` header. See [Authentication](/api/authentication) for details.
</Note>

***

## List employees

Returns all employee records stored in the system.

### `GET /api/personal`

**No request body.**

**Response** — `Personal[]`

<ResponseField name="id" type="string" required>
  Unique identifier for the employee.
</ResponseField>

<ResponseField name="nombre" type="string" required>
  First name.
</ResponseField>

<ResponseField name="apellido" type="string" required>
  Last name.
</ResponseField>

<ResponseField name="email" type="string" required>
  Email address.
</ResponseField>

<ResponseField name="puesto" type="string" required>
  Job title or position.
</ResponseField>

<ResponseField name="fechaIngreso" type="string" required>
  Hire date as an ISO 8601 date string (e.g. `"2024-03-15"`). The vacation period begins one year after this date.
</ResponseField>

<CodeGroup>
  ```bash Request theme={null}
  curl http://localhost:5175/api/personal \
    -H "Authorization: Bearer <token>"
  ```

  ```json Response theme={null}
  [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "nombre": "María",
      "apellido": "González",
      "email": "maria.gonzalez@empresa.com",
      "puesto": "Desarrolladora",
      "fechaIngreso": "2023-06-01"
    }
  ]
  ```
</CodeGroup>

***

## Create an employee

Creates a new employee record.

### `POST /api/personal`

<ParamField body="id" type="string" required>
  Client-generated UUID for the employee.
</ParamField>

<ParamField body="nombre" type="string" required>
  First name.
</ParamField>

<ParamField body="apellido" type="string" required>
  Last name.
</ParamField>

<ParamField body="email" type="string" required>
  Email address.
</ParamField>

<ParamField body="puesto" type="string" required>
  Job title or position.
</ParamField>

<ParamField body="fechaIngreso" type="string" required>
  Hire date in ISO 8601 format (e.g. `"2024-03-15"`).
</ParamField>

**Response** — the created `Personal` object.

<CodeGroup>
  ```bash Request theme={null}
  curl -X POST http://localhost:5175/api/personal \
    -H "Authorization: Bearer <token>" \
    -H "Content-Type: application/json" \
    -d '{
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "nombre": "María",
      "apellido": "González",
      "email": "maria.gonzalez@empresa.com",
      "puesto": "Desarrolladora",
      "fechaIngreso": "2023-06-01"
    }'
  ```

  ```json Response theme={null}
  {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "nombre": "María",
    "apellido": "González",
    "email": "maria.gonzalez@empresa.com",
    "puesto": "Desarrolladora",
    "fechaIngreso": "2023-06-01"
  }
  ```
</CodeGroup>

***

## Delete an employee

Deletes an employee by their ID.

### `DELETE /api/personal/:id`

<ParamField path="id" type="string" required>
  The UUID of the employee to delete.
</ParamField>

**No request body.**

**Response** — `200 OK` on success. The response body may be empty or contain a confirmation message.

<Warning>
  Deleting an employee does not automatically delete their associated vacation schedules or ranges. Clean up related records in the [Schedules](/api/schedules) and [Ranges](/api/ranges) endpoints as needed.
</Warning>

<CodeGroup>
  ```bash Request theme={null}
  curl -X DELETE http://localhost:5175/api/personal/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
    -H "Authorization: Bearer <token>"
  ```

  ```json Response theme={null}
  {}
  ```
</CodeGroup>
