Saltar al contenido
MiJornada

Operaciones

Ausencias

Vacaciones y otras ausencias.

Listar ausencias

GET /v1/absences

Ausencias que se solapan con el rango, hasta un año. Una baja médica sale como ABSENCE, sin motivo ni documentos. Pide el permiso absences:read.

Parámetros

from obligatorio string (date) Primer día, en la zona horaria de la empresa.
to obligatorio string (date) Último día, incluido. Como mucho 93 días después de from, o un año en las ausencias.
employeeId opcional string
status opcional REQUESTED | APPROVED | REJECTED | CANCELLED
limit opcional integer
cursor opcional string El nextCursor de la página anterior.

Respuesta 200

Cada elemento de data:

id string
employeeId string
employeeName string
employeeCode string | null
type VACATION | ABSENCE
status REQUESTED | APPROVED | REJECTED | CANCELLED
startDate string (date)
endDate string (date)
requestedDays number | null
requestedHours number | null
createdAt string (date-time)
updatedAt string (date-time)

Errores posibles: 401, 403, 422, 429.

Ejemplo

curl "https://api.mijornada.app/v1/absences?from=2026-10-01&to=2026-10-31" \
  -H "Authorization: Bearer mj_live_…"

Respuesta de ejemplo

{
  "data": [
    {
      "id": "abc123",
      "employeeId": "abc123",
      "employeeName": "Ana García López",
      "employeeCode": "E014",
      "type": "VACATION",
      "status": "REQUESTED",
      "startDate": "2026-10-15",
      "endDate": "2026-10-15",
      "requestedDays": 5,
      "requestedHours": null,
      "createdAt": "2026-10-15T07:02:11Z",
      "updatedAt": "2026-10-15T07:02:11Z"
    }
  ],
  "nextCursor": null
}

Apuntar una ausencia

POST /v1/absences

Apunta una ausencia aprobada, como si la hubiera apuntado la empresa. Valen las mismas reglas que en MiJornada: se rechazan los solapes y las vacaciones descuentan del saldo. Las bajas médicas no se pueden crear aquí. Pide el permiso absences:write.

Parámetros

Idempotency-Key opcional string Repite la petición con el mismo valor y solo se ejecuta una vez. Se guarda 24 horas.

Cuerpo

employeeId obligatorio string
type obligatorio VACATION | ABSENCE
startDate obligatorio string (date)
endDate obligatorio string (date)
reason opcional string Se guarda en MiJornada. La API no lo devuelve nunca.

Respuesta 201

id string
employeeId string
employeeName string
employeeCode string | null
type VACATION | ABSENCE
status REQUESTED | APPROVED | REJECTED | CANCELLED
startDate string (date)
endDate string (date)
requestedDays number | null
requestedHours number | null
createdAt string (date-time)
updatedAt string (date-time)

Errores posibles: 401, 403, 404, 409, 422, 429.

Ejemplo

curl -X POST "https://api.mijornada.app/v1/absences" \
  -H "Authorization: Bearer mj_live_…" \
  -H "Content-Type: application/json" \
  -d '{"employeeId":"abc123","type":"VACATION","startDate":"2026-10-15","endDate":"2026-10-15"}'

Respuesta de ejemplo

{
  "id": "abc123",
  "employeeId": "abc123",
  "employeeName": "Ana García López",
  "employeeCode": "E014",
  "type": "VACATION",
  "status": "REQUESTED",
  "startDate": "2026-10-15",
  "endDate": "2026-10-15",
  "requestedDays": 5,
  "requestedHours": null,
  "createdAt": "2026-10-15T07:02:11Z",
  "updatedAt": "2026-10-15T07:02:11Z"
}

Última actualización de esta página: .