Newer Version Available

This content describes an older version of this product. View Latest

Record Count

Lists information about object record counts in your organization.

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 approximate, and does not 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 is not found in the org, it is ignored and not returned in the response.

This parameter is optional. If this parameter is not 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/v58.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}