Referencia de API
Endpoints

Endpoints

Notifications

Manage user and global notifications.

Base URL: http://localhost:8000

List Notifications

GET /notifications

Parameters:

  • skip (int, default=0): Pagination offset.
  • limit (int, default=100): Pagination limit.
  • user_id (string, optional): Filter by user ID.
curl -X 'GET' \
  'http://localhost:8000/notifications?skip=0&limit=10' \
  -H 'accept: application/json'

Create Notification

POST /notifications

⚠️

Requires a valid user_id unless is_global is set to true.

curl -X 'POST' \
  'http://localhost:8000/notifications' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "Task Completed",
  "variant": "success",
  "user_id": "user123"
}'

Delete Notification

DELETE /notifications/{id}

Delete All Notifications

DELETE /notifications

🚫

This action is irreversible. Ensure you interpret user_id correctly.

Parameters:

  • user_id (string, required): The user ID whose notifications should be cleared.

Mark as Read

PATCH /notifications/{id}

Real-time Events (SSE)

GET /notifications/events

Subscribe to Server-Sent Events for real-time updates.

Operator Quality

Compute Audit Results

POST /compute-audit-results

Updates an existing audit and recomputes the score against current criteria.

curl -X POST 'http://localhost:8000/compute-audit-results' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <<ACCESS_TOKEN>>' \
  -H 'x-username: admin' \
  -d '{
    "task_uuid": "<<UUID>>",
    "file_name": "<<FILE_NAME>>",
    "isCall": true,
    "audit": [{"category":"SKILLS","question":"...","complies":true,"explanation":"..."}]
  }'

Audit Validation

Validate Audit

POST /validate-audit

Valida una auditoría de llamada o chat y envía notificaciones por correo.

Headers:

  • Authorization: Bearer <ACCESS_TOKEN> (obligatorio)

FormData:

  • task_uuid (string, obligatorio): UUID de la tarea/chat
  • notes (string, obligatorio): Observaciones de la validación
  • isCall (boolean, obligatorio): true para llamada, false para chat
curl -X POST 'http://localhost:8000/validate-audit' \
  -H 'Authorization: Bearer <<ACCESS_TOKEN>>' \
  -H 'Content-Type: multipart/form-data' \
  -F 'task_uuid=25a95214-6788-4798-83e2-bbe37bdb66dd' \
  -F 'notes=Validación realizada por supervisor' \
  -F 'isCall=true'

También acepta JSON:

curl -X POST 'http://localhost:8000/validate-audit' \
  -H 'Authorization: Bearer <<ACCESS_TOKEN>>' \
  -H 'Content-Type: application/json' \
  -d '{
    "task_uuid": "25a95214-6788-4798-83e2-bbe37bdb66dd",
    "notes": "Validación realizada por supervisor",
    "isCall": true
  }'

Respuesta (200):

{
  "success": true,
  "code": "OK",
  "details": {
    "type": "llamada",
    "task_uuid": "25a95214-6788-4798-83e2-bbe37bdb66dd",
    "sent_to": ["operador@ejemplo.com", "sup1@empresa.com", "sup2@empresa.com"],
    "bcc": ["Desarrollo_LS@linksolution.com.ar"],
    "validated_at": "2026-01-05T12:34:56.000Z"
  }
}

Puedes adjuntar archivos en multipart; cualquier campo de tipo archivo distinto a los requeridos será incluido como adjunto.

Códigos de error:

  • MISSING_AUTH_HEADER (401): Falta el header Authorization
  • UNAUTHORIZED (401): Token inválido/expirado
  • MISSING_FIELDS (400): Faltan campos obligatorios
  • VALIDATION_ERROR (400): Formato inválido (ej: UUID)
  • NOT_FOUND (404): Registro inexistente
  • EMAIL_SEND_ERROR (502): Fallo al enviar correo
  • INTERNAL_ERROR (500): Error interno