GET
/
v1
/
teams
/
{teamId}
/
agents
/
content-stats
TypeScript client
import { OctosparkClient } from '@octospark/sdk'

const client = new OctosparkClient({
  token: process.env.OCTOSPARK_TOKEN
})

const response = await client.agents.getAgentContentStats({
  teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
  query: {},
})
{
  "from": "<string>",
  "to": "<string>",
  "days": [
    {
      "day": "<string>",
      "byAgent": [
        {
          "agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "agentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "created": 123,
          "scheduled": 123,
          "published": 123,
          "failed": 123,
          "costDecimillicents": 123
        }
      ]
    }
  ],
  "totals": {
    "created": 123,
    "scheduled": 123,
    "published": 123,
    "failed": 123,
    "costDecimillicents": 123
  },
  "byAgent": [
    {
      "agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "created": 123,
      "scheduled": 123,
      "published": 123,
      "failed": 123,
      "costDecimillicents": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

teamId
string
required

Team (workspace) id (UUID). Discover ids via the list teams endpoint or the agent context.

Query Parameters

from
string

First UTC day (YYYY-MM-DD, inclusive). Defaults to 29 days before to.

Pattern: ^\d{4}-\d{2}-\d{2}$
to
string

Last UTC day (YYYY-MM-DD, inclusive). Defaults to today (UTC). The window is at most 92 days.

Pattern: ^\d{4}-\d{2}-\d{2}$

Response

Per-day, per-agent content counters maintained by database triggers on posts and their delivery legs, so agents cannot self-report. Read-only.

Per-day, per-agent content counters maintained by database triggers on posts and their delivery legs, so agents cannot self-report. Read-only.

from
string
required

UTC calendar day, YYYY-MM-DD.

Pattern: ^\d{4}-\d{2}-\d{2}$
to
string
required

UTC calendar day, YYYY-MM-DD.

Pattern: ^\d{4}-\d{2}-\d{2}$
days
object[]
required

Every day of the window, oldest first; days without activity have an empty byAgent.

totals
object
required
byAgent
object[]
required