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

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

const response = await client.social.getAnalyticsAggregates({
  teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
  query: {
    "from": process.env.OCTOSPARK_FROM ?? "from",
    "to": process.env.OCTOSPARK_TO ?? "to",
  },
})
{
  "period": {
    "from": "<string>",
    "to": "<string>"
  },
  "totals": {
    "likeCount": 123,
    "commentCount": 123,
    "shareCount": 123,
    "saveCount": 123,
    "impressionCount": 123,
    "reachCount": 123,
    "postCount": 123,
    "linkClickCount": 123,
    "averageEngagementRate": 123
  },
  "byPlatform": [
    {
      "likeCount": 123,
      "commentCount": 123,
      "shareCount": 123,
      "saveCount": 123,
      "impressionCount": 123,
      "reachCount": 123,
      "postCount": 123,
      "linkClickCount": 123,
      "averageEngagementRate": 123
    }
  ],
  "byWeek": [
    {
      "weekStart": "<string>",
      "likeCount": 123,
      "commentCount": 123,
      "shareCount": 123,
      "saveCount": 123,
      "impressionCount": 123,
      "postCount": 123,
      "linkClickCount": 123,
      "averageEngagementRate": 123
    }
  ],
  "byDay": [
    {
      "date": "<string>",
      "likeCount": 123,
      "commentCount": 123,
      "shareCount": 123,
      "saveCount": 123,
      "impressionCount": 123,
      "postCount": 123,
      "linkClickCount": 123,
      "averageEngagementRate": 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
required

Start of the reporting window, ISO 8601 timestamp (inclusive).

Example:

"2026-05-01T00:00:00.000Z"

to
string
required

End of the reporting window, ISO 8601 timestamp (inclusive).

Example:

"2026-05-31T23:59:59.000Z"

platform
enum<string>

Restrict aggregates to one provider; omit for all connected providers.

Available options:
x,
tiktok,
instagram,
facebook,
youtube,
linkedin,
threads
Example:

"x"

postType
enum<string>

Restrict aggregates to one content format; empty or omitted includes all formats.

Available options:
text_post,
text_image,
text_video,
carousel,
thread,
tagIds
string

CSV of user-tag UUIDs; restricts aggregates to posts assigned ANY of these tags.

filter[postType]
enum<string>

Alias of postType using the filter[...] convention.

Available options:
text_post,
text_image,
text_video,
carousel,
thread,
filter[tagIds]
string

Alias of tagIds using the filter[...] convention; CSV of user-tag UUIDs.

filter[tags]
string

Comma-separated AI tags; matches posts whose assets carry any of the listed tags (OR).

Example:

"launch,product"

filter[category]
string

Comma-separated AI content categories; matches posts in any of the listed categories (OR).

Example:

"education"

filter[purpose]
string

Comma-separated AI purposes; matches posts whose assets carry any of the listed purposes (OR).

Example:

"promotion"

filter[emotion]
string

Comma-separated AI emotions; matches posts tagged with any of the listed emotions (OR).

Example:

"joy"

filter[mediaType]
string

Comma-separated media types; each value one of: image, video, audio, gif, document.

Example:

"image,video"

filter[enrichmentStatus]
string

Comma-separated AI enrichment statuses; each value one of: pending, processing, completed, failed.

Example:

"completed"

Response

Success

period
object
required
totals
object
required
byPlatform
object[]
required
byWeek
object[]
required
byDay
object[]
required