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",