> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrubbe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SLA Policies API: Create, Retrieve, Update, Delete

> Define and manage service level agreement policies with configurable response and resolution thresholds, escalation contacts, and uptime targets.

SLA policies set the performance commitments your team is held to when incidents occur. Each policy combines response and resolution time targets with breach thresholds, so the system can classify incidents that are trending toward or have exceeded acceptable limits. You can scope policies to specific teams and link them to escalation contacts for automated notification.

All requests require a Bearer token in the `Authorization` header.

***

## Create a policy

`POST https://your-api-domain.com/api/v1/sla-policies`

Creates a new SLA policy. The policy is immediately active and will be evaluated against incoming incidents that match its `applicableTeam`.

### Request body

<ParamField body="name" type="string" required placeholder="Critical Outage SLA">
  A human-readable name for the policy.
</ParamField>

<ParamField body="priority" type="string" required placeholder="CRITICAL">
  The incident priority this policy applies to. Accepted values: `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`.
</ParamField>

<ParamField body="responseTimeMinutes" type="number" required placeholder="15">
  Target time in minutes within which the incident must receive a first response.
</ParamField>

<ParamField body="responseThreshold" type="number" required placeholder="90">
  Percentage of incidents that must meet the response time target (0–100).
</ParamField>

<ParamField body="resolveTimeMinutes" type="number" required placeholder="60">
  Target time in minutes within which the incident must be fully resolved.
</ParamField>

<ParamField body="resolveThreshold" type="number" required placeholder="85">
  Percentage of incidents that must meet the resolution time target (0–100).
</ParamField>

<ParamField body="escalationContact" type="string" required placeholder="Tier1">
  The escalation tier or contact identifier to notify when a breach is detected.
</ParamField>

<ParamField body="applicableTeam" type="string" required placeholder="oncall@example.com">
  The team email or identifier this policy governs.
</ParamField>

<ParamField body="uptimeTarget" type="number" required placeholder="99.9">
  Required uptime percentage for services covered by this policy (e.g., `99.9`).
</ParamField>

### Response fields

<ResponseField name="id" type="string" required>
  Unique identifier for the created policy.
</ResponseField>

<ResponseField name="name" type="string" required>
  Policy name.
</ResponseField>

<ResponseField name="priority" type="string" required>
  Priority level this policy targets.
</ResponseField>

<ResponseField name="breachStatus" type="string" required>
  Current breach classification. One of `NONE`, `RESPONSE_BREACH`, `RESOLVE_BREACH`, or `BOTH`.
</ResponseField>

<ResponseField name="createdAt" type="string" required>
  ISO 8601 timestamp of policy creation.
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://your-api-domain.com/api/v1/sla-policies \
    --header 'Authorization: Bearer YOUR_TOKEN' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "Critical Outage SLA",
      "priority": "CRITICAL",
      "responseTimeMinutes": 15,
      "responseThreshold": 90,
      "resolveTimeMinutes": 60,
      "resolveThreshold": 85,
      "escalationContact": "Tier1",
      "applicableTeam": "oncall@example.com",
      "uptimeTarget": 99.9
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://your-api-domain.com/api/v1/sla-policies',
    {
      method: 'POST',
      headers: {
        Authorization: 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        name: 'Critical Outage SLA',
        priority: 'CRITICAL',
        responseTimeMinutes: 15,
        responseThreshold: 90,
        resolveTimeMinutes: 60,
        resolveThreshold: 85,
        escalationContact: 'Tier1',
        applicableTeam: 'oncall@example.com',
        uptimeTarget: 99.9,
      }),
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://your-api-domain.com/api/v1/sla-policies',
      headers={'Authorization': 'Bearer YOUR_TOKEN'},
      json={
          'name': 'Critical Outage SLA',
          'priority': 'CRITICAL',
          'responseTimeMinutes': 15,
          'responseThreshold': 90,
          'resolveTimeMinutes': 60,
          'resolveThreshold': 85,
          'escalationContact': 'Tier1',
          'applicableTeam': 'oncall@example.com',
          'uptimeTarget': 99.9,
      },
  )
  data = response.json()
  ```
</CodeGroup>

***

## List all policies

`GET https://your-api-domain.com/api/v1/sla-policies`

Returns all SLA policies defined for the account.

### Response fields

<ResponseField name="policies" type="object[]" required>
  Array of SLA policy objects.

  <Expandable title="policy properties">
    <ResponseField name="id" type="string" required>
      Unique policy identifier.
    </ResponseField>

    <ResponseField name="name" type="string" required>
      Policy name.
    </ResponseField>

    <ResponseField name="priority" type="string" required>
      Target incident priority.
    </ResponseField>

    <ResponseField name="breachStatus" type="string" required>
      Current breach state: `NONE`, `RESPONSE_BREACH`, `RESOLVE_BREACH`, or `BOTH`.
    </ResponseField>

    <ResponseField name="uptimeTarget" type="number" required>
      Required uptime percentage.
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://your-api-domain.com/api/v1/sla-policies \
    --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://your-api-domain.com/api/v1/sla-policies',
    {
      headers: { Authorization: 'Bearer YOUR_TOKEN' },
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://your-api-domain.com/api/v1/sla-policies',
      headers={'Authorization': 'Bearer YOUR_TOKEN'},
  )
  data = response.json()
  ```
</CodeGroup>

***

## Get a single policy

`GET https://your-api-domain.com/api/v1/sla-policies/:id`

Retrieves the full configuration of a specific SLA policy.

### Path parameters

<ParamField path="id" type="string" required>
  The unique identifier of the SLA policy.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://your-api-domain.com/api/v1/sla-policies/sla_abc123 \
    --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://your-api-domain.com/api/v1/sla-policies/sla_abc123',
    {
      headers: { Authorization: 'Bearer YOUR_TOKEN' },
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://your-api-domain.com/api/v1/sla-policies/sla_abc123',
      headers={'Authorization': 'Bearer YOUR_TOKEN'},
  )
  data = response.json()
  ```
</CodeGroup>

***

## Update a policy

`PUT https://your-api-domain.com/api/v1/sla-policies/:id`

Replaces all fields of an existing SLA policy. Supply the full policy body — omitted fields revert to their defaults.

### Path parameters

<ParamField path="id" type="string" required>
  The unique identifier of the SLA policy to update.
</ParamField>

### Request body

The request body accepts the same fields as [Create a policy](#create-a-policy).

<CodeGroup>
  ```bash cURL theme={null}
  curl --request PUT \
    --url https://your-api-domain.com/api/v1/sla-policies/sla_abc123 \
    --header 'Authorization: Bearer YOUR_TOKEN' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "Critical Outage SLA v2",
      "priority": "CRITICAL",
      "responseTimeMinutes": 10,
      "responseThreshold": 95,
      "resolveTimeMinutes": 45,
      "resolveThreshold": 90,
      "escalationContact": "Tier1",
      "applicableTeam": "oncall@example.com",
      "uptimeTarget": 99.99
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://your-api-domain.com/api/v1/sla-policies/sla_abc123',
    {
      method: 'PUT',
      headers: {
        Authorization: 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        name: 'Critical Outage SLA v2',
        priority: 'CRITICAL',
        responseTimeMinutes: 10,
        responseThreshold: 95,
        resolveTimeMinutes: 45,
        resolveThreshold: 90,
        escalationContact: 'Tier1',
        applicableTeam: 'oncall@example.com',
        uptimeTarget: 99.99,
      }),
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
      'https://your-api-domain.com/api/v1/sla-policies/sla_abc123',
      headers={'Authorization': 'Bearer YOUR_TOKEN'},
      json={
          'name': 'Critical Outage SLA v2',
          'priority': 'CRITICAL',
          'responseTimeMinutes': 10,
          'responseThreshold': 95,
          'resolveTimeMinutes': 45,
          'resolveThreshold': 90,
          'escalationContact': 'Tier1',
          'applicableTeam': 'oncall@example.com',
          'uptimeTarget': 99.99,
      },
  )
  data = response.json()
  ```
</CodeGroup>

***

## Delete a policy

`DELETE https://your-api-domain.com/api/v1/sla-policies/:id`

Permanently removes an SLA policy. Incidents already evaluated against this policy retain their recorded breach status.

### Path parameters

<ParamField path="id" type="string" required>
  The unique identifier of the SLA policy to delete.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request DELETE \
    --url https://your-api-domain.com/api/v1/sla-policies/sla_abc123 \
    --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://your-api-domain.com/api/v1/sla-policies/sla_abc123',
    {
      method: 'DELETE',
      headers: { Authorization: 'Bearer YOUR_TOKEN' },
    }
  );
  ```

  ```python Python theme={null}
  import requests

  requests.delete(
      'https://your-api-domain.com/api/v1/sla-policies/sla_abc123',
      headers={'Authorization': 'Bearer YOUR_TOKEN'},
  )
  ```
</CodeGroup>

***

## Breach status values

The `breachStatus` field on each policy reflects the current compliance state across all incidents evaluated against that policy.

| Value             | Meaning                                                            |
| ----------------- | ------------------------------------------------------------------ |
| `NONE`            | No active breaches detected.                                       |
| `RESPONSE_BREACH` | At least one incident exceeded the response time target.           |
| `RESOLVE_BREACH`  | At least one incident exceeded the resolution time target.         |
| `BOTH`            | Incidents breaching both response and resolution thresholds exist. |
