SLA Policies

A Service Level Agreement is a documented agreement between a support provider and their customers that specifies performance measures for support. SLAs are often expressed as follows:

For urgent incidents, we will respond to tickets in 10 minutes and resolve the ticket within 2 hours. For high priority incidents, we will respond to tickets in 30 minutes and resolved the ticket within 8 hours.

Because there may be different SLAs per customer (or group of customers) that the provider supports, the provider will define an SLA policy to support each unique SLA's requirements.

A SLA policy is the unique (not enforced) combination of criteria along with assigned metric targets for each value of the priority field. There can be multiple SLA policies per Zendesk Support account.

JSON Format

SLA Policies are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
created_at string true false The time the SLA policy was created
description string false false The description of the SLA policy
filter object false true An object that describes the conditions that a ticket must match in order for an SLA policy to be applied to that ticket. See Filter.
id integer true false Automatically assigned when created
policy_metrics array false false Array of Policy Metric objects
position integer false false Position of the SLA policy that determines the order they will be matched. If not specified, the SLA policy is added as the last position
title string false true The title of the SLA policy
updated_at string true false The time of the last update of the SLA policy
url string true false URL of the SLA Policy reacord
Filter

A filter checks the value of ticket fields and selects the ticket if the conditions are met. Filter is represented as a JSON object with two arrays of one or more conditions.

Example

{
   "filter": {
     "all": [
       { "field": "type", "operator": "is", "value": "incident" },
       { "field": "via_id", "operator": "is", "value": 4 }
     ],
     "any": [
     ]
   }
}

The first array lists all the conditions that must be met. The second array lists any condition that must be met.

Name Type Description
all array Logical AND. Tickets must fulfill all of the conditions to be considered matching
any array Logical OR. Tickets may satisfy any of the conditions to be considered matching

Each condition in an array has the following properties:

Name Type Description
field string The name of a ticket field
operator string A comparison operator
value string The value of a ticket field

Example

{ "field": "type", "operator": "is", "value": "incident" }

See Conditions reference for the list of fields, allowed operators, and values of the conditions.

Policy Metric

An object that describes the metric targets for each value of the priority field.

Policy Metrics are represented as simple flat JSON objects which have the following keys:

Name Type Comment
priority string Priority that a ticket must match
metric string The definition of the time that is being measured. See Metrics
target integer The time within which the end-state for a metric should be met
business_hours boolean Whether the metric targets are being measured in business hours or calendar hours

Example js { "priority": "low", "metric": "first_reply_time", "target": 60, "business_hours": false }

Metrics
Metric Value
Agent Work Time agent_work_time
First Reply Time first_reply_time
Next Reply Time next_reply_time
Pausable Update Time pausable_update_time
Periodic Update Time periodic_update_time
Requester Wait Time requester_wait_time
Example
{
  "created_at": "2015-03-17T22:50:26Z",
  "description": "Organizations: Silver Plan",
  "filter": {
    "all": [
      {
        "field": "type",
        "operator": "is",
        "value": "incident"
      },
      {
        "field": "via_id",
        "operator": "is",
        "value": "4"
      }
    ],
    "any": []
  },
  "id": 25,
  "policy_metrics": [
    {
      "business_hours": false,
      "metric": "first_reply_time",
      "priority": "low",
      "target": 60
    }
  ],
  "position": 3,
  "title": "Silver Plan",
  "updated_at": "2015-03-17T22:50:26Z",
  "url": "https://company.zendesk.com/api/v2/slas/policies/25.json"
}

List SLA Policies

  • GET /api/v2/slas/policies
Availability
  • Accounts on the Support Professional or Suite Growth plan or above
Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies.json \
  -H "Content-Type: application/json" \
  -v -u {email_address}:{password}
Example Response
Status 200 OK

{
  "count": 1,
  "next_page": null,
  "previous_page": null,
  "sla_policies": [
    {
      "description": "For urgent incidents, we will respond to tickets in 10 minutes",
      "filter": {
        "all": [
          {
            "field": "type",
            "operator": "is",
            "value": "incident"
          },
          {
            "field": "via_id",
            "operator": "is",
            "value": "4"
          }
        ],
        "any": []
      },
      "id": 36,
      "policy_metrics": [
        {
          "business_hours": false,
          "metric": "first_reply_time",
          "priority": "low",
          "target": 60
        }
      ],
      "position": 3,
      "title": "Incidents",
      "url": "https://{subdomain}.zendesk.com/api/v2/slas/policies/36.json"
    }
  ]
}

Create SLA Policy

  • POST /api/v2/slas/policies
Availability
  • Accounts on the Support Professional or Suite Growth plan or above
Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies \
  -H "Content-Type: application/json" \
  -d '{
        "sla_policy": {
          "title": "Incidents",
          "description": "For urgent incidents, we will respond to tickets in 10 minutes",
          "position": 3,
          "filter": {
            "all": [
              { "field": "type", "operator": "is", "value": "incident" }
            ],
            "any": []
          },
          "policy_metrics": [
            { "priority": "normal", "metric": "first_reply_time", "target": 30, "business_hours": false },
            { "priority": "urgent", "metric": "first_reply_time", "target": 10, "business_hours": false },
            { "priority": "low", "metric": "requester_wait_time", "target": 180, "business_hours": false },
            { "priority": "normal", "metric": "requester_wait_time", "target": 160, "business_hours": false },
            { "priority": "high", "metric": "requester_wait_time", "target": 140, "business_hours": false },
            { "priority": "urgent", "metric": "requester_wait_time", "target": 120, "business_hours": false }
          ]
        }
      }' \
  -v -u {email_address}:{password} -X POST
Example Response
Status 201 Created

{
  "sla_policy": {
    "description": "For urgent incidents, we will respond to tickets in 10 minutes",
    "filter": {
      "all": [
        {
          "field": "type",
          "operator": "is",
          "value": "incident"
        }
      ],
      "any": []
    },
    "id": 36,
    "policy_metrics": [
      {
        "business_hours": false,
        "metric": "first_reply_time",
        "priority": "normal",
        "target": 30
      },
      {
        "business_hours": false,
        "metric": "first_reply_time",
        "priority": "urgent",
        "target": 10
      },
      {
        "business_hours": false,
        "metric": "requester_wait_time",
        "priority": "low",
        "target": 180
      },
      {
        "business_hours": false,
        "metric": "requester_wait_time",
        "priority": "normal",
        "target": 160
      },
      {
        "business_hours": false,
        "metric": "requester_wait_time",
        "priority": "high",
        "target": 140
      },
      {
        "business_hours": false,
        "metric": "requester_wait_time",
        "priority": "urgent",
        "target": 120
      }
    ],
    "position": 3,
    "title": "Incidents",
    "url": "https://{subdomain}.zendesk.com/api/v2/slas/policies/36.json"
  }
}

Retrieve Supported Filter Definition Items

  • GET /api/v2/slas/policies/definitions
Availability
  • Accounts on the Support Professional or Suite Growth plan or above
Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies/definitions.json \
  -H "Content-Type: application/json" \
  -v -u {email_address}:{password} -X GET
Example Response
Status 200 OK

{
  "definitions": {
    "all": [
      {
        "group": "ticket",
        "operators": [
          {
            "title": "Is",
            "value": "is"
          },
          {
            "title": "Is not",
            "value": "is_not"
          }
        ],
        "target": null,
        "title": "Brand",
        "value": "brand_id",
        "values": {
          "list": [
            {
              "title": "Support",
              "value": "10001"
            }
          ],
          "type": "list"
        }
      }
    ],
    "any": [
      {
        "group": "ticket",
        "operators": [
          {
            "title": "Is",
            "value": "is"
          },
          {
            "title": "Is not",
            "value": "is_not"
          }
        ],
        "target": null,
        "title": "Brand",
        "value": "brand_id",
        "values": {
          "list": [
            {
              "title": "Support",
              "value": "10001"
            }
          ],
          "type": "list"
        }
      }
    ]
  }
}

Reorder SLA Policies

  • PUT /api/v2/slas/policies/reorder
Availability
  • Accounts on the Support Professional or Suite Growth plan or above
Allowed For
  • Admins
Parameters
Name Type In Required Description
sla_policy_ids array Query false The IDs of the SLA Policies to reorder
Using curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies/reorder.json \
  -H "Content-Type: application/json" -X PUT \
  -d '{"sla_policy_ids": [12, 55]}' \
  -v -u {email}:{password}
Example Response
Status 200 OK

Show SLA Policy

  • GET /api/v2/slas/policies/{sla_policy_id}
Availability
  • Accounts on the Support Professional or Suite Growth plan or above
Allowed For
  • Admins
Parameters
Name Type In Required Description
sla_policy_id integer Path true The ID of the SLA Policy
Using curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies/{sla_policy_id} \
  -H "Content-Type: application/json" \
  -v -u {email_address}:{password}
Example Response
Status 200 OK

{
  "sla_policy": {
    "description": "For urgent incidents, we will respond to tickets in 10 minutes",
    "filter": {
      "all": [
        {
          "field": "type",
          "operator": "is",
          "value": "incident"
        },
        {
          "field": "via_id",
          "operator": "is",
          "value": "4"
        }
      ],
      "any": []
    },
    "id": 36,
    "policy_metrics": [
      {
        "business_hours": false,
        "metric": "first_reply_time",
        "priority": "low",
        "target": 60
      }
    ],
    "position": 3,
    "title": "Incidents",
    "url": "https://{subdomain}.zendesk.com/api/v2/slas/policies/36.json"
  }
}

Update SLA Policy

  • PUT /api/v2/slas/policies/{sla_policy_id}

Updates the specified policy.

Availability
  • Accounts on the Support Professional or Suite Growth plan or above
Allowed For
  • Admins
Parameters
Name Type In Required Description
sla_policy_id integer Path true The ID of the SLA Policy
Using curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies/{sla_policy_id} \
  -H "Content-Type: application/json" \
  -d '{
        "sla_policy": {
          "title": "Urgent Incidents",
          "description": "For urgent incidents, we will resolve the ticket within 2 hours",
          "position": 3,
          "filter": {
            "all": [
              { "field": "type", "operator": "is", "value": "incident" }
            ],
            "any": []
          },
          "policy_metrics": [
            { "priority": "normal", "metric": "first_reply_time", "target": 30, "business_hours": false },
            { "priority": "urgent", "metric": "first_reply_time", "target": 10, "business_hours": false },
            { "priority": "low", "metric": "requester_wait_time", "target": 180, "business_hours": false },
            { "priority": "normal", "metric": "requester_wait_time", "target": 160, "business_hours": false },
            { "priority": "high", "metric": "requester_wait_time", "target": 140, "business_hours": false },
            { "priority": "urgent", "metric": "requester_wait_time", "target": 120, "business_hours": false }
          ]
        }
      }' \
  -v -u {email_address}:{password} -X PUT
Example Response
Status 200 OK

{
  "sla_policy": {
    "description": "For urgent incidents, we will resolve the ticket within 2 hours",
    "filter": {
      "all": [
        {
          "field": "type",
          "operator": "is",
          "value": "incident"
        }
      ],
      "any": []
    },
    "id": 36,
    "policy_metrics": [
      {
        "business_hours": false,
        "metric": "first_reply_time",
        "priority": "normal",
        "target": 30
      },
      {
        "business_hours": false,
        "metric": "first_reply_time",
        "priority": "urgent",
        "target": 10
      },
      {
        "business_hours": false,
        "metric": "requester_wait_time",
        "priority": "low",
        "target": 180
      },
      {
        "business_hours": false,
        "metric": "requester_wait_time",
        "priority": "normal",
        "target": 160
      },
      {
        "business_hours": false,
        "metric": "requester_wait_time",
        "priority": "high",
        "target": 140
      },
      {
        "business_hours": false,
        "metric": "requester_wait_time",
        "priority": "urgent",
        "target": 120
      }
    ],
    "position": 3,
    "title": "Urgent Incidents",
    "url": "https://{subdomain}.zendesk.com/api/v2/slas/policies/36.json"
  }
}

Delete SLA Policy

  • DELETE /api/v2/slas/policies/{sla_policy_id}
Availability
  • Accounts on the Support Professional or Suite Growth plan or above
Allowed For
  • Admins
Parameters
Name Type In Required Description
sla_policy_id integer Path true The ID of the SLA Policy
Using curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies/{sla_policy_id} \
  -H "Content-Type: application/json" \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status 204 No Content