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:

NameTypeRead-onlyMandatoryDescription
created_atstringtruefalseThe time the SLA policy was created
descriptionstringfalsefalseThe description of the SLA policy
filterobjectfalsetrueAn object that describes the conditions that a ticket must match in order for an SLA policy to be applied to that ticket. See Filter.
idintegertruefalseAutomatically assigned when created
policy_metricsarrayfalsefalseArray of Policy Metric objects
positionintegerfalsefalsePosition of the SLA policy that determines the order they will be matched. If not specified, the SLA policy is added as the last position
titlestringfalsetrueThe title of the SLA policy
updated_atstringtruefalseThe time of the last update of the SLA policy
urlstringtruefalseURL 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.

NameTypeDescription
allarrayLogical AND. Tickets must fulfill all of the conditions to be considered matching
anyarrayLogical OR. Tickets may satisfy any of the conditions to be considered matching

Each condition in an array has the following properties:

NameTypeDescription
fieldstringThe name of a ticket field
operatorstringA comparison operator
valuestringThe 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:

NameTypeComment
prioritystringPriority that a ticket must match
metricstringThe definition of the time that is being measured. See Metrics
targetintegerThe total time within which the end-state for a metric should be met, measured in minutes
target_in_secondsintegerThe total time within which the end-state for a metric should be met, measured in seconds
business_hoursbooleanWhether the metric targets are being measured in business hours or calendar hours

Example

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

Metrics

MetricValue
Agent Work Timeagent_work_time
First Reply Timefirst_reply_time
Next Reply Timenext_reply_time
Pausable Update Timepausable_update_time
Periodic Update Timeperiodic_update_time
Requester Wait Timerequester_wait_time
Total Resolution Timetotal_resolution_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"      },      {        "field": "custom_status_id",        "operator": "includes",        "value": [          "1",          "2"        ]      }    ],    "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

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies.json \  -H "Content-Type: application/json" \  -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/slas/policies"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/slas/policies")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/slas/policies',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/slas/policies"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/slas/policies")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// 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"    }  ]}

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

NameTypeInRequiredDescription
sla_policy_idintegerPathtrueThe ID of the SLA Policy

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/slas/policies/{sla_policy_id} \  -H "Content-Type: application/json" \  -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/slas/policies/36"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/slas/policies/36")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/slas/policies/36',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/slas/policies/36"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/slas/policies/36")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// 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"  }}

Create SLA Policy

  • POST /api/v2/slas/policies

Availability

  • Accounts on the Support Professional or Suite Growth plan or above

Allowed For

  • Admins

Code Samples

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
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/slas/policies"	method := "POST"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/slas/policies")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""""");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("POST", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'POST',  url: 'https://example.zendesk.com/api/v2/slas/policies',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/slas/policies"headers = {	"Content-Type": "application/json",}
response = requests.request(	"POST",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/slas/policies")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

201 Created
// 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"  }}

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

NameTypeInRequiredDescription
sla_policy_idintegerPathtrueThe ID of the SLA Policy

Code Samples

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
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/slas/policies/36"	method := "PUT"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/slas/policies/36")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""""");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("PUT", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'PUT',  url: 'https://example.zendesk.com/api/v2/slas/policies/36',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/slas/policies/36"headers = {	"Content-Type": "application/json",}
response = requests.request(	"PUT",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/slas/policies/36")request = Net::HTTP::Put.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// 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

NameTypeInRequiredDescription
sla_policy_idintegerPathtrueThe ID of the SLA Policy

Code Samples

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
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/slas/policies/36"	method := "DELETE"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/slas/policies/36")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("DELETE", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'DELETE',  url: 'https://example.zendesk.com/api/v2/slas/policies/36',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/slas/policies/36"headers = {	"Content-Type": "application/json",}
response = requests.request(	"DELETE",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/slas/policies/36")request = Net::HTTP::Delete.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

204 No Content
// Status 204 No Content
null

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

NameTypeInRequiredDescription
sla_policy_idsarrayQueryfalseThe IDs of the SLA Policies to reorder

Code Samples

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}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/slas/policies/reorder?sla_policy_ids="	method := "PUT"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "username:password"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close(