---
title: "Count Tickets in View"
method: GET
path: "/api/v2/views/{view_id}/count"
tags: ["Views"]
---

# Count Tickets in View

`GET /api/v2/views/{view_id}/count`

Returns the ticket count for a single view.

This endpoint is rate limited to 5 requests per minute, per view, per agent.

#### View Counts

The view count endpoints, Count Tickets in View (this endpoint) and [Count Tickets in Views](#count-tickets-in-views), let you estimate how many tickets remain in a view without having to retrieve the entire view. They're designed to help estimate view size. From a business perspective, accuracy becomes less relevant as view size increases.

To ensure quality of service, these counts are cached more heavily as the number of tickets in a view grows. For a view with thousands of tickets, you can expect the count to be cached for 60-90 minutes. As a result, the count may not reflect the actual number of tickets in your view.

View counts are represented as JSON objects with the following attributes:

| Name            | Type        | Comment
| --------------- | ------------| -------
| view_id         | integer     | The id of the view
| url             | string      | The API url of the count
| value           | integer     | The cached number of tickets in the view. Can also be null if the system is loading and caching new data. Not to be confused with 0 tickets
| pretty          | string      | A pretty-printed text approximation of the view count
| fresh           | boolean     | false if the cached data is stale and the system is still loading and caching new data
| active          | boolean     | Only active views if true, inactive views if false, all views if null.

#### Example
```js
{
  "view_count": {
    "view_id": 25,
    "url":     "https://company.zendesk.com/api/v2/views/25/count.json",
    "value":   719,
    "pretty":  "~700",
    "fresh":   true
  }
}
```

## Response `200`

Success response

- ViewCountResponse
  - `view_count` ViewCountObject
    - `active` boolean — Only active views if true, inactive views if false, all views if null.
    - `fresh` boolean — false if the cached data is stale and the system is still loading and caching new data
    - `pretty` string — A pretty-printed text approximation of the view count
    - `url` string — The API url of the count
    - `value` integer, nullable — The cached number of tickets in the view. Can also be null if the system is loading and caching new data. Not to be confused with 0 tickets
    - `view_id` integer — The id of the view

---

[API](https://skmtc.net/botbrains-io/apis/support-api.md) · [All operations](https://skmtc.net/botbrains-io/apis/support-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/botbrains-io/support-api/versions/d53eac07ba68/schema)
