Import users and tickets into Zendesk QA

JSON format

Import are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
assigneeEmailstringfalsetrueEmail of the assigned agent
assigneeNamestringfalsefalseName of the assigned agent
commentsarrayfalsefalseList of imported comments
createdstringfalsefalseTicket creation timestamp (ISO 8601)
customerEmailstringfalsefalseCustomer email
customerNamestringfalsefalseCustomer name
descriptionstringfalsefalseTicket description
externalIdstringfalsetrueExternal ticket ID
importedstringfalsefalseImport timestamp (ISO 8601)
internalIdintegerfalsetrueInternal ticket ID assigned by Zendesk QA
statusstringfalsefalseTicket status
subjectstringfalsetrueTicket subject
tagsarrayfalsefalseTags associated with the ticket
ticketFieldsarrayfalsefalseCustom ticket fields
updatedstringfalsefalseTicket last update timestamp (ISO 8601)
urlstringfalsefalseExternal URL to the ticket

Details of an imported ticket

Import tickets

  • POST /qa/api/import/tickets

Import ticket data into Zendesk QA. Accepts a batch of up to 100 tickets, each with up to 500 comments. Each ticket must have a unique external ID and assignee email for all the available payload parameters.

Example body

{  "data": [    {      "assigneeEmail": "[email protected]",      "assigneeName": "Jane Smith",      "comments": [        {          "authorEmail": "[email protected]",          "authorIsNotClient": false,          "authorName": "Alice Customer",          "comment": "Hi, I'd like to learn about your advanced features.",          "created": "2024-01-15T10:30:00Z",          "id": "COMMENT-001",          "public": true        }      ],      "created": "2024-01-15T10:30:00Z",      "customerEmail": "[email protected]",      "customerName": "Alice Customer",      "description": "Customer wants to know more about advanced features",      "id": "TICKET-12345",      "status": "solved",      "subject": "Customer inquiry about product features",      "tags": [        "feature-inquiry",        "high-priority"      ],      "updated": "2024-01-15T14:20:00Z"    }  ]}

Code Samples

Curl
curl --request POST https://yoursubdomain.zendesk.com/qa/api/import/tickets \--header "Authorization: Bearer ${authToken}" \--header "Content-Type: application/json" \--data-raw '{  "data": [    {      "assigneeEmail": "[email protected]",      "assigneeName": "Jane Smith",      "comments": [        {          "authorEmail": "[email protected]",          "authorIsNotClient": false,          "authorName": "Alice Customer",          "comment": "Hi, I'd like to learn about your advanced features.",          "created": "2024-01-15T10:30:00Z",          "id": "COMMENT-001",          "public": true        }      ],      "created": "2024-01-15T10:30:00Z",      "customerEmail": "[email protected]",      "customerName": "Alice Customer",      "description": "Customer wants to know more about advanced features",      "id": "TICKET-12345",      "status": "solved",      "subject": "Customer inquiry about product features",      "tags": [        "feature-inquiry",        "high-priority"      ],      "updated": "2024-01-15T14:20:00Z"    }  ]}'
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://yoursubdomain.zendesk.com/qa/api/import/tickets"	method := "POST"	payload := strings.NewReader(`{  "data": [    {      "assigneeEmail": "[email protected]",      "assigneeName": "Jane Smith",      "comments": [        {          "authorEmail": "[email protected]",          "authorIsNotClient": false,          "authorName": "Alice Customer",          "comment": "Hi, I'd like to learn about your advanced features.",          "created": "2024-01-15T10:30:00Z",          "id": "COMMENT-001",          "public": true        }      ],      "created": "2024-01-15T10:30:00Z",      "customerEmail": "[email protected]",      "customerName": "Alice Customer",      "description": "Customer wants to know more about advanced features",      "id": "TICKET-12345",      "status": "solved",      "subject": "Customer inquiry about product features",      "tags": [        "feature-inquiry",        "high-priority"      ],      "updated": "2024-01-15T14:20:00Z"    }  ]}`)	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://yoursubdomain.zendesk.com/qa/api/import/tickets")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"data\": [    {      \"assigneeEmail\": \"agent@example.com\",      \"assigneeName\": \"Jane Smith\",      \"comments\": [        {          \"authorEmail\": \"alice@customer.com\",          \"authorIsNotClient\": false,          \"authorName\": \"Alice Customer\",          \"comment\": \"Hi, I'd like to learn about your advanced features.\",          \"created\": \"2024-01-15T10:30:00Z\",          \"id\": \"COMMENT-001\",          \"public\": true        }      ],      \"created\": \"2024-01-15T10:30:00Z\",      \"customerEmail\": \"alice@customer.com\",      \"customerName\": \"Alice Customer\",      \"description\": \"Customer wants to know more about advanced features\",      \"id\": \"TICKET-12345\",      \"status\": \"solved\",      \"subject\": \"Customer inquiry about product features\",      \"tags\": [        \"feature-inquiry\",        \"high-priority\"      ],      \"updated\": \"2024-01-15T14:20:00Z\"    }  ]}""");
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({  "data": [    {      "assigneeEmail": "[email protected]",      "assigneeName": "Jane Smith",      "comments": [        {          "authorEmail": "[email protected]",          "authorIsNotClient": false,          "authorName": "Alice Customer",          "comment": "Hi, I'd like to learn about your advanced features.",          "created": "2024-01-15T10:30:00Z",          "id": "COMMENT-001",          "public": true        }      ],      "created": "2024-01-15T10:30:00Z",      "customerEmail": "[email protected]",      "customerName": "Alice Customer",      "description": "Customer wants to know more about advanced features",      "id": "TICKET-12345",      "status": "solved",      "subject": "Customer inquiry about product features",      "tags": [        "feature-inquiry",        "high-priority"      ],      "updated": "2024-01-15T14:20:00Z"    }  ]});
var config = {  method: 'POST',  url: 'https://yoursubdomain.zendesk.com/qa/api/import/tickets',  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 json
url = "https://yoursubdomain.zendesk.com/qa/api/import/tickets"
payload = json.loads("""{  "data": [    {      "assigneeEmail": "[email protected]",      "assigneeName": "Jane Smith",      "comments": [        {          "authorEmail": "[email protected]",          "authorIsNotClient": false,          "authorName": "Alice Customer",          "comment": "Hi, I'd like to learn about your advanced features.",          "created": "2024-01-15T10:30:00Z",          "id": "COMMENT-001",          "public": true        }      ],      "created": "2024-01-15T10:30:00Z",      "customerEmail": "[email protected]",      "customerName": "Alice Customer",      "description": "Customer wants to know more about advanced features",      "id": "TICKET-12345",      "status": "solved",      "subject": "Customer inquiry about product features",      "tags": [        "feature-inquiry",        "high-priority"      ],      "updated": "2024-01-15T14:20:00Z"    }  ]}""")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://yoursubdomain.zendesk.com/qa/api/import/tickets")request = Net::HTTP::Post.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")request.body = %q({  "data": [    {      "assigneeEmail": "[email protected]",      "assigneeName": "Jane Smith",      "comments": [        {          "authorEmail": "[email protected]",          "authorIsNotClient": false,          "authorName": "Alice Customer",          "comment": "Hi, I'd like to learn about your advanced features.",          "created": "2024-01-15T10:30:00Z",          "id": "COMMENT-001",          "public": true        }      ],      "created": "2024-01-15T10:30:00Z",      "customerEmail": "[email protected]",      "customerName": "Alice Customer",      "description": "Customer wants to know more about advanced features",      "id": "TICKET-12345",      "status": "solved",      "subject": "Customer inquiry about product features",      "tags": [        "feature-inquiry",        "high-priority"      ],      "updated": "2024-01-15T14:20:00Z"    }  ]})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
null
400 Bad Request
// Status 400 Bad Request
{  "error": "max 100 tickets allowed in single request"}
401 Unauthorized
// Status 401 Unauthorized
{  "error": "Invalid or missing Authorization header"}
500 Internal Server Error
// Status 500 Internal Server Error
{  "error": "An unexpected error occurred"}

Delete imported tickets

  • DELETE /qa/api/import/tickets

Delete previously imported tickets by their external IDs. Accepts a list of ticket external IDs to remove.

Parameters

NameTypeInRequiredDescription
ticketExternalIdsarrayQueryfalse

Example body

{  "ticketExternalIds": [    "TICKET-12345",    "TICKET-67890"  ]}

Code Samples

Curl
curl --request DELETE https://yoursubdomain.zendesk.com/qa/api/import/tickets?ticketExternalIds= \--header "Authorization: Bearer ${authToken}" \--header "Content-Type: application/json" \--data-raw '{  "ticketExternalIds": [    "TICKET-12345",    "TICKET-67890"  ]}'
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://yoursubdomain.zendesk.com/qa/api/import/tickets?ticketExternalIds="	method := "DELETE"	payload := strings.NewReader(`{  "ticketExternalIds": [    "TICKET-12345",    "TICKET-67890"  ]}`)	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://yoursubdomain.zendesk.com/qa/api/import/tickets")		.newBuilder()		.addQueryParameter("ticketExternalIds", "");
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 data = JSON.stringify({  "ticketExternalIds": [    "TICKET-12345",    "TICKET-67890"  ]});
var config = {  method: 'DELETE',  url: 'https://yoursubdomain.zendesk.com/qa/api/import/tickets',  headers: {	'Authorization': 'Bearer ${authToken}',	'Content-Type': 'application/json',  },  params: {    'ticketExternalIds': '',  },  data : data,};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsimport json
url = "https://yoursubdomain.zendesk.com/qa/api/import/tickets?ticketExternalIds="
payload = json.loads("""{  "ticketExternalIds": [    "TICKET-12345",    "TICKET-67890"  ]}""")headers = {	"Authorization": "Bearer ${authToken}",	"Content-Type": "application/json",}
response = requests.request(	"DELETE",	url,	headers=headers,	json=payload)
print(response.text)
Ruby
require "net/http"uri = URI("https://yoursubdomain.zendesk.com/qa/api/import/tickets")uri.query = URI.encode_www_form("ticketExternalIds": "")request = Net::HTTP::Delete.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")request.body = %q({  "ticketExternalIds": [    "TICKET-12345",    "TICKET-67890"  ]})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
null
400 Bad Request
// Status 400 Bad Request
{  "error": "max 100 tickets allowed in single request"}
401 Unauthorized
// Status 401 Unauthorized
{  "error": "Invalid or missing Authorization header"}
500 Internal Server Error
// Status 500 Internal Server Error
{  "error": "An unexpected error occurred"}

Get imported ticket

  • GET /qa/api/import/tickets/{ticketExternalId}

Retrieve details of a previously imported ticket by its external ID, including all associated comments and fields.

Parameters

NameTypeInRequiredDescription
ticketExternalIdstringPathtrueThe external ID of the ticket to retrieve

Code Samples

Curl
curl --request GET https://yoursubdomain.zendesk.com/qa/api/import/tickets/TICKET-12345 \--header "Authorization: Bearer ${authToken}" \--header "Content-Type: application/json"
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://yoursubdomain.zendesk.com/qa/api/import/tickets/TICKET-12345"	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://yoursubdomain.zendesk.com/qa/api/import/tickets/TICKET-12345")		.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://yoursubdomain.zendesk.com/qa/api/import/tickets/TICKET-12345',  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 requests
url = "https://yoursubdomain.zendesk.com/qa/api/import/tickets/TICKET-12345"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://yoursubdomain.zendesk.com/qa/api/import/tickets/TICKET-12345")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
{  "data": {    "assigneeEmail": "[email protected]",    "assigneeName": "Jane Smith",    "comments": [      {        "authorEmail": "[email protected]",        "authorName": "Alice Customer",        "comment": "Hi, I'd like to learn about your advanced features.",        "created": "2024-01-15T10:30:00Z",        "externalId": "COMMENT-001",        "imported": "2024-01-15T15:00:00Z",        "internalId": 0,        "public": true      }    ],    "created": "2024-01-15T10:30:00Z",    "customerEmail": "[email protected]",    "customerName": "Alice Customer",    "description": "Customer wants to know more about advanced features",    "externalId": "TICKET-12345",    "imported": "2024-01-15T15:00:00Z",    "internalId": 98765,    "status": "solved",    "subject": "Customer inquiry about product features",    "tags": [      "feature-inquiry",      "high-priority"    ],    "updated": "2024-01-15T14:20:00Z",    "url": "https://support.example.com/tickets/12345"  }}
204 No Content
// Status 204 No Content
null
401 Unauthorized
// Status 401 Unauthorized
{  "error": "Invalid or missing Authorization header"}
500 Internal Server Error
// Status 500 Internal Server Error
{  "error": "An unexpected error occurred"}

Import users

  • POST /qa/api/import/users

Import user data into Zendesk QA. Accepts a batch of user records with email and optional name.

Example body

{  "data": [    {      "userEmail": "[email protected]",      "userName": "Jane Smith"    },    {      "userEmail": "[email protected]",      "userName": "John Doe"    }  ]}

Code Samples

Curl
curl --request POST https://yoursubdomain.zendesk.com/qa/api/import/users \--header "Authorization: Bearer ${authToken}" \--header "Content-Type: application/json" \--data-raw '{  "data": [    {      "userEmail": "[email protected]",      "userName": "Jane Smith"    },    {      "userEmail": "[email protected]",      "userName": "John Doe"    }  ]}'
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://yoursubdomain.zendesk.com/qa/api/import/users"	method := "POST"	payload := strings.NewReader(`{  "data": [    {      "userEmail": "[email protected]",      "userName": "Jane Smith"    },    {      "userEmail": "[email protected]",      "userName": "John Doe"    }  ]}`)	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://yoursubdomain.zendesk.com/qa/api/import/users")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"data\": [    {      \"userEmail\": \"agent@example.com\",      \"userName\": \"Jane Smith\"    },    {      \"userEmail\": \"manager@example.com\",      \"userName\": \"John Doe\"    }  ]}""");
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({  "data": [    {      "userEmail": "[email protected]",      "userName": "Jane Smith"    },    {      "userEmail": "[email protected]",      "userName": "John Doe"    }  ]});
var config = {  method: 'POST',  url: 'https://yoursubdomain.zendesk.com/qa/api/import/users',  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 json
url = "https://yoursubdomain.zendesk.com/qa/api/import/users"
payload = json.loads("""{  "data": [    {      "userEmail": "[email protected]",      "userName": "Jane Smith"    },    {      "userEmail": "[email protected]",      "userName": "John Doe"    }  ]}""")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://yoursubdomain.zendesk.com/qa/api/import/users")request = Net::HTTP::Post.new(uri, "Authorization": "Bearer ${authToken}", "Content-Type": "application/json")request.body = %q({  "data": [    {      "userEmail": "[email protected]",      "userName": "Jane Smith"    },    {      "userEmail": "[email protected]",      "userName": "John Doe"    }  ]})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
null
400 Bad Request
// Status 400 Bad Request
{  "error": "max 100 tickets allowed in single request"}
401 Unauthorized
// Status 401 Unauthorized
{  "error": "Invalid or missing Authorization header"}
500 Internal Server Error
// Status 500 Internal Server Error
{  "error": "An unexpected error occurred"}