Legacy Custom Objects Limits

The Legacy Custom Objects API implements limits on all the standard create endpoints. The restriction is on the total number of legacy object records and relationship records that can be created based on the plan.

For example, when an application exceeds the limit for the legacy object records endpoint, the API returns a HTTP 429 "Too Many Requests" response code. The following error is returned in the response body:

{  "errors": [    {      "code": "TooManyRequests",      "status": "429",      "title": "Too Many Requests",      "message": "You have exceeded the maximum number of resources for this account"    }  ]}

To avoid hitting the limits, you can use the limits endpoint to understand the limit and usage for your account.

JSON format

Limits are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
countintegertruefalseThe current count of legacy records stored in Custom Objects for the account for the key
keystringtruefalseThe limit key defines the limit type and legacy record type
limitintegertruefalseThe maximum count of legacy records that can be created for the key

Example

{  "count": 0,  "key": "resources",  "limit": 1000000}

List Limits for the Account

  • GET /api/sunshine/limits

Returns the current limits of the account.

Allowed for

  • Agents

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/sunshine/limits \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/sunshine/limits"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/sunshine/limits")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://support.zendesk.com/api/sunshine/limits',  headers: {	'Content-Type': 'application/json',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/sunshine/limits"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/sunshine/limits")request = Net::HTTP::Get.new(uri, "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": [    {      "count": 0,      "key": "resources",      "limit": 1000000    },    {      "count": 0,      "key": "relationships",      "limit": 1000000    },    {      "count": 0,      "key": "resource_types",      "limit": 50    },    {      "count": 0,      "key": "relationship_types",      "limit": 50    }  ]}