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

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

const response = await client.campaigns.listCampaigns({
  teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
  query: {},
})
{
  "data": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "description": "<string>",
      "agents": [
        {
          "agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "name": "<string>",
          "currentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "archived": true,
          "prompt": "<string>",
          "instructions": "<string>",
          "perRunCreditCeilingDecimillicents": 123,
          "maxPostsPerRun": 123,
          "addedAt": "<string>",
          "promptRevision": 123,
          "targetSocialAccountIds": [
            "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          ],
          "effectivePerRunCreditCeilingDecimillicents": 123
        }
      ],
      "workflowScheduleIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "revision": 1,
      "effectiveDailyBudgetDecimillicents": 123,
      "stats": {
        "from": "<string>",
        "to": "<string>",
        "published": 123,
        "interactions": 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

includeStats
enum<string>

Set true to get each campaign's stats (published pieces, interactions and spend over the stats endpoint's default 30-day window). Omit it when you only need names, agents or schedules: the stats aggregate reads the whole team's runs, posts and spend.

Available options:
true,
false

Response

Success

data
object[]
required