SLA Rules
Service Level Agreement rules define response and resolution time targets by ticket priority.
The SLA Rule object
Rule ID
Rule name
Ticket priority this rule applies to
First-response target in minutes
Resolution target in minutes
Count every hour instead of only business hours
Whether the rule is active
Endpoints
GET
/api/v1/teams/{teamId}/sla/rulesList SLA Rules
List all SLA rules in evaluation order.
Code Examples
bash
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/sla/rules" \
-H "Authorization: Bearer sk_live_your_key" Responses
200 SLA rules
json
{
"success": true,
"data": [
{
"id": "sla_abc",
"name": "Urgent SLA",
"priorityKey": "urgent",
"responseTimeMinutes": 15,
"resolutionTimeMinutes": 120,
"use24x7": true,
"enabled": true
}
]
} 401 Authentication failed: missing or invalid API key
json
{
"success": false,
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Invalid or expired API key",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} 403 Insufficient permissions: wrong key type or team access
json
{
"success": false,
"error": {
"type": "authorization_error",
"code": "insufficient_permissions",
"message": "Secret key required for this endpoint",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} 429 Rate limit exceeded
json
{
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds",
"doc_url": "https://www.cstar.help/developers/api-reference#rate-limiting",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} POST
/api/v1/teams/{teamId}/sla/rulesCreate SLA Rule
Add an SLA rule to the end of the list.
Request Body
name string requiredRule name
priorityKey string requiredTicket priority key
responseTimeMinutes integer requiredFirst-response target in minutes
resolutionTimeMinutes integer requiredResolution target in minutes
use24x7 boolean Count every hour instead of only business hours
Default: false
enabled boolean Whether the rule is active
Default: true
Code Examples
bash
curl -X POST "https://www.cstar.help/api/v1/teams/{teamId}/sla/rules" \
-H "Authorization: Bearer sk_live_your_key" \
-H "Content-Type: application/json" \
-d '{"name":"High Priority","priorityKey":"high","responseTimeMinutes":30,"resolutionTimeMinutes":240}' Responses
201 Rule created
json
{
"success": true,
"data": {
"id": "sla_abc",
"name": "High Priority",
"priorityKey": "high",
"responseTimeMinutes": 30,
"resolutionTimeMinutes": 240,
"use24x7": false,
"enabled": true
}
} 401 Authentication failed: missing or invalid API key
json
{
"success": false,
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Invalid or expired API key",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} 403 Insufficient permissions: wrong key type or team access
json
{
"success": false,
"error": {
"type": "authorization_error",
"code": "insufficient_permissions",
"message": "Secret key required for this endpoint",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} 429 Rate limit exceeded
json
{
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds",
"doc_url": "https://www.cstar.help/developers/api-reference#rate-limiting",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}