Count Objects
You can count the total number of objects of a given type as follows:
Relative URL
HTTP Request Method
/api/v4/app-instance-id/objects/model/count.json
GET

Example

Count the number of task objects:
html
GET https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/tasks/count.json
curl
curl "https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/tasks/count.json" \
-u "533bda53027894f69b001055:7Ajj5htRY1uzw7b4w23V"
ruby
require 'rest-client'
journey = RestClient::Resource.new "https://run-testing-us.journeyapps.com/api/v4", "533bda53027894f69b001055", "7Ajj5htRY1uzw7b4w23V"
journey["533bda53027894f69b001055/objects/tasks/count.json"].get
Response
{"count":3,"type":"task"}
You can also count the number of objects returned by a query.
Copy link