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

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

const response = await client.agents.getAgentPerformance({
  teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
  query: {},
})
{
  "data": [
    {
      "agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "archived": true,
      "totals": {
        "created": 123,
        "scheduled": 123,
        "published": 123,
        "failed": 123,
        "costDecimillicents": 123,
        "postCount": 123,
        "impressions": 123,
        "engagement": 123,
        "engagementPerCredit": 123
      },
      "versions": [
        {
          "agentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "version": 123,
          "created": 123,
          "scheduled": 123,
          "published": 123,
          "failed": 123,
          "costDecimillicents": 123,
          "postCount": 123,
          "impressions": 123,
          "engagement": 123,
          "engagementPerCredit": 123
        }
      ]
    }
  ],
  "total": 123,
  "nextCursor": "<string>",
  "prevCursor": "<string>",
  "from": "<string>",
  "to": "<string>",
  "pageOffset": 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}$
agentId
string<uuid>

Only this agent: its row, or an empty page when it made nothing in the window.

Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
cursor
string

Opaque pagination cursor from the previous page response (nextCursor/prevCursor); omit to start at the first page.

offset
string

Zero-based row offset to jump to (numbered pages), 0 to 10000. With a cursor, the jump starts from that cursor; without one it is a plain offset. Lists not yet on the signed cursor standard ignore it.

Examples:

"0"

"25"

limit
string
default:25

Page size as a positive integer string; defaults to 25, capped at 100.

Examples:

"25"

"100"

Response

One page of agents with content in the window, most published first (then most created, then id), each with its totals and per-version results. Counters come from database triggers; results credit each post to its ROOT run's pinned version.

One page of agents with content in the window, most published first (then most created, then id), each with its totals and per-version results. Counters come from database triggers; results credit each post to its ROOT run's pinned version.

data
object[]
required
total
number
required
nextCursor
string | null
required

Opaque cursor for the page after this one; null on the last page.

prevCursor
string | null
required

Opaque cursor for the page before this one; null on the first page. Lists on the signed cursor standard return a real backwards cursor; older lists echo the request cursor.

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}$
pageOffset
number | null

Zero-based position of the first row of this page within total (for "Showing 26-50 of 268" and page numbers); null when unknown.