Record Count

GET {{_endpoint}}/services/data/v{{version}}/limits/recordCount?sObjects=Account,Contact,Lead

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. https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_record_count.htm

Request Params

KeyDatatypeRequiredDescription
sObjectsstringA 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.

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"sObjects":[{"count":12,"name":"Account"},{"count":20,"name":"Contact"},{"count":22,"name":"Lead"}]}