Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Glemynart/SaaS/llms.txt

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

The Alerts API tracks the health of your workforce documentation. Alerts are created automatically by the server-side generation endpoints and remain scoped to the authenticated tenant. Each alert carries a severity level (INFO, WARNING, or CRITICAL) and a lifecycle status (OPEN or RESOLVED). All endpoints require a valid JWT and an active tenant context.

Endpoints

List alerts


GET /alerts
Returns a paginated list of alerts for the current tenant, ordered by createdAt descending. The response also includes an aggregate stats object with counts across open, resolved, and critical states.

Query parameters

status
string
Filter by alert lifecycle status. Accepted values: OPEN, RESOLVED.
severity
string
Filter by alert severity. Accepted values: INFO, WARNING, CRITICAL.
page
integer
Page number for pagination. Minimum: 1. Default: 1.
limit
integer
Number of results per page. Minimum: 1. Default: 20.

Response

data
Alert[]
Array of alert objects matching the applied filters.
stats
object
Aggregate counts across all alerts for the tenant.
meta
object
Pagination metadata.
curl -X GET "https://api.example.com/alerts?severity=CRITICAL&status=OPEN&page=1&limit=10" \
  -H "Authorization: Bearer {accessToken}"

Get a single alert


GET /alerts/:id
Returns a single alert by its UUID, scoped to the authenticated tenant.

Path parameters

id
string
required
UUID of the alert to retrieve.

Response

Returns the same fields as a single item in the data array of GET /alerts. Responds with 404 if the alert does not belong to the tenant.
curl -X GET "https://api.example.com/alerts/3f1e2d0a-8b7c-4a5e-9f6d-1c2b3a4e5f60" \
  -H "Authorization: Bearer {accessToken}"

Resolve an alert


PATCH /alerts/:id/resolve
Marks the alert as RESOLVED and sets resolvedAt to the current timestamp. No request body is required. Required roles: ADMIN, OPERADOR

Path parameters

id
string
required
UUID of the alert to resolve.

Response

Returns the updated alert record with status: "RESOLVED" and a populated resolvedAt field.
curl -X PATCH "https://api.example.com/alerts/3f1e2d0a-8b7c-4a5e-9f6d-1c2b3a4e5f60/resolve" \
  -H "Authorization: Bearer {accessToken}"

Generate contract expiration alerts


POST /alerts/generate-contract-alerts
Scans all VIGENTE and RENOVADO contracts whose fechaFin falls within the next 30 days from the moment of the call. For each qualifying contract, up to three alerts can be created — one per severity threshold:
Days remainingSeverityTitle
≤ 30INFOContrato próximo a vencer (30 días)
≤ 15WARNINGContrato próximo a vencer (15 días)
≤ 7CRITICALContrato próximo a vencer (7 días)
Required role: ADMIN

Response

created
integer
Number of new alert records inserted in this run.
message
string
Human-readable summary, e.g. "3 alertas de contrato generadas".
curl -X POST "https://api.example.com/alerts/generate-contract-alerts" \
  -H "Authorization: Bearer {accessToken}"
Schedule POST /alerts/generate-contract-alerts as a daily cron job (e.g. every morning at 06:00 local time) so your team always has a fresh view of approaching contract expirations without manual intervention.

Generate missing-contract alerts


POST /alerts/generate-missing-doc-alerts
Finds all ACTIVO employees (non-deleted) that have no VIGENTE or RENOVADO contract registered. Creates one WARNING alert per qualifying employee with the title "Empleado sin contrato registrado". Required role: ADMIN

Response

created
integer
Number of new alert records inserted in this run.
message
string
Human-readable summary, e.g. "5 alertas de documentos faltantes generadas".
curl -X POST "https://api.example.com/alerts/generate-missing-doc-alerts" \
  -H "Authorization: Bearer {accessToken}"

Alert deduplication

The generation endpoints are safe to call repeatedly. Before creating any alert the server checks whether an identical open alert already exists for the same combination of expedienteDocId (or employeeId), severity, and status: OPEN. If a match is found, the record is skipped — no duplicate is inserted. This means running the cron job multiple times within the same day will not multiply alerts.
The dueDate field on a contract alert always reflects the actual fechaFin of the contract — it is not computed as an offset from the generation time. Use dueDate to sort or display the exact expiration date to your users.

Build docs developers (and LLMs) love