Skip to main content

SLA Rules

Service Level Agreement rules define response and resolution time targets by ticket priority.

The SLA Rule object

id string

Rule ID

name string

Rule name

priority string

Ticket priority this rule applies to

responseTarget integer

Response time target in minutes

resolutionTarget integer

Resolution time target in minutes

businessHoursOnly boolean

Only count business hours

enabled boolean

Whether the rule is active

Endpoints

GET /api/v1/teams/{teamId}/sla/rules

List 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/rules

Create SLA Rule

Create a new SLA rule.

Request Body

name string required

Rule name

priority string required

Priority level

responseTarget integer required

Response target in minutes

resolutionTarget integer required

Resolution 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"
  }
}