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 whole minutes, 1 to 43,200 (30 days)

resolutionTimeMinutes integer

Resolution target in whole minutes, 1 to 43,200 (30 days)

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": "Critical SLA",
      "priorityKey": "critical",
      "responseTimeMinutes": 15,
      "resolutionTimeMinutes": 120,
      "use24x7": true,
      "enabled": true
    }
  ]
}

401 Authentication failed: missing or invalid API key
json
{
  "success": false,
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "The API key provided is invalid or has been revoked",
    "doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
    "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": "authentication_error",
    "code": "insufficient_permissions",
    "message": "Your API key does not have permission for this operation",
    "doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
    "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.",
    "retryAfter": 60,
    "doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
    "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. A test key is refused with 400 (team settings are live, with no test copy).

Request Body

name string required

Rule name

priorityKey string required

One of the team's priority keys (GET /settings). Any other value is a 400 that lists them; a priority that already has a rule is a 409.

responseTimeMinutes integer required

First-response target in whole minutes, 1 to 43,200 (30 days)

resolutionTimeMinutes integer required

Resolution target in whole minutes, 1 to 43,200 (30 days)

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

409 Idempotency-Key in use: its first request is still running (Retry-After says when to send it again) or it was used on another endpoint
json
{
  "success": false,
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_key_in_use",
    "message": "A request with this Idempotency-Key is still being processed. Retry after it finishes.",
    "doc_url": "https://www.cstar.help/developers/errors#idempotency_key_in_use",
    "request_id": "req_abc123"
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

422 Idempotency-Key already used within 24 hours for a request with a different body
json
{
  "success": false,
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_key_reused",
    "message": "The Idempotency-Key was already used for a request with a different body. Generate a new key for this request.",
    "doc_url": "https://www.cstar.help/developers/errors#idempotency_key_reused",
    "request_id": "req_abc123"
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

401 Authentication failed: missing or invalid API key
json
{
  "success": false,
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "The API key provided is invalid or has been revoked",
    "doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
    "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": "authentication_error",
    "code": "insufficient_permissions",
    "message": "Your API key does not have permission for this operation",
    "doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
    "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.",
    "retryAfter": 60,
    "doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
    "request_id": "req_abc123"
  },
  "meta": {
    "timestamp": "2025-12-10T14:30:00Z"
  }
}