Newer Version Available
Record Count
This resource is available in REST API version 40.0 and later for API users with the “View Setup and Configuration” permission. The returned record count is a cached snapshot in time that may not accurately represent the number of records in the object at the time of the request. The record count value is updated automatically at variable time intervals, and there are no fixed schedules for these updates. It doesn’t include the following types of records:
- Deleted records in the recycle bin.
- Archived records.
Syntax
- URI
- /services/data/vXX.X/limits/recordCount?sObjects=objectList
- Formats
- JSON, XML
- HTTP Method
- GET
- Authentication
- Authorization: Bearer token
- Parameters
-
Parameter Description sObjects A comma-delimited list of object names. If a listed object isn’t found in the org, it’s ignored and not returned in the response. This parameter is optional. If this parameter isn’t provided, the resource returns record counts for all objects in the org.
- Response body
- Record Count Response Body
Example
- Example Request
-
1curl https://MyDomainName.my.salesforce.com/services/data/v60.0/limits/recordCount?sObjects=Account,Contact -H "Authorization: Bearer token" - Example Response Body
-
1{ 2 "sObjects" : [ { 3 "count" : 3, 4 "name" : "Account" 5 }, { 6 "count" : 10, 7 "name" : "Contact" 8 } ] 9}