Group SLA Policies
A Group Service Level Agreement (SLA) is a documented agreement between a support provider and their customers that specifies support performance measures for a group of agents. Group SLAs are often expressed as follows:
*For urgent incidents, the tier 1 group solves or reassigns the ticket to another group within 10 minutes. *For high-priority incidents, the tier 3 group solves or reassign the ticket to another group the ticket within 30 minutes.
Because there may be different Group SLAs for each customer or group of customers, the support provider should define a Group SLA policy for each unique Group SLA's requirements.
All related endpoints are available on the Enterprise plans and above. Only admins are allowed to access the endpoints.
JSON format
Group 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 Group SLA policy was created |
| description | string | false | false | The description of the Group SLA policy |
| filter | object | false | true | An object that describes the conditions a ticket must match for a Group SLA policy to be applied to the ticket. See Filter. |
| id | string | true | false | Automatically assigned when created |
| policy_metrics | array | false | false | Array of policy metric objects |
| position | integer | false | false | Position of the Group SLA policy. This position determines the order in which policies are matched to tickets. If not specified, the Group SLA policy is added at the last position |
| title | string | false | true | The title of the Group SLA policy |
| updated_at | string | true | false | The time of the last update of the Group SLA policy |
| url | string | true | false | URL of the Group SLA policy record |
Filter
A filter checks the value of ticket fields and selects the ticket if the conditions are met. The filter is represented as a JSON object with two arrays of one or more conditions. For Group SLA Policy objects, at least one filter with the field "group_id" is mandatory.
Example
{"filter": {"all": [{ "field": "group_id", "operator": "includes", "value": [10001] },]}}
The array lists all the conditions that must be met.
| Name | Type | Description |
|---|---|---|
all | array | Logical AND. Tickets must fulfill all 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": "group_id", "operator": "includes", "value": [10001] }
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 with have the following properties:
| 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 total time within which the end-state for a metric should be met, measured in minutes |
| target_in_seconds | integer | The total time within which the end-state for a metric should be met, measured in seconds |
| business_hours | boolean | Whether the metric targets are being measured in business hours or calendar hours |
Example
{"priority": "low","metric": "group_ownership_time","target": 3600,"business_hours": false}
Metrics
| Metric | Value |
|---|---|
| Group Ownership Time | group_ownership_time |
Example
{"created_at": "2023-03-17T22:50:26Z","description": "Group: Tier 1","filter": {"all": []},"id": "01H078CBDY28BZG7P6BONY09DN","policy_metrics": [{"business_hours": false,"metric": "group_ownership_time","priority": "low","target": 3600}],"position": 3,"title": "Tier 1","updated_at": "2023-03-17T22:50:26Z","url": "https://company.zendesk.com/api/v2/group_slas/policies/01H078CBDY28BZG7P6BONY09DN"}
List Group SLA Policies
GET /api/v2/group_slas/policies
Availability
- Accounts on the Professional and Enterprise plans
Allowed For
- Admins
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/group_slas/policies \-H "Content-Type: application/json" \-H "Authorization: Bearer {access_token}"
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/group_slas/policies"method := "GET"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Authorization", "Bearer ${authToken}")req.Header.Add("Content-Type", "application/json")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/group_slas/policies").newBuilder();Request request = new Request.Builder().url(urlBuilder.build()).method("GET", null).addHeader("Authorization", "Bearer ${authToken}").addHeader("Content-Type", "application/json").build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'GET',url: 'https://example.zendesk.com/api/v2/group_slas/policies',headers: {'Authorization': 'Bearer ${authToken}','Content-Type': 'application/json',},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsurl = "https://example.zendesk.com/api/v2/group_slas/policies"headers = {"Authorization": "Bearer ${authToken}","Content-Type": "application/json",}response = requests.request("GET",url,headers=headers)print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/group_slas/policies")request = Net::HTTP::Get.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")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,"group_sla_policies": [{"description": "For low priority tickets, the Tier 1 group will solve or reassign the ticket in one hour.","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}],"any": []},"id": "01H078CBDY28BZG7P6BONY09DN","policy_metrics": [{"business_hours": false,"metric": "group_ownership_time","priority": "low","target": 3600,"target_in_seconds": 216000}],"position": 3,"title": "Incidents","url": "https://{subdomain}.zendesk.com/api/v2/group_slas/policies/01H078CBDY28BZG7P6BONY09DN"}],"next_page": null,"previous_page": null}
401 Unauthorized
// Status 401 Unauthorized{"error": {"message": "You must supply credentials to complete this request","title": "Unauthorized"}}
403 Forbidden
// Status 403 Forbidden{"error": {"message": "You do not have access to this page. Please contact the account owner of this help desk for further help.","title": "Forbidden"}}
Show Group SLA Policy
GET /api/v2/group_slas/policies/{group_sla_policy_id}
Availability
- Accounts on the Professional and Enterprise plans
Allowed For
- Admins
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| group_sla_policy_id | string | Path | true | The id of the Group SLA policy |
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/group_slas/policies/{group_sla_policy_id} \-H "Content-Type: application/json" \-H "Authorization: Bearer {access_token}"
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY"method := "GET"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Authorization", "Bearer ${authToken}")req.Header.Add("Content-Type", "application/json")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/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY").newBuilder();Request request = new Request.Builder().url(urlBuilder.build()).method("GET", null).addHeader("Authorization", "Bearer ${authToken}").addHeader("Content-Type", "application/json").build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'GET',url: 'https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY',headers: {'Authorization': 'Bearer ${authToken}','Content-Type': 'application/json',},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsurl = "https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY"headers = {"Authorization": "Bearer ${authToken}","Content-Type": "application/json",}response = requests.request("GET",url,headers=headers)print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY")request = Net::HTTP::Get.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")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{"group_sla_policy": {"description": "Low priority tickets assigned to the group with id 6 will be completed or reassigned in one hour.","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}],"any": []},"id": "01H078CBDY28BZG7P6BONY09DN","policy_metrics": [{"business_hours": false,"metric": "group_ownership_time","priority": "low","target": 3600,"target_in_seconds": 216000}],"position": 3,"title": "Incidents","url": "https://{subdomain}.zendesk.com/api/v2/group_slas/policies/01H078CBDY28BZG7P6BONY09DN"}}
401 Unauthorized
// Status 401 Unauthorized{"error": {"message": "You must supply credentials to complete this request","title": "Unauthorized"}}
403 Forbidden
// Status 403 Forbidden{"error": {"message": "You do not have access to this page. Please contact the account owner of this help desk for further help.","title": "Forbidden"}}
404 Not Found
// Status 404 Not Found{"error": {"message": "You’ve reached this page because what you were looking for does not exist or there’s been an error.","title": "Not Found"}}
Create Group SLA Policy
POST /api/v2/group_slas/policies
Allowed For
- Admins
Example body
{"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}}
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/group_slas/policies \-H "Content-Type: application/json" \-d '{"group_sla_policy": {"title": "Tier 1 Group SLA","description": "Tier 1 Group SLA","position": 3,"filter": {"all": [{ "field": "group_id", "operator": "includes", "value": [6] }]},"policy_metrics": [{ "priority": "normal", "metric": "group_ownership_time", "target": 1800, "business_hours": true },{ "priority": "urgent", "metric": "group_ownership_time", "target": 600, "business_hours": false },]}}' \-H "Authorization: Bearer {access_token}" -X POST
Go
import ("fmt""io""net/http""strings")func main() {url := "https://example.zendesk.com/api/v2/group_slas/policies"method := "POST"payload := strings.NewReader(`{"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}}`)req, err := http.NewRequest(method, url, payload)if err != nil {fmt.Println(err)return}req.Header.Add("Authorization", "Bearer ${authToken}")req.Header.Add("Content-Type", "application/json")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/group_slas/policies").newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),"""{\"group_sla_policy\": {\"description\": \"Tier 1 Group SLA\",\"filter\": {\"all\": [{\"field\": \"group_id\",\"operator\": \"includes\",\"value\": [6]}]},\"policy_metrics\": [{\"business_hours\": true,\"metric\": \"group_ownership_time\",\"priority\": \"normal\",\"target\": 1800},{\"business_hours\": false,\"metric\": \"group_ownership_time\",\"priority\": \"urgent\",\"target\": 600}],\"position\": 3,\"title\": \"Tier 1 Group SLA\"}}""");Request request = new Request.Builder().url(urlBuilder.build()).method("POST", body).addHeader("Authorization", "Bearer ${authToken}").addHeader("Content-Type", "application/json").build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}});var config = {method: 'POST',url: 'https://example.zendesk.com/api/v2/group_slas/policies',headers: {'Authorization': 'Bearer ${authToken}','Content-Type': 'application/json',},data : data,};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsimport jsonurl = "https://example.zendesk.com/api/v2/group_slas/policies"payload = json.loads("""{"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}}""")headers = {"Authorization": "Bearer ${authToken}","Content-Type": "application/json",}response = requests.request("POST",url,headers=headers,json=payload)print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/group_slas/policies")request = Net::HTTP::Post.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")request.body = %q({"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}})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{"group_sla_policy": {"description": "The group with id 6 will have to solve or reassign normal priority tickets in 30 minutes and urgent tickets in 10.","filter": {"all": [{"field": "group_ownership_time","operator": "includes","value": [6]}]},"id": "01H078CBDY28BZG7P6BONY09DN","policy_metrics": [{"business_hours": false,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Incidents","url": "https://{subdomain}.zendesk.com/api/v2/group_slas/policies/01H078CBDY28BZG7P6BONY09DN"}}
Update Group SLA Policy
PUT /api/v2/group_slas/policies/{group_sla_policy_id}
Updates the specified policy.
Allowed For
- Admins
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| group_sla_policy_id | string | Path | true | The id of the Group SLA policy |
Example body
{"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}}
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/group_slas/policies/{group_sla_policy_id} \-H "Content-Type: application/json" \-d '{"group_sla_policy": {"title": "Tier 1 Group SLA","description": "Tier 1 Group SLA","position": 3,"filter": {"all": [{ "field": "group_id", "operator": "includes", "value": [6] }]},"policy_metrics": [{ "priority": "normal", "metric": "group_ownership_time", "target": 1800, "business_hours": true },{ "priority": "urgent", "metric": "group_ownership_time", "target": 600, "business_hours": false },]}}' \-H "Authorization: Bearer {access_token}" -X PUT
Go
import ("fmt""io""net/http""strings")func main() {url := "https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY"method := "PUT"payload := strings.NewReader(`{"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}}`)req, err := http.NewRequest(method, url, payload)if err != nil {fmt.Println(err)return}req.Header.Add("Authorization", "Bearer ${authToken}")req.Header.Add("Content-Type", "application/json")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/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY").newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),"""{\"group_sla_policy\": {\"description\": \"Tier 1 Group SLA\",\"filter\": {\"all\": [{\"field\": \"group_id\",\"operator\": \"includes\",\"value\": [6]}]},\"policy_metrics\": [{\"business_hours\": true,\"metric\": \"group_ownership_time\",\"priority\": \"normal\",\"target\": 1800},{\"business_hours\": false,\"metric\": \"group_ownership_time\",\"priority\": \"urgent\",\"target\": 600}],\"position\": 3,\"title\": \"Tier 1 Group SLA\"}}""");Request request = new Request.Builder().url(urlBuilder.build()).method("PUT", body).addHeader("Authorization", "Bearer ${authToken}").addHeader("Content-Type", "application/json").build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}});var config = {method: 'PUT',url: 'https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY',headers: {'Authorization': 'Bearer ${authToken}','Content-Type': 'application/json',},data : data,};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsimport jsonurl = "https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY"payload = json.loads("""{"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}}""")headers = {"Authorization": "Bearer ${authToken}","Content-Type": "application/json",}response = requests.request("PUT",url,headers=headers,json=payload)print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY")request = Net::HTTP::Put.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")request.body = %q({"group_sla_policy": {"description": "Tier 1 Group SLA","filter": {"all": [{"field": "group_id","operator": "includes","value": [6]}]},"policy_metrics": [{"business_hours": true,"metric": "group_ownership_time","priority": "normal","target": 1800},{"business_hours": false,"metric": "group_ownership_time","priority": "urgent","target": 600}],"position": 3,"title": "Tier 1 Group SLA"}})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{"group_sla_policy": {"description": "Normal priority tickets assigned to the groups 6 or 7 will be completed or reassigned in 30 minutes.","filter": {"all": [{"field": "group_id","operator": "includes","value": [6,7]}]},"id": "01H078CBDY28BZG7P6BONY09DN","policy_metrics": [{"business_hours": false,"metric": "group_ownership_time","priority": "normal","target": 1800}],"position": 3,"title": "Urgent Incidents","url": "https://{subdomain}.zendesk.com/api/v2/group_slas/policies/01H078CBDY28BZG7P6BONY09DN"}}
Delete Group SLA Policy
DELETE /api/v2/group_slas/policies/{group_sla_policy_id}
Allowed For
- Admins
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| group_sla_policy_id | string | Path | true | The id of the Group SLA policy |
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/group_slas/policies/{group_sla_policy_id} \-H "Content-Type: application/json" \-H "Authorization: Bearer {access_token}" -X DELETE
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY"method := "DELETE"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Authorization", "Bearer ${authToken}")req.Header.Add("Content-Type", "application/json")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/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY").newBuilder();Request request = new Request.Builder().url(urlBuilder.build()).method("DELETE", null).addHeader("Authorization", "Bearer ${authToken}").addHeader("Content-Type", "application/json").build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'DELETE',url: 'https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY',headers: {'Authorization': 'Bearer ${authToken}','Content-Type': 'application/json',},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsurl = "https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY"headers = {"Authorization": "Bearer ${authToken}","Content-Type": "application/json",}response = requests.request("DELETE",url,headers=headers)print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/group_slas/policies/01G7ZF5XCJJEBZRCG9V5BVJZCY")request = Net::HTTP::Delete.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")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 Contentnull
Reorder Group SLA Policies
PUT /api/v2/group_slas/policies/reorder
Reorders the group SLA policies. The new order is set in a group_sla_policy_ids array in the JSON request body.
Allowed For
- Admins
Example body
{"group_sla_policy_ids": ["01GBNW21N2XR7DKHRSRZW0FR97","01GBNW2B51EWT9SE077G33X2ZA"]}
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/group_slas/policies/reorder \-H "Content-Type: application/json" -X PUT \-d '{"group_sla_policy_ids": ["01H078CBDY28BZG7P6BONY09DN", "01K078CBDY28BZG7P9BONY09DN"]}' \-H "Authorization: Bearer {access_token}"
Go
import ("fmt""io""net/http""strings")func main() {url := "https://example.zendesk.com/api/v2/group_slas/policies/reorder"method := "PUT"payload := strings.NewReader(`{"group_sla_policy_ids": ["01GBNW21N2XR7DKHRSRZW0FR97","01GBNW2B51EWT9SE077G33X2ZA"]}`)req, err := http.NewRequest(method, url, payload)if err != nil {fmt.Println(err)return}req.Header.Add("Authorization", "Bearer ${authToken}")req.Header.Add("Content-Type", "application/json")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/group_slas/policies/reorder").newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),"""{\"group_sla_policy_ids\": [\"01GBNW21N2XR7DKHRSRZW0FR97\",\"01GBNW2B51EWT9SE077G33X2ZA\"]}""");Request request = new Request.Builder().url(urlBuilder.build()).method("PUT", body).addHeader("Authorization", "Bearer ${authToken}").addHeader("Content-Type", "application/json").build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({"group_sla_policy_ids": ["01GBNW21N2XR7DKHRSRZW0FR97","01GBNW2B51EWT9SE077G33X2ZA"]});var config = {method: 'PUT',url: 'https://example.zendesk.com/api/v2/group_slas/policies/reorder',headers: {'Authorization': 'Bearer ${authToken}','Content-Type': 'application/json',},data : data,};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsimport jsonurl = "https://example.zendesk.com/api/v2/group_slas/policies/reorder"payload = json.loads("""{"group_sla_policy_ids": ["01GBNW21N2XR7DKHRSRZW0FR97","01GBNW2B51EWT9SE077G33X2ZA"]}""")headers = {"Authorization": "Bearer ${authToken}","Content-Type": "application/json",}response = requests.request("PUT",url,headers=headers,json=payload)print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/group_slas/policies/reorder")request = Net::HTTP::Put.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")request.body = %q({"group_sla_policy_ids": ["01GBNW21N2XR7DKHRSRZW0FR97","01GBNW2B51EWT9SE077G33X2ZA"]})response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|http.request(request)end
Example response(s)
200 OK
// Status 200 OKnull
400 Bad Request
// Status 400 Bad Requestnull
401 Unauthorized
// Status 401 Unauthorized{"error": {"message": "You must supply credentials to complete this request","title": "Unauthorized"}}
403 Forbidden
// Status 403 Forbidden{"error": {"message": "You do not have access to this page. Please contact the account owner of this help desk for further help.","title": "Forbidden"}}
422 Unprocessable Entity
// Status 422 Unprocessable Entity{"error": "Invalid argument"}
Retrieve Supported Filter Definition Items
GET /api/v2/group_slas/policies/definitions
Allowed For
- Admins
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/group_slas/policies/definitions \-H "Content-Type: application/json" \-H "Authorization: Bearer {access_token}" -X GET
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/group_slas/policies/definitions"method := "GET"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Authorization", "Bearer ${authToken}")req.Header.Add("Content-Type", "application/json")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/group_slas/policies/definitions").newBuilder();Request request = new Request.Builder().url(urlBuilder.build()).method("GET", null).addHeader("Authorization", "Bearer ${authToken}").addHeader("Content-Type", "application/json").build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'GET',url: 'https://example.zendesk.com/api/v2/group_slas/policies/definitions',headers: {'Authorization': 'Bearer ${authToken}','Content-Type': 'application/json',},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsurl = "https://example.zendesk.com/api/v2/group_slas/policies/definitions"headers = {"Authorization": "Bearer ${authToken}","Content-Type": "application/json",}response = requests.request("GET",url,headers=headers)print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/group_slas/policies/definitions")request = Net::HTTP::Get.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")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{"definitions": {"all": [{"group": "ticket","operators": [{"title": "Contains at least one of the following","value": "includes"},{"title": "Contains at least none of the following","value": "not_includes"}],"output_key": null,"target": null,"title": "Group","title_for_field": "Group","value": "group_id","values": {"list": [{"title": "Tier 1","value": 6}],"type": "list"}}],"any": [{"group": "ticket","operators": [{"title": "Contains at least one of the following","value": "includes"},{"title": "Contains at least none of the following","value": "not_includes"}],"output_key": null,"target": null,"title": "Group","title_for_field": "Group","value": "group_id","values": {"list": [{"title": "Tier 1","value": 6}],"type": "list"}}]}}
List Ticket Group SLA Policy Metrics
GET /api/v2/tickets/{ticket_id}/group_slas/policy_metrics
Returns the Group SLA (OLA) policy metrics for a specific ticket.
Availability
- Accounts on the Enterprise plan
Allowed For
- Admins
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| ticket_id | integer | Path | true | The ID of the ticket |
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/tickets/{ticket_id}/group_slas/policy_metrics \-H "Authorization: Bearer {access_token}"
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/tickets/123456/group_slas/policy_metrics"method := "GET"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Authorization", "Bearer ${authToken}")req.Header.Add("Content-Type", "application/json")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/tickets/123456/group_slas/policy_metrics").newBuilder();Request request = new Request.Builder().url(urlBuilder.build()).method("GET", null).addHeader("Authorization", "Bearer ${authToken}").addHeader("Content-Type", "application/json").build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'GET',url: 'https://example.zendesk.com/api/v2/tickets/123456/group_slas/policy_metrics',headers: {'Authorization': 'Bearer ${authToken}','Content-Type': 'application/json',},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsurl = "https://example.zendesk.com/api/v2/tickets/123456/group_slas/policy_metrics"headers = {"Authorization": "Bearer ${authToken}","Content-Type": "application/json",}response = requests.request("GET",url,headers=headers)print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/tickets/123456/group_slas/policy_metrics")request = Net::HTTP::Get.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")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{"policy_metrics": [{"breach_at": "2023-01-19T02:14:27+00:00","metric": "group_ownership_time","minutes": -19,"stage": "active"}]}