Job Status

A job status record is created when somebody kicks off a job such as updating agent statuses. You can access the job status data for one day after a particular job is created, after which the data is no longer available.

JSON format

Job statuses are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
idstringtruefalseThe job id
messagestringtruefalseA message describing the current status
progressintegertruefalseThe total number of completed items in the job
resultsarraytruefalseThe results of completed jobs will be shown, while pending jobs will be excluded. See Results
statusstringtruefalseThe current status. One of the following: "queued", "working", "completed"
totalintegertruefalseThe total number of items in the job
urlstringtruefalseThe URL to the job status

Get Job Statuses

  • GET /api/v2/agent_availabilities/agent_statuses/job_statuses/{job_id}

Get the job status of the bulk agent status update.

Allowed For

  • Admins

Parameters

NameTypeInRequiredDescription
job_idstringPathtrueThe job id

Code Samples

Curl
curl -v -u {email_address}/token:{api_token} \  --request GET 'https://example.zendesk.com/api/v2/agent_availabilities/agent_statuses/job_statuses/01JB1GQENJMK3X983SCQC0GAKE' \  --header 'Zendesk-Api-Version: 2023-02-01' \  --header 'Content-Type: application/json' \
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/agent_availabilities/agent_statuses/job_statuses/01JB1GQENJMK3X983SCQC0GAKE"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Zendesk-Api-Version", "2024-11-11")	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://support.zendesk.com/api/v2/agent_availabilities/agent_statuses/job_statuses/01JB1GQENJMK3X983SCQC0GAKE")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Zendesk-Api-Version", "2024-11-11")		.addHeader("Content-Type", "application/json")		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://support.zendesk.com/api/v2/agent_availabilities/agent_statuses/job_statuses/01JB1GQENJMK3X983SCQC0GAKE',  headers: {	'Zendesk-Api-Version': '2024-11-11',	'Content-Type': 'application/json',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/v2/agent_availabilities/agent_statuses/job_statuses/01JB1GQENJMK3X983SCQC0GAKE"headers = {	"Zendesk-Api-Version": "2024-11-11",	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/v2/agent_availabilities/agent_statuses/job_statuses/01JB1GQENJMK3X983SCQC0GAKE")request = Net::HTTP::Get.new(uri, "Zendesk-Api-Version": "2024-11-11", "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
{  "job_status": {    "id": "01JB1GQENJMK3X983SCQC0GAKE",    "message": "Job completed at 2024-11-11T11:12:11Z",    "progress": 2,    "results": [      {        "action": "update",        "agent_id": 10011,        "completed_at": "2024-11-11T11:11:11Z",        "error": null,        "status": "success"      },      {        "action": "update",        "agent_id": 10012,        "completed_at": "2024-11-11T11:12:11Z",        "error": "403 - NoEntitlements",        "status": "failed"      }    ],    "status": "completed",    "total": 2,    "url": "https://example.zendesk.com/api/v2/agent_availabilities/agent_statuses/job_statuses/01JB1GQENJMK3X983SCQC0GAKE"  }}
400 Bad Request
// Status 400 Bad Request
{  "errors": [    {      "code": "InvalidParameter",      "title": "Bad Request"    }  ]}
401 Unauthorized
// Status 401 Unauthorized
{  "errors": [    {      "code": "Unauthorized",      "title": "Authentication error"    }  ]}
403 Forbidden
// Status 403 Forbidden
{  "errors": [    {      "code": "InvalidPermissions",      "title": "Forbidden"    }  ]}
404 Not Found
// Status 404 Not Found
{  "errors": [    {      "code": "ResourceNotFound",      "title": "Not Found"    }  ]}
406 Not Acceptable
// Status 406 Not Acceptable
{  "errors": [    {      "code": "NotAcceptable",      "title": "Not Acceptable"    }  ]}
423 Locked
// Status 423 Locked
{  "errors": [    {      "code": "AccountLocked",      "title": "Account is locked"    }  ]}
429 Too Many Requests
// Status 429 Too Many Requests
{  "errors": [    {      "code": "TooManyRequests",      "title": "Too Many Requests"    }  ]}
500 Internal Server Error
// Status 500 Internal Server Error
{  "errors": [    {      "code": "InternalServerError",      "title": "Internal Server Error"    }  ]}