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

priorityKey string

Ticket priority this rule applies to

responseTimeMinutes integer

First-response target in minutes

resolutionTimeMinutes integer

Resolution target in minutes

use24x7 boolean

Count every hour instead of only business hours

enabled boolean

Whether the rule is active

Endpoints

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

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

Create SLA Rule

Add an SLA rule to the end of the list.

Request Body

name string required

Rule name

priorityKey string required

Ticket priority key

responseTimeMinutes integer required

First-response target in minutes

resolutionTimeMinutes integer required

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