---
title: "Count posts by day, status, account, and brand"
method: GET
path: "/api/v1/posts/counts"
tags: ["Posts"]
---

# Count posts by day, status, account, and brand

`GET /api/v1/posts/counts`

## Request

- Base URL: `https://www.poster.ly`
- URL: `https://www.poster.ly/api/v1/posts/counts`
- Auth: HTTP bearer

Exact totals for a scheduled range, with the same filters and the same workspace and brand scoping as `GET /api/v1/posts`, so `total` always equals the list total for the same query. `by_day` lists every calendar day in the range in `timezone`, including days with no posts. Requires `scheduled_from` and `scheduled_to` (at most 366 days). Grouping reads at most 10,000 posts; past that `truncated` is true and `total` stays exact.

## Query parameters

- `scheduled_from` string, required
- `scheduled_to` string, required
- `timezone` string
- `status` string
- `platform` string
- `account_id` string
- `workspace_id` string
- `brand_id` string, uuid
- `approval_status` 'none' | 'pending_client' | 'approved' | 'changes_requested' | 'rejected'
- `approval_waiting_on` 'client' | 'team'
- `updated_since` string, date-time
- `created_since` string, date-time

## Response `200`

Counts computed successfully

- PostCountsResponse
  - `total` integer, required: Exact number of matching posts. Always equals the list total for the same query.
  - `counted` integer, required: Posts grouped below (at most 10,000).
  - `truncated` boolean, required: True when more than 10,000 posts match, so the groups cover only the earliest 10,000. total stays exact.
  - `range` PostsScheduledRange, required: The resolved scheduled range, echoed when scheduled_from or scheduled_to was given. `from` is inclusive and `to` exclusive; a plain-date scheduled_to has already moved to the start of the next day in `timezone`.
    - `from` string, date-time, nullable, required
    - `to` string, date-time, nullable, required
    - `timezone` string, required
  - `by_day` object[], required: Every calendar day in the range (in timezone), including days with no posts.
    - `date` string, date, required
    - `count` integer, required
  - `by_status` object[], required
    - `status` string, required
    - `count` integer, required
  - `by_account` object[], required
    - `account_id` string, nullable, required
    - `platform` string, nullable, required
    - `username` string, nullable, required
    - `count` integer, required
  - `by_brand` object[], required
    - `brand_id` string, nullable, required
    - `name` string, nullable, required
    - `count` integer, required

## Other responses

- `400`: Validation error
- `401`: Invalid or missing API key
- `429`: Too many requests

---

[API](https://skmtc.dev/poster/apis/posterly-api.md) · [All operations](https://skmtc.dev/poster/apis/posterly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/poster/apis/posterly-api/revisions/60be02a61f95?raw)
