function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
admin dudeadmin dude 

Rate Limit

I tried to reach the limit of the daily API calls returned from /services/data/vXX.X/limits endpoint (which is 15000). instead of getting 429 status code (Too Many Requests) with the header Retry-After i get 403 status code (Forbidden) with errorCode="REQUEST_LIMIT_EXCEEDED" without any Retry-After field. In which case can I expect 429 status code, and can I configure the limit on api calls permanantley?
Best Answer chosen by admin dude
SwethaSwetha (Salesforce Developers) 
End users will not be able to configure these limits. In case of Daily API Request Limit, Salesforce support can increase temporarily based on business impact. See article https://help.salesforce.com/s/articleView?id=000382675&type=1 that has more details on the procedure

If this information helps, please mark the answer as best. Thank you

All Answers

SwethaSwetha (Salesforce Developers) 
HI Admin Dude,
Based on this similar question https://salesforce.stackexchange.com/questions/267246/apex-rest-api-unable-to-set-statuscode-to-429 from past doesn't look like you can configure 429 Too Many Requests as a status code.

Also, the documentation for the RestResponse class (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_restresponse.htm?search_text=HTTP%20Response#:~:text=Type%3A%20Integer-,Status%20Codes,-The%20following%20are) lists the acceptable values for the statusCode property, and 429 is not included.

If this information helps, please mark the answer as best. Thank you
admin dudeadmin dude
So my question is: is the API limit configurable? for example, my org's current api daily limit is 15000 api calls. can I configure it to be 30000?
SwethaSwetha (Salesforce Developers) 
End users will not be able to configure these limits. In case of Daily API Request Limit, Salesforce support can increase temporarily based on business impact. See article https://help.salesforce.com/s/articleView?id=000382675&type=1 that has more details on the procedure

If this information helps, please mark the answer as best. Thank you
This was selected as the best answer