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
Response time target in minutes
Resolution time target in minutes
Only count business hours
Whether the rule is active
Endpoints
GET
/api/v1/teams/{teamId}/sla/rulesList SLA Rules
List all SLA rules.
Code Examples
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/sla/rules" \
-H "Authorization: Bearer sk_live_your_key"Responses
200 SLA rules
{
"success": true,
"data": [
{
"id": "sla_abc",
"name": "Urgent SLA",
"priority": "urgent",
"responseTarget": 15,
"resolutionTarget": 120,
"enabled": true
}
]
}401 Authentication failed — missing or invalid API key
{
"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
{
"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
{
"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
Create a new SLA rule.
Request Body
name string requiredRule name
priority string requiredPriority level
responseTarget integer requiredResponse target in minutes
resolutionTarget integer requiredResolution target in minutes
businessHoursOnly boolean Count only business hours
Default: false
Code Examples
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","priority":"high","responseTarget":30,"resolutionTarget":240}'Responses
201 Rule created
{
"success": true,
"data": {
"id": "sla_abc",
"name": "High Priority",
"priority": "high",
"responseTarget": 30,
"resolutionTarget": 240
}
}401 Authentication failed — missing or invalid API key
{
"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
{
"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
{
"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"
}
}