Custom object records are individual instances of your custom objects. You can use this API to manage custom object Records.

Custom Object Record Limitations

  • Each record has a maximum size of 32 KB
  • Each account can have a maximum of 50,000,000 custom object records
Additional limitations
  • Legacy plans might have other limitations.

JSON format

Custom Object Records are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
created_atstringtruefalseThe time the object was created
created_by_user_idstringtruefalseId of a user who created the object
custom_object_fieldsobjectfalsefalse
custom_object_keystringtruefalseA user-defined unique identifier
external_idstringfalsefalseAn id you can use to link custom object records to external data
idstringtruefalseAutomatically assigned upon creation
namestringtruetrueUser-defined display name for the object
updated_atstringtruefalseThe time of the last update of the object
updated_by_user_idstringtruefalseId of the last user who updated the object
urlstringtruefalseDirect link to the specific custom object

List Custom Object Records

  • GET /api/v2/custom_objects/{custom_object_key}/records

Lists all undeleted custom object records for the specified object

Pagination

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
filter[external_ids]stringQueryfalseOptional comma-separated list of external ids to filter records by. If one or more ids are specified, only matching records are returned. The ids must be unique and are case sensitive.
filter[ids]stringQueryfalseOptional comma-separated list of ids to filter records by. If one or more ids are specified, only matching records are returned. The ids must be unique and are case sensitive.
page[after]stringQueryfalseA pagination cursor that tells the endpoint which page to start on. It should be a meta.after_cursor value from a previous request. Note: page[before] and page[after] can't be used together in the same request.
page[before]stringQueryfalseA pagination cursor that tells the endpoint which page to start on. It should be a meta.before_cursor value from a previous request. Note: page[before] and page[after] can't be used together in the same request.
page[size]integerQueryfalseSpecifies how many records should be returned in the response. You can specify up to 100 records per page.
sortstringQueryfalseOne of id, updated_at, -id, or -updated_at. The - denotes the sort will be descending.
custom_object_keystringPathtrueThe key of a custom object

Code Samples

Curl
curl --request GET https://example.zendesk.com/api/v2/custom_objects/car/records?filter[external_ids]=&filter[ids]=&page[after]=&page[before]=&page[size]=&sort= \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records?filter[external_ids]=&filter[ids]=&page[after]=&page[before]=&page[size]=&sort="	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/custom_objects/car/records")		.newBuilder()		.addQueryParameter("filter[external_ids]", "")		.addQueryParameter("filter[ids]", "")		.addQueryParameter("page[after]", "")		.addQueryParameter("page[before]", "")		.addQueryParameter("page[size]", "")		.addQueryParameter("sort", "");
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/custom_objects/car/records',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'filter[external_ids]': '',    'filter[ids]': '',    'page[after]': '',    'page[before]': '',    'page[size]': '',    'sort': '',  },};
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/custom_objects/car/records?filter[external_ids]=&filter[ids]=&page[after]=&page[before]=&page[size]=&sort="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/custom_objects/car/records")uri.query = URI.encode_www_form("filter[external_ids]": "", "filter[ids]": "", "page[after]": "", "page[before]": "", "page[size]": "", "sort": "")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
curl - Get custom object records based on relevance
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records.json \  -v -u {email_address}:{password}
curl - Get custom object records with specified ids
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records?filter[ids]=123,456 \  -v -u {email_address}:{password}
curl - Get custom object records with specified external ids
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records?filter[external_ids]=123,456 \  -v -u {email_address}:{password}
curl - Get custom object records, 10 records per page, most recently updated record first
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records.json?page[size]=10sort=-updated_at  \  -v -u {email_address}:{password}

Example response(s)

200 OK
// Status 200 OK
{  "custom_object_records": [    {      "created_at": "2022-09-12T19:29:59Z",      "created_by_user_id": "10001",      "custom_object_fields": {        "make": "Tesla",        "model": "S"      },      "custom_object_key": "car",      "external_id": "Internal System Record 54848",      "id": "01GCSJW391QVSC80GYDH7E93Q6",      "name": "My Tesla CO record",      "updated_at": "2022-09-15T21:07:03Z",      "updated_by_user_id": "10001",      "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6.json"    },    {      "created_at": "2022-09-26T22:24:15Z",      "created_by_user_id": "123123",      "custom_object_fields": {        "make": "Honda",        "model": "Civic"      },      "custom_object_key": "car",      "external_id": null,      "id": "01GDXYD7ZTWYP542BA8MDDTE36",      "name": "My Tesla CO record2",      "updated_at": "2022-09-26T22:24:15Z",      "updated_by_user_id": "245159",      "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYD7ZTWYP542BA8MDDTE36.json"    }  ],  "links": {    "next": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records.json?page%5Bafter%5D=eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0%3D&page%5Bsize%5D=1&query=",    "prev": null  },  "meta": {    "after_cursor": "eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0=",    "before_cursor": null,    "has_more": true  }}

Show Custom Object Record

  • GET /api/v2/custom_objects/{custom_object_key}/records/{custom_object_record_id}

Returns a custom record for a specific object using a provided id.

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
custom_object_keystringPathtrueThe key of a custom object
custom_object_record_idstringPathtrueThe id of a custom object record

Code Samples

Curl
curl --request GET https://example.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6 \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6"	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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6")		.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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6',  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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6"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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6")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
curl - Get custom object record by id
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/{custom_object_record_id}.json \  -v -u {email_address}:{password}

Example response(s)

200 OK
// Status 200 OK
{  "custom_object_record": {    "created_at": "2022-09-26T22:25:10Z",    "created_by_user_id": "10001",    "custom_object_fields": {      "color": "white",      "make": "Tesla",      "model": "Y"    },    "custom_object_key": "car",    "external_id": null,    "id": "01GDXYEY1FQYN066VHF49YHJ21",    "name": "My Tesla",    "updated_at": "2022-09-26T22:25:10Z",    "updated_by_user_id": "10001",    "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYEY1FQYN066VHF49YHJ21.json"  }}

Create Custom Object Record

  • POST /api/v2/custom_objects/{custom_object_key}/records

Creates a custom object record according to all the properties described by a custom object definition

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
custom_object_keystringPathtrueThe key of a custom object

Example body

{  "custom_object_record": {    "custom_object_fields": {      "make": "Tesla",      "model": "Y"    },    "name": "My car 1"  }}

Code Samples

Curl
curl --request POST https://example.zendesk.com/api/v2/custom_objects/car/records \--header "Content-Type: application/json" \-u username:password \--data-raw '{  "custom_object_record": {    "custom_object_fields": {      "make": "Tesla",      "model": "Y"    },    "name": "My car 1"  }}'
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records"	method := "POST"	payload := strings.NewReader(`{  "custom_object_record": {    "custom_object_fields": {      "make": "Tesla",      "model": "Y"    },    "name": "My car 1"  }}`)	req, err := http.NewRequest(method, url, payload)
	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/custom_objects/car/records")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"custom_object_record\": {    \"custom_object_fields\": {      \"make\": \"Tesla\",      \"model\": \"Y\"    },    \"name\": \"My car 1\"  }}""");
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 data = JSON.stringify({  "custom_object_record": {    "custom_object_fields": {      "make": "Tesla",      "model": "Y"    },    "name": "My car 1"  }});
var config = {  method: 'POST',  url: 'https://example.zendesk.com/api/v2/custom_objects/car/records',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  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://example.zendesk.com/api/v2/custom_objects/car/records"
payload = json.loads("""{  "custom_object_record": {    "custom_object_fields": {      "make": "Tesla",      "model": "Y"    },    "name": "My car 1"  }}""")headers = {	"Content-Type": "application/json",}
response = requests.request(	"POST",	url,	auth=('<username>', '<password>'),	headers=headers,	json=payload)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/custom_objects/car/records")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")request.body = %q({  "custom_object_record": {    "custom_object_fields": {      "make": "Tesla",      "model": "Y"    },    "name": "My car 1"  }})request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end
curl - Create custom object record

For clarity, the example places the JSON in a separate file and imports it into the cURL statement

my_object.json

{  "custom_object_record": {    "name": "Personal Car",    "custom_object_fields": {      "make": "Tesla",      "model": "Y"  }}

curl - Create custom object record snippet

curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records.json \  -d @my_object.json \  -H "Content-Type: application/json" -v -u {email_address}:{password} -X POST

Example response(s)

201 Created
// Status 201 Created
{  "custom_object_record": {    "created_at": "2022-09-26T22:25:10Z",    "created_by_user_id": "10001",    "custom_object_fields": {      "color": "white",      "make": "Tesla",      "model": "Y"    },    "custom_object_key": "car",    "external_id": null,    "id": "01GDXYEY1FQYN066VHF49YHJ21",    "name": "My Tesla",    "updated_at": "2022-09-26T22:25:10Z",    "updated_by_user_id": "10001",    "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYEY1FQYN066VHF49YHJ21.json"  }}

Update Custom Object Record

  • PATCH /api/v2/custom_objects/{custom_object_key}/records/{custom_object_record_id}

Updates an individual custom object record. The updating rules are as follows:

  • Takes a custom_object_record object that specifies the properties to update
  • The custom object fields should be nested inside a custom_object_fields object

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
custom_object_keystringPathtrueThe key of a custom object
custom_object_record_idstringPathtrueThe id of a custom object record

Code Samples

Curl
curl --request PATCH https://example.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6 \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6"	method := "PATCH"	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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""""");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("PATCH", 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: 'PATCH',  url: 'https://example.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6',  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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6"headers = {	"Content-Type": "application/json",}
response = requests.request(	"PATCH",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6")request = Net::HTTP::Patch.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
curl - Update custom object record by id

For clarity, the example places the JSON in a separate file and imports it into the cURL statement

updated_record.json

{  "custom_object_record": {    "custom_object_fields": {      "model": "Civic",      "year": 2002    }  }}

curl - Update custom object record by id snippet

curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/{custom_object_record_id}.json \-d @updated_record.json \-H "Content-Type: application/json" -X PATCH \-v -u {email_address}:{password}

Example response(s)

200 OK
// Status 200 OK
{  "custom_object_record": {    "created_at": "2022-09-26T22:25:10Z",    "created_by_user_id": "10001",    "custom_object_fields": {      "color": "white",      "make": "Tesla",      "model": "Y"    },    "custom_object_key": "car",    "external_id": null,    "id": "01GDXYEY1FQYN066VHF49YHJ21",    "name": "My Tesla",    "updated_at": "2022-09-26T22:25:10Z",    "updated_by_user_id": "10001",    "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYEY1FQYN066VHF49YHJ21.json"  }}

Set Custom Object Record by External Id

  • PATCH /api/v2/custom_objects/{custom_object_key}/records?external_id={external_id}

If a record exists for the given external id, updates it. Only the specified attributes are updated. Otherwise, creates a new record with the provided external id and attributes.

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
external_idstringQuerytrueThe external id of a custom object record
custom_object_keystringPathtrueThe key of a custom object

Example body

{  "custom_object_record": {    "custom_object_fields": {      "make": "Oldsmobile",      "model": "Cutlass Supreme"    },    "name": "1997 Cutlass Supreme"  }}

Code Samples

Curl
curl --request PATCH https://example.zendesk.com/api/v2/custom_objects/car/records?external_id=X90001 \--header "Content-Type: application/json" \-u username:password \--data-raw '{  "custom_object_record": {    "custom_object_fields": {      "make": "Oldsmobile",      "model": "Cutlass Supreme"    },    "name": "1997 Cutlass Supreme"  }}'
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records?external_id=X90001"	method := "PATCH"	payload := strings.NewReader(`{  "custom_object_record": {    "custom_object_fields": {      "make": "Oldsmobile",      "model": "Cutlass Supreme"    },    "name": "1997 Cutlass Supreme"  }}`)	req, err := http.NewRequest(method, url, payload)
	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/custom_objects/car/records")		.newBuilder()		.addQueryParameter("external_id", "X90001");RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"custom_object_record\": {    \"custom_object_fields\": {      \"make\": \"Oldsmobile\",      \"model\": \"Cutlass Supreme\"    },    \"name\": \"1997 Cutlass Supreme\"  }}""");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("PATCH", 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 data = JSON.stringify({  "custom_object_record": {    "custom_object_fields": {      "make": "Oldsmobile",      "model": "Cutlass Supreme"    },    "name": "1997 Cutlass Supreme"  }});
var config = {  method: 'PATCH',  url: 'https://example.zendesk.com/api/v2/custom_objects/car/records',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'external_id': 'X90001',  },  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://example.zendesk.com/api/v2/custom_objects/car/records?external_id=X90001"
payload = json.loads("""{  "custom_object_record": {    "custom_object_fields": {      "make": "Oldsmobile",      "model": "Cutlass Supreme"    },    "name": "1997 Cutlass Supreme"  }}""")headers = {	"Content-Type": "application/json",}
response = requests.request(	"PATCH",	url,	auth=('<username>', '<password>'),	headers=headers,	json=payload)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/custom_objects/car/records")uri.query = URI.encode_www_form("external_id": "X90001")request = Net::HTTP::Patch.new(uri, "Content-Type": "application/json")request.body = %q({  "custom_object_record": {    "custom_object_fields": {      "make": "Oldsmobile",      "model": "Cutlass Supreme"    },    "name": "1997 Cutlass Supreme"  }})request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end
curl - Set custom object record

For clarity, the example places the JSON in a separate file and imports it into the cURL statement

my_object.json

{  "custom_object_record": {    "name": "1997 Cutlass Supreme",    "custom_object_fields": {      "make": "Oldsmobile",      "model": "Cutlass Supreme"  }}

curl - Set custom object record snippet

curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records.json?external_id={external_id} \  -d @my_object.json \  -H "Content-Type: application/json" -v -u {email_address}:{password} -X PATCH

Example response(s)

200 OK
// Status 200 OK
{  "custom_object_record": {    "created_at": "2023-09-26T22:25:10Z",    "created_by_user_id": "10001",    "custom_object_fields": {      "make": "Oldsmobile",      "model": "Cutlass Supreme"    },    "custom_object_key": "car",    "external_id": "X90001",    "id": "01GDXYEY1FQYN066VHF49YHJ21",    "name": "1997 Cutlass Supreme",    "updated_at": "2023-09-26T22:25:10Z",    "updated_by_user_id": "10001",    "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYEY1FQYN066VHF49YHJ21.json"  }}

Delete Custom Object Record

  • DELETE /api/v2/custom_objects/{custom_object_key}/records/{custom_object_record_id}

Deletes a record with the specified id

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
custom_object_keystringPathtrueThe key of a custom object
custom_object_record_idstringPathtrueThe id of a custom object record

Code Samples

Curl
curl --request DELETE https://example.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6 \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6"	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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6")		.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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6',  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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6"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/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6")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
curl - Delete custom object record by id
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/{custom_object_record_id}.json \  -X DELETE \  -v -u {email_address}:{password}

Example response(s)

204 No Content
// Status 204 No Content
null

Delete Custom Object Record by External Id

  • DELETE /api/v2/custom_objects/{custom_object_key}/records?external_id={external_id}

Deletes a record with the specified external id.

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
external_idstringQuerytrueThe external id of a custom object record
custom_object_keystringPathtrueThe key of a custom object

Code Samples

Curl
curl --request DELETE https://example.zendesk.com/api/v2/custom_objects/car/records?external_id=X90001 \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records?external_id=X90001"	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/custom_objects/car/records")		.newBuilder()		.addQueryParameter("external_id", "X90001");
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/custom_objects/car/records',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'external_id': 'X90001',  },};
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/custom_objects/car/records?external_id=X90001"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/custom_objects/car/records")uri.query = URI.encode_www_form("external_id": "X90001")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
curl - Delete custom object record by external id
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records?external_id={external_id}.json \  -X DELETE \  -v -u {email_address}:{password}

Example response(s)

204 No Content
// Status 204 No Content
null

Count Custom Object Records

  • GET /api/v2/custom_objects/{custom_object_key}/records/count

Returns a total count of records for a specific custom object as well as the time the count was refreshed.

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
custom_object_keystringPathtrueThe key of a custom object

Code Samples

Curl
curl --request GET https://example.zendesk.com/api/v2/custom_objects/car/records/count \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records/count"	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/custom_objects/car/records/count")		.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/custom_objects/car/records/count',  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/custom_objects/car/records/count"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/custom_objects/car/records/count")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
curl - Get custom object record count
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/count.json \  -v -u {email_address}:{password}

Example response(s)

200 OK
// Status 200 OK
{  "count": {    "refreshed_at": "2022-09-02T22:44:35Z",    "value": 7  }}
  • GET /api/v2/custom_objects/{custom_object_key}/records/autocomplete

Retrieves an array of custom object records that have a field value that matches the value specified in the name parameter.

Pagination

  • Cursor pagination only.
  • Returns the first 10,000 records sorted by relevancy with page limits.

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
assignee_idintegerQueryfalseThe id of the selected assignee. For use with dynamic filters.
field_idstringQueryfalseThe id of the lookup field. If the field has a relationship filter, the filter is applied to the results. Must be used with source param.
namestringQueryfalsePart of a name of the record you are searching for
organization_idintegerQueryfalseThe id of the organization the requester belongs to. For use with dynamic filters.
page[after]stringQueryfalseA pagination cursor that tells the endpoint which page to start on. It should be a meta.after_cursor value from a previous request. Note: page[before] and page[after] can't be used together in the same request.
page[before]stringQueryfalseA pagination cursor that tells the endpoint which page to start on. It should be a meta.before_cursor value from a previous request. Note: page[before] and page[after] can't be used together in the same request.
page[size]integerQueryfalseThe number of records to return in the response. You can specify up to 100 records per page.
requester_idintegerQueryfalseThe id of the requester. For use with dynamic filters.
sourcestringQueryfalseOne of "zen:user", "zen:ticket", "zen:organization", or "zen:custom_object:CUSTOM_OBJECT_KEY". Represents the object field_id belongs to. Must be used with field_id param.
custom_object_keystringPathtrueThe key of a custom object

Code Samples

Curl
curl --request GET https://example.zendesk.com/api/v2/custom_objects/car/records/autocomplete?assignee_id=7334148660734&field_id=&name=&organization_id=5633330889598&page[after]=&page[before]=&page[size]=&requester_id=264817272&source= \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records/autocomplete?assignee_id=7334148660734&field_id=&name=&organization_id=5633330889598&page[after]=&page[before]=&page[size]=&requester_id=264817272&source="	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/custom_objects/car/records/autocomplete")		.newBuilder()		.addQueryParameter("assignee_id", "7334148660734")		.addQueryParameter("field_id", "")		.addQueryParameter("name", "")		.addQueryParameter("organization_id", "5633330889598")		.addQueryParameter("page[after]", "")		.addQueryParameter("page[before]", "")		.addQueryParameter("page[size]", "")		.addQueryParameter("requester_id", "264817272")		.addQueryParameter("source", "");
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/custom_objects/car/records/autocomplete',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'assignee_id': '7334148660734',    'field_id': '',    'name': '',    'organization_id': '5633330889598',    'page[after]': '',    'page[before]': '',    'page[size]': '',    'requester_id': '264817272',    'source': '',  },};
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/custom_objects/car/records/autocomplete?assignee_id=7334148660734&field_id=&name=&organization_id=5633330889598&page[after]=&page[before]=&page[size]=&requester_id=264817272&source="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/custom_objects/car/records/autocomplete")uri.query = URI.encode_www_form("assignee_id": "7334148660734", "field_id": "", "name": "", "organization_id": "5633330889598", "page[after]": "", "page[before]": "", "page[size]": "", "requester_id": "264817272", "source": "")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
curl - Get records with name matching Tesla
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/autocomplete?name=Tesla \  -v -u {email_address}:{password}
curl - get records with name matching Tesla, 10 records per page, previous page
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/autocomplete?name=Tesla&page[before]=cursor_value&page[size]=10 \  -v -u {email_address}:{password}
curl - Get records with name matching Tesla, with field_id and source
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/autocomplete?name=Tesla&field_id=field_value&source=zen:custom_object:car \  -v -u {email_address}:{password}

Example response(s)

200 OK
// Status 200 OK
{  "count": 100,  "custom_object_records": [    {      "created_at": "2022-09-12T19:29:59Z",      "created_by_user_id": "10001",      "custom_object_fields": {        "make": "Tesla",        "model": "S"      },      "custom_object_key": "car",      "external_id": "Internal System Record 54848",      "id": "01GCSJW391QVSC80GYDH7E93Q6",      "name": "My Tesla CO record",      "updated_at": "2022-09-15T21:07:03Z",      "updated_by_user_id": "10001",      "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6.json"    },    {      "created_at": "2022-09-26T22:24:15Z",      "created_by_user_id": "123123",      "custom_object_fields": {        "make": "Honda",        "model": "Civic"      },      "custom_object_key": "car",      "external_id": null,      "id": "01GDXYD7ZTWYP542BA8MDDTE36",      "name": "My Tesla CO record2",      "updated_at": "2022-09-26T22:24:15Z",      "updated_by_user_id": "245159",      "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYD7ZTWYP542BA8MDDTE36.json"    }  ],  "links": {    "next": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/autocomplete.json?page%5Bafter%5D=eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0%3D&page%5Bsize%5D=1&query=",    "prev": null  },  "meta": {    "after_cursor": "eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0=",    "before_cursor": null,    "has_more": true  }}

Search Custom Object Records

  • GET /api/v2/custom_objects/{custom_object_key}/records/search

Returns an array of custom object records that meet the search criteria

Pagination

  • Cursor pagination only.
  • Returns the records sorted by relevancy with page limits. Without a sort parameter, only the first 10,000 records are returned. With a sort parameter, all records are returned.

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
page[after]stringQueryfalseA pagination cursor that tells the endpoint which page to start on. It should be a meta.after_cursor value from a previous request. Note: page[before] and page[after] can't be used together in the same request.
page[before]stringQueryfalseA pagination cursor that tells the endpoint which page to start on. It should be a meta.before_cursor value from a previous request. Note: page[before] and page[after] can't be used together in the same request.
page[size]integerQueryfalseSpecifies how many records should be returned in the response. You can specify up to 100 records per page.
querystringQueryfalseThe query parameter is used to search text-based fields for records that match specific query terms. The query can be multiple words or numbers. Every record that matches the beginning of any word or number in the query string is returned.

Fuzzy search is supported for the following text-based field types: : Text fields, Multi Line Text fields, and RegExp fields.

For example, you might want to search for records related to Tesla vehicles: query=Tesla. In this example the API would return every record for the given custom object where any of the supported text fields contain the word 'Tesla'.

You can include multiple words or numbers in your search. For example: query=Tesla Honda 2020. This search phrase would be URL encoded as query=Tesla%20Honda%202020 and return every record for the custom object for which any of the supported text fields contained 'Tesla', 'Honda', or '2020'.
sortstringQueryfalseOne of name, created_at, updated_at, -name, -created_at, or -updated_at. The - denotes the sort will be descending. Defaults to sorting by relevance.
custom_object_keystringPathtrueThe key of a custom object

Code Samples

Curl
curl --request GET https://example.zendesk.com/api/v2/custom_objects/car/records/search?page[after]=&page[before]=&page[size]=&query=jdoe&sort= \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/records/search?page[after]=&page[before]=&page[size]=&query=jdoe&sort="	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/custom_objects/car/records/search")		.newBuilder()		.addQueryParameter("page[after]", "")		.addQueryParameter("page[before]", "")		.addQueryParameter("page[size]", "")		.addQueryParameter("query", "jdoe")		.addQueryParameter("sort", "");
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/custom_objects/car/records/search',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'page[after]': '',    'page[before]': '',    'page[size]': '',    'query': 'jdoe',    'sort': '',  },};
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/custom_objects/car/records/search?page[after]=&page[before]=&page[size]=&query=jdoe&sort="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/custom_objects/car/records/search")uri.query = URI.encode_www_form("page[after]": "", "page[before]": "", "page[size]": "", "query": "jdoe", "sort": "")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
curl - Get custom object records with fields matching Tesla
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/search?query=Tesla \  -v -u {email_address}:{password}
curl - Get custom object records with fields matching 1998 or 2003
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/search?query=1998%202003 \  -v -u {email_address}:{password}
curl - Get custom object records with fields matching Tesla, newest records first
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/search?query=Tesla&sort=created_at \  -v -u {email_address}:{password}
curl - Get custom object records with fields matching Tesla, sort by car name, descending
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/search?query=Tesla&sort=-name \  -v -u {email_address}:{password}
curl - Get custom object records with fields matching Tesla, 10 records per page, previous page
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/records/search?query=Tesla&page[before]=cursor_value&page[size]=10 \  -v -u {email_address}:{password}

Example response(s)

200 OK
// Status 200 OK
{  "count": 100,  "custom_object_records": [    {      "created_at": "2022-09-12T19:29:59Z",      "created_by_user_id": "10001",      "custom_object_fields": {        "make": "Tesla",        "model": "S"      },      "custom_object_key": "car",      "external_id": "Internal System Record 54848",      "id": "01GCSJW391QVSC80GYDH7E93Q6",      "name": "My Tesla CO record",      "updated_at": "2022-09-15T21:07:03Z",      "updated_by_user_id": "10001",      "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GCSJW391QVSC80GYDH7E93Q6.json"    },    {      "created_at": "2022-09-26T22:24:15Z",      "created_by_user_id": "123123",      "custom_object_fields": {        "make": "Honda",        "model": "Civic"      },      "custom_object_key": "car",      "external_id": null,      "id": "01GDXYD7ZTWYP542BA8MDDTE36",      "name": "My Tesla CO record2",      "updated_at": "2022-09-26T22:24:15Z",      "updated_by_user_id": "245159",      "url": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/01GDXYD7ZTWYP542BA8MDDTE36.json"    }  ],  "links": {    "next": "https://{subdomain}.zendesk.com/api/v2/custom_objects/car/records/search.json?page%5Bafter%5D=eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0%3D&page%5Bsize%5D=1&query=",    "prev": null  },  "meta": {    "after_cursor": "eyJmcm9tIjoxLCJzaXplIjoxLCJzZWFyY2hBZnRlciI6bnVsbCwic29ydCI6bnVsbH0=",    "before_cursor": null,    "has_more": true  }}

Custom Object Records Limit

  • GET /api/v2/custom_objects/limits/record_limit

List the current count and the limit for custom object records

Allowed For

  • Agents

Code Samples

Curl
curl --request GET https://example.zendesk.com/api/v2/custom_objects/limits/record_limit \--header "Content-Type: application/json" \-u username:password
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/limits/record_limit"	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/custom_objects/limits/record_limit")		.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/custom_objects/limits/record_limit',  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/custom_objects/limits/record_limit"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/custom_objects/limits/record_limit")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
curl - Get custom object records count and limit
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/limits/record_limit \  -v -u {email_address}:{password}

Example response(s)

200 OK
// Status 200 OK
{  "count": 10294,  "limit": 1000000}

Custom Object Record Bulk Jobs

  • POST /api/v2/custom_objects/{custom_object_key}/jobs

Queues a background job to perform bulk actions on up to 100 custom object records per single request. Takes a job object with two nested fields:

  • action, one of:
    • "create"
    • "delete"
    • "delete_by_external_id"
    • "create_or_update_by_external_id"
    • "update"
  • items
    • For a "create" action, an array of JSON objects representing the custom object records being created
    • For a "delete" action, an array of strings representing Zendesk record ids
    • For a "delete_by_external_id" action, an array of strings representing external ids
    • For a "create_or_update_by_external_id" action, an array of JSON objects representing the custom object records being created or updated
    • For an "update" action, an array of JSON objects representing the custom object records being updated

Allowed For

  • Agents

Response

This endpoint returns a job_status JSON object and queues a background job to do the work. Use the Show Job Status endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See Job limit for more information.

Parameters

NameTypeInRequiredDescription
custom_object_keystringPathtrueThe key of a custom object

Example body

{  "job": {    "action": "create",    "items": [      {        "custom_object_fields": {          "color": "Red",          "year": 2020        },        "name": "2020 Tesla"      },      {        "custom_object_fields": {          "color": "Blue",          "external_id": "ddd444",          "year": 2012        },        "name": "2012 Toyota"      },      {        "custom_object_fields": {          "color": "Silver",          "external_id": "ddd445",          "year": 2017        },        "name": "2017 Ford"      }    ]  }}

Code Samples

Curl
curl --request POST https://example.zendesk.com/api/v2/custom_objects/car/jobs \--header "Content-Type: application/json" \-u username:password \--data-raw '{  "job": {    "action": "create",    "items": [      {        "custom_object_fields": {          "color": "Red",          "year": 2020        },        "name": "2020 Tesla"      },      {        "custom_object_fields": {          "color": "Blue",          "external_id": "ddd444",          "year": 2012        },        "name": "2012 Toyota"      },      {        "custom_object_fields": {          "color": "Silver",          "external_id": "ddd445",          "year": 2017        },        "name": "2017 Ford"      }    ]  }}'
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://example.zendesk.com/api/v2/custom_objects/car/jobs"	method := "POST"	payload := strings.NewReader(`{  "job": {    "action": "create",    "items": [      {        "custom_object_fields": {          "color": "Red",          "year": 2020        },        "name": "2020 Tesla"      },      {        "custom_object_fields": {          "color": "Blue",          "external_id": "ddd444",          "year": 2012        },        "name": "2012 Toyota"      },      {        "custom_object_fields": {          "color": "Silver",          "external_id": "ddd445",          "year": 2017        },        "name": "2017 Ford"      }    ]  }}`)	req, err := http.NewRequest(method, url, payload)
	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/custom_objects/car/jobs")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"job\": {    \"action\": \"create\",    \"items\": [      {        \"custom_object_fields\": {          \"color\": \"Red\",          \"year\": 2020        },        \"name\": \"2020 Tesla\"      },      {        \"custom_object_fields\": {          \"color\": \"Blue\",          \"external_id\": \"ddd444\",          \"year\": 2012        },        \"name\": \"2012 Toyota\"      },      {        \"custom_object_fields\": {          \"color\": \"Silver\",          \"external_id\": \"ddd445\",          \"year\": 2017        },        \"name\": \"2017 Ford\"      }    ]  }}""");
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 data = JSON.stringify({  "job": {    "action": "create",    "items": [      {        "custom_object_fields": {          "color": "Red",          "year": 2020        },        "name": "2020 Tesla"      },      {        "custom_object_fields": {          "color": "Blue",          "external_id": "ddd444",          "year": 2012        },        "name": "2012 Toyota"      },      {        "custom_object_fields": {          "color": "Silver",          "external_id": "ddd445",          "year": 2017        },        "name": "2017 Ford"      }    ]  }});
var config = {  method: 'POST',  url: 'https://example.zendesk.com/api/v2/custom_objects/car/jobs',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  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://example.zendesk.com/api/v2/custom_objects/car/jobs"
payload = json.loads("""{  "job": {    "action": "create",    "items": [      {        "custom_object_fields": {          "color": "Red",          "year": 2020        },        "name": "2020 Tesla"      },      {        "custom_object_fields": {          "color": "Blue",          "external_id": "ddd444",          "year": 2012        },        "name": "2012 Toyota"      },      {        "custom_object_fields": {          "color": "Silver",          "external_id": "ddd445",          "year": 2017        },        "name": "2017 Ford"      }    ]  }}""")headers = {	"Content-Type": "application/json",}
response = requests.request(	"POST",	url,	auth=('<username>', '<password>'),	headers=headers,	json=payload)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/custom_objects/car/jobs")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")request.body = %q({  "job": {    "action": "create",    "items": [      {        "custom_object_fields": {          "color": "Red",          "year": 2020        },        "name": "2020 Tesla"      },      {        "custom_object_fields": {          "color": "Blue",          "external_id": "ddd444",          "year": 2012        },        "name": "2012 Toyota"      },      {        "custom_object_fields": {          "color": "Silver",          "external_id": "ddd445",          "year": 2017        },        "name": "2017 Ford"      }    ]  }})request.basic_auth "username", "password"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end
curl - Create multiple custom object records

For clarity, the example places the JSON in a separate file and imports it into the cURL statement

my_job.json

{  "job": {      "action": "create",      "items": [{ "name": "2020 Tesla", "custom_object_fields": {  "color": "Red",    "year": 2020 }},                { "name": "2012 Toyota","custom_object_fields": {  "color": "Blue",   "year": 2012 }},                { "name": "2017 Ford",  "custom_object_fields": {  "color": "Silver", "year": 2017 }}]      }}

curl - Create multiple custom object records snippet

curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/jobs.json \  -d @my_job.json \  -H "Content-Type: application/json" -v -u {email_address}:{password} -X POST
curl - Delete multiple custom object records by ID

For clarity, the example places the JSON in a separate file and imports it into the cURL statement

my_job.json

{  "job": {      "action": "delete",      "items": ["01GCSJW391QVSC80GYDH7E93Q6", "01GCSJW3A0QVSC80GYDH7E93Q7", "01GCSJW3A0QVSC80GYDH7E93Q8"]      }}

curl - Delete multiple custom object records by ID snippet

curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/jobs.json \  -d @my_job.json \  -H "Content-Type: application/json" -v -u {email_address}:{password} -X POST
curl - Delete multiple custom object records by External ID

For clarity, the example places the JSON in a separate file and imports it into the cURL statement

my_job.json

{  "job": {      "action": "delete_by_external_id",      "items": ["ddd444", "ddd445", "ddd446"]      }}

curl - Delete multiple custom object records by External ID snippet

curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/jobs.json \  -d @my_job.json \  -H "Content-Type: application/json" -v -u {email_address}:{password} -X POST
curl - Create or update multiple custom object records

For clarity, the example places the JSON in a separate file and imports it into the cURL statement. For the create_or_update_by_external_id action, each job item must include an external_id attribute. If a record exists for the external id, the record is updated. If a record does not exist for the external id, a new record is created.

my_job.json

{  "job": {      "action": "create_or_update_by_external_id",      "items": [{ "name": "2020 Tesla", "external_id": "ddd443", "custom_object_fields": {  "color": "Red", "year": 2020 }},                { "name": "2012 Toyota", "external_id": "ddd444", "custom_object_fields": {  "color": "Blue", "year": 2012 }},                { "name": "2017 Ford",  "external_id": "ddd445", "custom_object_fields": {  "color": "Silver", "year": 2017 }}]      }}

curl - Create or update multiple custom object records snippet

curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/jobs.json \  -d @my_job.json \  -H "Content-Type: application/json" -v -u {email_address}:{password} -X POST
curl - Update multiple custom object records

For clarity, the example places the JSON in a separate file and imports it into the cURL statement. For the update action, each job item must include id attribute.

my_job.json

{  "job": {      "action": "update",      "items": [{ "name": "2020 Tesla", "id": "01GCSJW391QVSC80GYDH7E93Q6", "custom_object_fields": {  "color": "Red", "year": 2020 }},                { "name": "2012 Toyota", "id": "01GCSJW3A0QVSC80GYDH7E93Q7", "custom_object_fields": {  "color": "Blue", "year": 2012 }},                { "name": "2017 Ford",  "id": "01GCSJW3A0QVSC80GYDH7E93Q8", "custom_object_fields": {  "color": "Silver", "year": 2017 }}]      }}

curl - Update multiple custom object records snippet

curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/jobs.json \  -d @my_job.json \  -H "Content-Type: application/json" -v -u {email_address}:{password} -X POST

Example response(s)

201 Created
// Status 201 Created
{  "job_status": {    "id": "V3-291e720c98aef4d953563ab090486213",    "message": null,    "progress": null,    "results": null,    "status": "queued",    "total": 2,    "url": "https://{subdomain}.zendesk.com/api/v2/job_statuses/V3-291e720c98aef4d953563ab090486213.json"  }}