Skip to main content
All endpoints require a valid Bearer token. Results are automatically scoped to branches accessible by the authenticated user.

SLA Breached Jobs

Get SLA-breached jobs

GET /api/sla-breached-jobs Returns all open jobs that have exceeded their SLA completion deadline, grouped by branch, agent, and contractor. Use this endpoint to build escalation dashboards and automated breach notifications. Required permission: api.sla.breached_jobs.read
curl -X GET "https://propops.yourcompany.com/api/sla-breached-jobs" \
  -H "Authorization: Bearer <token>"
{
  "success": true,
  "data": {
    "by_branch": [
      {
        "branch_id": 1,
        "branch_name": "London North",
        "breached_count": 4,
        "jobs": [
          {
            "ID": 1032,
            "uuid": "550e8400-e29b-41d4-a716-446655441032",
            "job_ref": "JOB-1032",
            "job_title": "Roof leak repair",
            "priority_name": "High",
            "sla_deadline": "2024-06-10T17:00:00Z",
            "hours_overdue": 72,
            "agent_name": "Agent_002",
            "contractor_name": "Contractor_003"
          }
        ]
      }
    ],
    "by_agent": [
      {
        "agent_id": 10,
        "agent_name": "Agent_002",
        "breached_count": 2
      }
    ],
    "by_contractor": [
      {
        "contractor_id": 20,
        "contractor_name": "Contractor_003",
        "breached_count": 1
      }
    ],
    "summary": {
      "total_breached": 6,
      "critical_priority": 1,
      "high_priority": 3,
      "medium_priority": 2
    }
  },
  "message": "Operation completed successfully"
}
data.by_branch
array
Breached jobs grouped by branch. Each entry includes the branch name, breach count, and a jobs array with full job details.
data.by_agent
array
Aggregated breach counts per agent — useful for performance and accountability reporting.
data.by_contractor
array
Aggregated breach counts per contractor.
data.summary
object
Totals split by priority level to aid triage.
A high hours_overdue value for a high-priority job indicates a serious SLA failure. Consider integrating this endpoint with your n8n webhook automation to trigger escalation notifications automatically.
You can also retrieve SLA status per individual job using GET /api/jobs/manage?action=get&uuid=<uuid> — the response includes an sla_status field with deadline and breach details.