Skip to content

SLA API

All endpoints require authentication and sla tool permissions.

GET /api/sla/policies

Permission: sla:view

Query parameters:

ParamTypeDescription
company_idstringFilter policies by company

Response: { policies } — each policy includes company_name and a nested rules array with priority info (priority_label, priority_value, priority_color, priority_position).

POST /api/sla/policies

Permission: sla:update

Body:

FieldTypeRequiredDescription
namestringYesPolicy name
descriptionstringNoDescription
company_idstringNoLink to a company
rulesarrayNoArray of priority rules

Each rule in the rules array:

FieldTypeRequiredDescription
priority_idstringYesConfig list item ID for priority
response_hoursnumberYesHours allowed for first response
resolution_hoursnumberYesHours allowed for resolution

Response: { policy } (201)

PUT /api/sla/policies/:id

Permission: sla:update

Body: Any of: name, description, company_id, rules. When rules is provided, all existing rules are replaced.

Response: { policy }

DELETE /api/sla/policies/:id

Permission: sla:manage

Response: { ok: true }


GET /api/sla/tasks/:taskId

Permission: sla:view

Returns the SLA assignment for a task, including policy_name, response_hours, resolution_hours, and priority_label.

Response: { sla } — null if no SLA assigned.

PUT /api/sla/tasks/:taskId

Permission: sla:update

Body:

FieldTypeRequiredDescription
policy_idstringYesSLA policy ID
created_atstringNoOverride start time (defaults to task creation time)

Calculates response_deadline and resolution_deadline based on the policy rule matching the task’s priority. Requires the task to have a priority set. Uses upsert — reassigning replaces the existing SLA.

Response: { sla }

POST /api/sla/tasks/:taskId/respond

Permission: sla:update

Marks the SLA response as met. Records whether the response deadline was breached.

Response: { ok: true, breached }breached is true if response was after the deadline.

POST /api/sla/tasks/:taskId/resolve

Permission: sla:update

Marks the SLA resolution as met. Records whether the resolution deadline was breached.

Response: { ok: true, breached }breached is true if resolution was after the deadline.


GET /api/sla/compliance

Permission: sla:view

Query parameters:

ParamTypeDescription
policy_idstringFilter by specific policy

Response:

{
"compliance": [
{
"policy_name": "string",
"policy_id": "string",
"total": 0,
"response_breaches": 0,
"resolution_breaches": 0,
"open_response_breaches": 0,
"open_resolution_breaches": 0
}
],
"at_risk": [
{
"id": "string",
"title": "string",
"response_deadline": "string",
"resolution_deadline": "string",
"policy_name": "string",
"assignee_name": "string"
}
]
}

The at_risk array contains tasks approaching a deadline within the next 4 hours (limit 20).