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

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

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

agentId
string
required

Managed agent id (UUID), as returned by the list/create agents endpoints.

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