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

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

const response = await client.campaigns.updateCampaign({
  teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
  campaignId: process.env.OCTOSPARK_CAMPAIGN_ID ?? "campaignId",
  body: {},
})
{
  "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
}

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.

campaignId
string
required

Campaign id (UUID), as returned by the list/create campaigns endpoints.

Body

application/json
accountPostingLimits
maxItems(1000) · object[]

Optional changed account limits to save atomically with this configuration. Accounts must be distinct selected destinations of this workspace. A nonempty array additionally requires manage_integrations. Any invalid, stale or unsafe reduction rejects every change. Omit or send [] to leave all shared limits unchanged.

Maximum array length: 1000
configurationVersion
enum<number>

Send 2 to explicitly convert after reviewing configuration changes. Conversion requires the complete agent and schedule configuration; version 2 cannot revert to legacy behaviour.

Available options:
1,
2
expectedRevision
integer

a non-negative number

Required range: x >= 0
expectedScheduleRevision
integer

Revision of the canonical schedule shown by the editor, protecting independently cached schedule reads.

Required range: x >= 0
agents
maxItems(50) · object[]

an array of at most 50 item(s)

Maximum array length: 50
schedule
object

Replace the campaign’s shared timing and limits atomically with its other edits. Omit to preserve the current schedule and budgets. Include the displayed campaign and schedule revisions to reject stale edits.

name
string

Campaign name, 1-120 characters, unique within the team.

Required string length: 1 - 120
description
string | null

Legacy optional description retained for API compatibility. Campaign setup uses the campaign name only.

Maximum string length: 2000

Response

Success

id
string<uuid>
required

a Universally Unique Identifier

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}$
teamId
string<uuid>
required

a Universally Unique Identifier

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}$
name
string
required

Campaign name, 1-120 characters, unique within the team.

Required string length: 1 - 120
description
string | null
required

Legacy optional description retained for API compatibility. Campaign setup uses the campaign name only.

Maximum string length: 2000
agents
object[]
required

Managed agents in the campaign (the optimiser pool).

workflowScheduleIds
string<uuid>[]
required

The canonical optimised schedule for a managed campaign. Legacy campaigns may have multiple attachments until explicitly reconciled.

a Universally Unique Identifier

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}$
createdBy
string<uuid>
required

a Universally Unique Identifier

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}$
createdAt
string
required
updatedAt
string
required
revision
integer

a non-negative number

Required range: x >= 0
configurationVersion
enum<number>

Version 1 preserves legacy scheduling and optimiser behaviour. Version 2 uses explicit account bundles, shared posting caps and automatic exploration.

Available options:
1,
2
effectiveDailyBudgetDecimillicents
number | null