Count

Count the records that match a search filter

A count of the number of results of a search query can be obtained by appending /_count to the search URL.

POST /v1/contacts/_search/_count HTTP/1.1
Authorization: ***** Hidden credentials *****
Content-Type: application/json; charset=utf-8
Host: api.marketcircle.net
User-Agent: MC API Documentation

{
	"category" : {
  	"equal": "Customer"
  }
}
{"count":23}

To try it from the command line:

curl -X POST "https://api.marketcircle.net/v1/contacts/_search/_count" \
  -H "Authorization: Bearer <access token>" \
  -H "Content-Type: application/json" \
  -d '{"category": {"equal": "Customer"}}'

The request body is the same search filter you would send to that type's search endpoint, and invalid filters return the same 400 errors. Send {} or [] to count every record.

The count only includes records the user is allowed to see, and never includes records in the trash. Paging parameters don't apply.

Counting is available for every type that has a search endpoint: appointments, companies, contacts, emails, files, forms, groups, notes, opportunities, projects, relationships, relationship types, resources, roles, role types, tasks and users.