Posts

Count posts by day, status, account, and brand

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.

get/api/v1/posts/counts

Request

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

Query parameters

scheduled_fromstring required
Example:2026-10-01

Start of the range, inclusive (plain date or ISO 8601 date-time).

scheduled_tostring required
Example:2026-10-31

End of the range. A plain date includes that whole day; a date-time is exclusive. Missing either bound answers 400 with code: "scheduled_range_required"; more than 366 days answers code: "scheduled_range_too_long".

timezonestring
Example:Europe/London

IANA time zone for reading plain dates and for the by_day buckets.

statusstring
platformstring
account_idstring
workspace_idstring
brand_idstring uuid
approval_status'none' | 'pending_client' | 'approved' | 'changes_requested' | 'rejected'
approval_waiting_on'client' | 'team'
updated_sincestring date-time
created_sincestring date-time

Response

Counts computed successfully

totalinteger required

Exact number of matching posts. Always equals the list total for the same query.

countedinteger required

Posts grouped below (at most 10,000).

truncatedboolean required

True when more than 10,000 posts match, so the groups cover only the earliest 10,000. total stays exact.

Example response

{
  "total": 3,
  "counted": 3,
  "truncated": false,
  "range": {
    "from": "2026-09-30T23:00:00.000Z",
    "to": "2026-10-02T23:00:00.000Z",
    "timezone": "Europe/London"
  },
  "by_day": [
    {
      "date": "2026-10-01",
      "count": 3
    },
    {
      "date": "2026-10-02",
      "count": 0
    }
  ],
  "by_status": [
    {
      "status": "scheduled",
      "count": 3
    }
  ],
  "by_account": [
    {
      "account_id": "123",
      "platform": "instagram",
      "username": "acme",
      "count": 3
    }
  ],
  "by_brand": [
    {
      "brand_id": "6f1c2a54-2b0e-4c7c-9a51-3a3a8c1d2e10",
      "name": "Acme",
      "count": 3
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.