@graph8/sdk 0.251.0 → 0.262.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/cli.js +216 -0
- package/dist/index.d.mts +105 -7
- package/dist/index.d.ts +105 -7
- package/dist/index.js +44 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -3
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +103 -7
- package/dist/react.d.ts +103 -7
- package/dist/react.js +62 -11
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +53 -12
- package/dist/react.mjs.map +1 -1
- package/dist/types/README.md +7 -0
- package/dist/types/agency.d.ts +20 -0
- package/dist/types/agentSetup.d.ts +57 -0
- package/dist/types/api.d.ts +127 -0
- package/dist/types/appClient.d.ts +99 -0
- package/dist/types/appPlatform.d.ts +269 -0
- package/dist/types/appTokens.d.ts +125 -0
- package/dist/types/apps.d.ts +130 -0
- package/dist/types/audiences.d.ts +88 -0
- package/dist/types/calendar.d.ts +55 -0
- package/dist/types/campaigns.d.ts +61 -0
- package/dist/types/chat.d.ts +35 -0
- package/dist/types/cli.d.ts +14 -0
- package/dist/types/companies.d.ts +123 -0
- package/dist/types/contacts.d.ts +200 -0
- package/dist/types/copilot.d.ts +31 -0
- package/dist/types/core.d.ts +1052 -0
- package/dist/types/deals.d.ts +215 -0
- package/dist/types/enrich.d.ts +51 -0
- package/dist/types/fields.d.ts +84 -0
- package/dist/types/forms.d.ts +16 -0
- package/dist/types/http.d.ts +141 -0
- package/dist/types/inbox.d.ts +123 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/intent.d.ts +196 -0
- package/dist/types/lists.d.ts +44 -0
- package/dist/types/mailboxes.d.ts +240 -0
- package/dist/types/marketplace.d.ts +62 -0
- package/dist/types/meetings.d.ts +70 -0
- package/dist/types/newsletter.d.ts +212 -0
- package/dist/types/notes.d.ts +57 -0
- package/dist/types/objects.d.ts +281 -0
- package/dist/types/pipelines.d.ts +135 -0
- package/dist/types/quotes.d.ts +143 -0
- package/dist/types/react.d.ts +978 -0
- package/dist/types/search.d.ts +99 -0
- package/dist/types/sequences.d.ts +255 -0
- package/dist/types/signals.d.ts +28 -0
- package/dist/types/skills.d.ts +176 -0
- package/dist/types/snippet.d.ts +24 -0
- package/dist/types/studio.d.ts +161 -0
- package/dist/types/tasks.d.ts +101 -0
- package/dist/types/types.d.ts +45 -0
- package/dist/types/utils.d.ts +21 -0
- package/dist/types/version.d.ts +10 -0
- package/dist/types/visitors.d.ts +29 -0
- package/dist/types/voice.d.ts +304 -0
- package/dist/types/webhooks.d.ts +71 -0
- package/dist/types/workflows.d.ts +229 -0
- package/docs/agents.md +748 -0
- package/docs/api/README.md +165 -0
- package/docs/api/accounts.d.ts +396 -0
- package/docs/api/accounts.md +644 -0
- package/docs/api/adCampaigns.d.ts +707 -0
- package/docs/api/adCampaigns.md +1091 -0
- package/docs/api/adCreatives.d.ts +996 -0
- package/docs/api/adCreatives.md +1708 -0
- package/docs/api/agency.d.ts +556 -0
- package/docs/api/agency.md +845 -0
- package/docs/api/agent.d.ts +330 -0
- package/docs/api/agent.md +514 -0
- package/docs/api/agents.d.ts +1622 -0
- package/docs/api/agents.md +2860 -0
- package/docs/api/aiInbox.d.ts +1984 -0
- package/docs/api/aiInbox.md +3490 -0
- package/docs/api/analytics.d.ts +1273 -0
- package/docs/api/analytics.md +2095 -0
- package/docs/api/apiKeys.d.ts +252 -0
- package/docs/api/apiKeys.md +318 -0
- package/docs/api/appDeployments.d.ts +236 -0
- package/docs/api/appDeployments.md +471 -0
- package/docs/api/appDomains.d.ts +171 -0
- package/docs/api/appDomains.md +281 -0
- package/docs/api/appLogs.d.ts +120 -0
- package/docs/api/appLogs.md +159 -0
- package/docs/api/appObjects.d.ts +415 -0
- package/docs/api/appObjects.md +568 -0
- package/docs/api/appPages.d.ts +557 -0
- package/docs/api/appPages.md +796 -0
- package/docs/api/appPlatformTokens.d.ts +123 -0
- package/docs/api/appPlatformTokens.md +172 -0
- package/docs/api/appointments.d.ts +2361 -0
- package/docs/api/appointments.md +3917 -0
- package/docs/api/apps.d.ts +822 -0
- package/docs/api/apps.md +1342 -0
- package/docs/api/assertUpsert.d.ts +286 -0
- package/docs/api/assertUpsert.md +370 -0
- package/docs/api/audienceSyncs.d.ts +259 -0
- package/docs/api/audienceSyncs.md +395 -0
- package/docs/api/brandKit.d.ts +686 -0
- package/docs/api/brandKit.md +1133 -0
- package/docs/api/bugReports.d.ts +181 -0
- package/docs/api/bugReports.md +268 -0
- package/docs/api/by-path.md +3260 -0
- package/docs/api/calendarInvites.d.ts +117 -0
- package/docs/api/calendarInvites.md +148 -0
- package/docs/api/campaignWorkflows.d.ts +152 -0
- package/docs/api/campaignWorkflows.md +200 -0
- package/docs/api/campaigns.d.ts +721 -0
- package/docs/api/campaigns.md +1236 -0
- package/docs/api/channels.d.ts +171 -0
- package/docs/api/channels.md +235 -0
- package/docs/api/cliCampaigns.d.ts +205 -0
- package/docs/api/cliCampaigns.md +256 -0
- package/docs/api/cliPipelines.d.ts +324 -0
- package/docs/api/cliPipelines.md +562 -0
- package/docs/api/clickHouse.d.ts +115 -0
- package/docs/api/clickHouse.md +138 -0
- package/docs/api/companies.d.ts +1636 -0
- package/docs/api/companies.md +2211 -0
- package/docs/api/companyIntelligence.d.ts +299 -0
- package/docs/api/companyIntelligence.md +488 -0
- package/docs/api/contacts.d.ts +2173 -0
- package/docs/api/contacts.md +3143 -0
- package/docs/api/content.d.ts +968 -0
- package/docs/api/content.md +1667 -0
- package/docs/api/contentGridSkills.d.ts +177 -0
- package/docs/api/contentGridSkills.md +271 -0
- package/docs/api/copilot.d.ts +1017 -0
- package/docs/api/copilot.md +1765 -0
- package/docs/api/crmSyncs.d.ts +215 -0
- package/docs/api/crmSyncs.md +301 -0
- package/docs/api/customerSuccess.d.ts +491 -0
- package/docs/api/customerSuccess.md +776 -0
- package/docs/api/deals.d.ts +1697 -0
- package/docs/api/deals.md +2436 -0
- package/docs/api/deliverability.d.ts +418 -0
- package/docs/api/deliverability.md +677 -0
- package/docs/api/desk.d.ts +1765 -0
- package/docs/api/desk.md +3007 -0
- package/docs/api/dialer.d.ts +1185 -0
- package/docs/api/dialer.md +2166 -0
- package/docs/api/dialerAnalytics.d.ts +187 -0
- package/docs/api/dialerAnalytics.md +257 -0
- package/docs/api/documents.d.ts +895 -0
- package/docs/api/documents.md +1440 -0
- package/docs/api/duplicates.d.ts +195 -0
- package/docs/api/duplicates.md +315 -0
- package/docs/api/eSign.d.ts +38 -0
- package/docs/api/eSign.md +54 -0
- package/docs/api/eSignature.d.ts +242 -0
- package/docs/api/eSignature.md +341 -0
- package/docs/api/enrichment.d.ts +3207 -0
- package/docs/api/enrichment.md +5225 -0
- package/docs/api/events.d.ts +115 -0
- package/docs/api/events.md +105 -0
- package/docs/api/fields.d.ts +482 -0
- package/docs/api/fields.md +566 -0
- package/docs/api/forms.d.ts +1012 -0
- package/docs/api/forms.md +1542 -0
- package/docs/api/gtmCampaigns.d.ts +662 -0
- package/docs/api/gtmCampaigns.md +1044 -0
- package/docs/api/gtmContext.d.ts +1187 -0
- package/docs/api/gtmContext.md +2112 -0
- package/docs/api/gtmDeliverability.d.ts +60 -0
- package/docs/api/gtmDeliverability.md +63 -0
- package/docs/api/gtmKnowledgeBase.d.ts +76 -0
- package/docs/api/gtmKnowledgeBase.md +91 -0
- package/docs/api/gtmLaunchHelpers.d.ts +123 -0
- package/docs/api/gtmLaunchHelpers.md +148 -0
- package/docs/api/gtmLibrary.d.ts +448 -0
- package/docs/api/gtmLibrary.md +780 -0
- package/docs/api/health.d.ts +39 -0
- package/docs/api/health.md +58 -0
- package/docs/api/imageLibrary.d.ts +341 -0
- package/docs/api/imageLibrary.md +569 -0
- package/docs/api/imports.d.ts +157 -0
- package/docs/api/imports.md +174 -0
- package/docs/api/inbox.d.ts +709 -0
- package/docs/api/inbox.md +1067 -0
- package/docs/api/install.d.ts +213 -0
- package/docs/api/install.md +317 -0
- package/docs/api/installedApps.d.ts +131 -0
- package/docs/api/installedApps.md +241 -0
- package/docs/api/integrationStatus.d.ts +142 -0
- package/docs/api/integrationStatus.md +205 -0
- package/docs/api/integrations.d.ts +2327 -0
- package/docs/api/integrations.md +3791 -0
- package/docs/api/intent.d.ts +482 -0
- package/docs/api/intent.md +858 -0
- package/docs/api/knowledge.d.ts +501 -0
- package/docs/api/knowledge.md +843 -0
- package/docs/api/knowledgeBase.d.ts +84 -0
- package/docs/api/knowledgeBase.md +96 -0
- package/docs/api/landingPages.d.ts +1411 -0
- package/docs/api/landingPages.md +2488 -0
- package/docs/api/leads.d.ts +133 -0
- package/docs/api/leads.md +180 -0
- package/docs/api/library.d.ts +217 -0
- package/docs/api/library.md +338 -0
- package/docs/api/linkedIn.d.ts +227 -0
- package/docs/api/linkedIn.md +289 -0
- package/docs/api/linkedInOutreach.d.ts +727 -0
- package/docs/api/linkedInOutreach.md +990 -0
- package/docs/api/lists.d.ts +1106 -0
- package/docs/api/lists.md +1609 -0
- package/docs/api/logs.d.ts +71 -0
- package/docs/api/logs.md +70 -0
- package/docs/api/mailboxes.d.ts +1050 -0
- package/docs/api/mailboxes.md +1690 -0
- package/docs/api/marketingIntelligence.d.ts +256 -0
- package/docs/api/marketingIntelligence.md +454 -0
- package/docs/api/marketplace.d.ts +3173 -0
- package/docs/api/marketplace.md +5953 -0
- package/docs/api/mcp.d.ts +69 -0
- package/docs/api/mcp.md +69 -0
- package/docs/api/me.d.ts +54 -0
- package/docs/api/me.md +56 -0
- package/docs/api/meetings.d.ts +539 -0
- package/docs/api/meetings.md +747 -0
- package/docs/api/newsletter.d.ts +1613 -0
- package/docs/api/newsletter.md +2746 -0
- package/docs/api/notes.d.ts +517 -0
- package/docs/api/notes.md +888 -0
- package/docs/api/notifications.d.ts +94 -0
- package/docs/api/notifications.md +105 -0
- package/docs/api/objects.d.ts +621 -0
- package/docs/api/objects.md +1098 -0
- package/docs/api/openSearch.d.ts +234 -0
- package/docs/api/openSearch.md +297 -0
- package/docs/api/ops.d.ts +299 -0
- package/docs/api/ops.md +339 -0
- package/docs/api/orgGovernance.d.ts +393 -0
- package/docs/api/orgGovernance.md +623 -0
- package/docs/api/orgVideos.d.ts +184 -0
- package/docs/api/orgVideos.md +252 -0
- package/docs/api/organizationSettings.d.ts +626 -0
- package/docs/api/organizationSettings.md +911 -0
- package/docs/api/phoneNumbers.d.ts +484 -0
- package/docs/api/phoneNumbers.md +777 -0
- package/docs/api/profile.d.ts +329 -0
- package/docs/api/profile.md +540 -0
- package/docs/api/programmaticPages.d.ts +400 -0
- package/docs/api/programmaticPages.md +626 -0
- package/docs/api/providerDomains.d.ts +866 -0
- package/docs/api/providerDomains.md +1446 -0
- package/docs/api/providerUsage.d.ts +129 -0
- package/docs/api/providerUsage.md +186 -0
- package/docs/api/public.d.ts +69 -0
- package/docs/api/public.md +78 -0
- package/docs/api/publicCopilot.d.ts +67 -0
- package/docs/api/publicCopilot.md +80 -0
- package/docs/api/publicSignals.d.ts +66 -0
- package/docs/api/publicSignals.md +71 -0
- package/docs/api/publicVisitors.d.ts +97 -0
- package/docs/api/publicVisitors.md +118 -0
- package/docs/api/quotes.d.ts +1564 -0
- package/docs/api/quotes.md +2553 -0
- package/docs/api/radar.d.ts +808 -0
- package/docs/api/radar.md +1431 -0
- package/docs/api/radarReports.d.ts +208 -0
- package/docs/api/radarReports.md +306 -0
- package/docs/api/recordRoles.d.ts +143 -0
- package/docs/api/recordRoles.md +175 -0
- package/docs/api/repos.d.ts +146 -0
- package/docs/api/repos.md +211 -0
- package/docs/api/research.d.ts +295 -0
- package/docs/api/research.md +534 -0
- package/docs/api/revenue.d.ts +402 -0
- package/docs/api/revenue.md +608 -0
- package/docs/api/revenueAnalytics.d.ts +147 -0
- package/docs/api/revenueAnalytics.md +212 -0
- package/docs/api/revenueLifecycle.d.ts +207 -0
- package/docs/api/revenueLifecycle.md +274 -0
- package/docs/api/revenueRecords.d.ts +372 -0
- package/docs/api/revenueRecords.md +563 -0
- package/docs/api/roles.d.ts +431 -0
- package/docs/api/roles.md +812 -0
- package/docs/api/salesCoach.d.ts +877 -0
- package/docs/api/salesCoach.md +1540 -0
- package/docs/api/sandbox.d.ts +210 -0
- package/docs/api/sandbox.md +380 -0
- package/docs/api/scans.d.ts +104 -0
- package/docs/api/scans.md +136 -0
- package/docs/api/scheduleBuy.d.ts +293 -0
- package/docs/api/scheduleBuy.md +431 -0
- package/docs/api/scraping.d.ts +266 -0
- package/docs/api/scraping.md +383 -0
- package/docs/api/sdrAnalytics.d.ts +138 -0
- package/docs/api/sdrAnalytics.md +246 -0
- package/docs/api/search.d.ts +598 -0
- package/docs/api/search.md +866 -0
- package/docs/api/seo.d.ts +447 -0
- package/docs/api/seo.md +660 -0
- package/docs/api/sequenceLifecycle.d.ts +439 -0
- package/docs/api/sequenceLifecycle.md +513 -0
- package/docs/api/sequences.d.ts +1936 -0
- package/docs/api/sequences.md +3232 -0
- package/docs/api/settings.d.ts +448 -0
- package/docs/api/settings.md +731 -0
- package/docs/api/signals.d.ts +1441 -0
- package/docs/api/signals.md +2526 -0
- package/docs/api/signatures.d.ts +719 -0
- package/docs/api/signatures.md +1247 -0
- package/docs/api/skills.d.ts +230 -0
- package/docs/api/skills.md +466 -0
- package/docs/api/snippet.d.ts +85 -0
- package/docs/api/snippet.md +106 -0
- package/docs/api/socialPublishing.d.ts +824 -0
- package/docs/api/socialPublishing.md +1245 -0
- package/docs/api/studioDocuments.d.ts +244 -0
- package/docs/api/studioDocuments.md +348 -0
- package/docs/api/support.d.ts +90 -0
- package/docs/api/support.md +76 -0
- package/docs/api/suppressions.d.ts +241 -0
- package/docs/api/suppressions.md +343 -0
- package/docs/api/surveys.d.ts +847 -0
- package/docs/api/surveys.md +1223 -0
- package/docs/api/tasks.d.ts +813 -0
- package/docs/api/tasks.md +1344 -0
- package/docs/api/teamMembers.d.ts +668 -0
- package/docs/api/teamMembers.md +1040 -0
- package/docs/api/teams.d.ts +784 -0
- package/docs/api/teams.md +1395 -0
- package/docs/api/usage.d.ts +277 -0
- package/docs/api/usage.md +389 -0
- package/docs/api/visitors.d.ts +690 -0
- package/docs/api/visitors.md +1075 -0
- package/docs/api/voice.d.ts +4661 -0
- package/docs/api/voice.md +7905 -0
- package/docs/api/webAnalytics.d.ts +964 -0
- package/docs/api/webAnalytics.md +1452 -0
- package/docs/api/webChat.d.ts +1704 -0
- package/docs/api/webChat.md +2048 -0
- package/docs/api/webhooks.d.ts +251 -0
- package/docs/api/webhooks.md +386 -0
- package/docs/api/websiteEditor.d.ts +324 -0
- package/docs/api/websiteEditor.md +517 -0
- package/docs/api/work.d.ts +2298 -0
- package/docs/api/work.md +3096 -0
- package/docs/api/workbench.d.ts +2962 -0
- package/docs/api/workbench.md +4884 -0
- package/docs/api/workflows.d.ts +1218 -0
- package/docs/api/workflows.md +2302 -0
- package/docs/sdk-clients.md +4339 -0
- package/package.json +10 -3
|
@@ -0,0 +1,1044 @@
|
|
|
1
|
+
<!-- Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. -->
|
|
2
|
+
|
|
3
|
+
# `g8.api.gtmCampaigns`: GTM Campaigns
|
|
4
|
+
|
|
5
|
+
22 operations (9 read, 2 destructive, 11 external).
|
|
6
|
+
|
|
7
|
+
4 of these also have a hand-written method (`g8.campaigns`), marked **★** below. Prefer the hand-written method when one exists: it unwraps the `data` envelope and takes friendlier arguments. See [../sdk-clients.md](../sdk-clients.md).
|
|
8
|
+
|
|
9
|
+
Every example below assumes this setup (server-side, API key):
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { g8 } from "@graph8/sdk";
|
|
13
|
+
|
|
14
|
+
g8.init({ apiKey: process.env.G8_API_KEY! });
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Example values are placeholders that match each field's type. Only required fields are shown. Every example is type-checked against the SDK in CI.
|
|
18
|
+
|
|
19
|
+
Exact TypeScript types for every operation on this page, and every schema they use: [gtmCampaigns.d.ts](gtmCampaigns.d.ts).
|
|
20
|
+
|
|
21
|
+
## Operations
|
|
22
|
+
|
|
23
|
+
| Call | HTTP | Tier | Scope | Summary |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| [`attachAudienceToCampaign`](#op-attachaudiencetocampaign) | `PUT /api/v1/campaigns/{campaign_id}/audience` | external | `campaigns:run` | Attach Audience To Campaign |
|
|
26
|
+
| [`createCampaign`](#op-createcampaign) ★ | `POST /api/v1/campaigns` | external | `campaigns:run` | Create Campaign |
|
|
27
|
+
| [`createCampaignDocument`](#op-createcampaigndocument) | `POST /api/v1/campaigns/{campaign_id}/documents` | external | `campaigns:run` | Create Campaign Document |
|
|
28
|
+
| [`createCampaignStep`](#op-createcampaignstep) | `POST /api/v1/campaigns/{campaign_id}/sequence/steps` | external | `campaigns:run` | Create Campaign Step |
|
|
29
|
+
| [`deleteCampaignDocument`](#op-deletecampaigndocument) | `DELETE /api/v1/campaigns/{campaign_id}/documents/{document_id}` | destructive | `campaigns:delete` | Delete Campaign Document |
|
|
30
|
+
| [`deleteCampaignStep`](#op-deletecampaignstep) | `DELETE /api/v1/campaigns/{campaign_id}/sequence/steps/{step_id}` | destructive | `campaigns:delete` | Delete Campaign Step |
|
|
31
|
+
| [`getCampaign`](#op-getcampaign) ★ | `GET /api/v1/campaigns/{campaign_id}` | read | `campaigns:read` | Get Campaign |
|
|
32
|
+
| [`getCampaignDocument`](#op-getcampaigndocument) | `GET /api/v1/campaigns/{campaign_id}/documents/{document_id}` | read | `campaigns:read` | Get Campaign Document |
|
|
33
|
+
| [`getCampaignFull`](#op-getcampaignfull) | `GET /api/v1/campaigns/{campaign_id}/full` | read | `campaigns:read` | Get Campaign Full |
|
|
34
|
+
| [`getCampaignMetrics`](#op-getcampaignmetrics) | `GET /api/v1/campaigns/{campaign_id}/metrics` | read | `campaigns:read` | Get Campaign Metrics |
|
|
35
|
+
| [`getCampaignSequence`](#op-getcampaignsequence) | `GET /api/v1/campaigns/{campaign_id}/sequence` | read | `campaigns:read` | Get Campaign Sequence |
|
|
36
|
+
| [`hideCampaignAdImage`](#op-hidecampaignadimage) | `POST /api/v1/campaigns/{campaign_id}/ad-images/{image_id}/hide` | external | `campaigns:run` | Hide Campaign Ad Image |
|
|
37
|
+
| [`launchCampaign`](#op-launchcampaign) ★ | `POST /api/v1/campaigns/{campaign_id}/launch` | external | `campaigns:launch` | Launch Campaign |
|
|
38
|
+
| [`listCampaignAdImages`](#op-listcampaignadimages) | `GET /api/v1/campaigns/{campaign_id}/ad-images` | read | `campaigns:read` | List Campaign Ad Images |
|
|
39
|
+
| [`listCampaignDocuments`](#op-listcampaigndocuments) | `GET /api/v1/campaigns/{campaign_id}/documents` | read | `campaigns:read` | List Campaign Documents |
|
|
40
|
+
| [`listCampaignIdeas`](#op-listcampaignideas) | `GET /api/v1/campaigns/ideas` | read | `campaigns:read` | List Campaign Ideas |
|
|
41
|
+
| [`listCampaigns`](#op-listcampaigns) ★ | `GET /api/v1/campaigns` | read | `campaigns:read` | List Campaigns |
|
|
42
|
+
| [`patchCampaignFull`](#op-patchcampaignfull) | `PATCH /api/v1/campaigns/{campaign_id}/full` | external | `campaigns:run` | Patch Campaign Full |
|
|
43
|
+
| [`updateCampaign`](#op-updatecampaign) | `PATCH /api/v1/campaigns/{campaign_id}` | external | `campaigns:run` | Update Campaign |
|
|
44
|
+
| [`updateCampaignDocument`](#op-updatecampaigndocument) | `PUT /api/v1/campaigns/{campaign_id}/documents/{document_id}` | external | `campaigns:run` | Update Campaign Document |
|
|
45
|
+
| [`updateCampaignSequence`](#op-updatecampaignsequence) | `PUT /api/v1/campaigns/{campaign_id}/sequence` | external | `campaigns:run` | Update Campaign Sequence |
|
|
46
|
+
| [`updateCampaignStep`](#op-updatecampaignstep) | `PUT /api/v1/campaigns/{campaign_id}/sequence/steps/{step_id}` | external | `campaigns:run` | Update Campaign Step |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
<a id="op-attachaudiencetocampaign"></a>
|
|
51
|
+
|
|
52
|
+
### `g8.api.gtmCampaigns.attachAudienceToCampaign(input)`
|
|
53
|
+
|
|
54
|
+
**Attach Audience To Campaign**
|
|
55
|
+
|
|
56
|
+
- HTTP: `PUT /api/v1/campaigns/{campaign_id}/audience`
|
|
57
|
+
- operationId: `attach_audience_to_campaign_campaigns__campaign_id__audience_put` (also callable as `g8.api.call("attach_audience_to_campaign_campaigns__campaign_id__audience_put", input)`)
|
|
58
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
59
|
+
- API-key scope: `campaigns:run`
|
|
60
|
+
|
|
61
|
+
Attach (or detach) a saved list to a campaign as its audience.
|
|
62
|
+
|
|
63
|
+
This is the missing link in Daniel's MCP flow: ``find list → create
|
|
64
|
+
campaign → attach audience → launch`` was previously a dead-end because
|
|
65
|
+
no REST/MCP path could set ``cb_campaigns.audience_list_id`` (the FE
|
|
66
|
+
"Attach Audience" dialog only went through an internal route).
|
|
67
|
+
|
|
68
|
+
Idempotent — setting the same list twice is a 200, no error. Pass
|
|
69
|
+
``list_id=null`` to detach. The launch endpoint reads
|
|
70
|
+
``cb_campaigns.audience_list_id`` when enrolling contacts; without it,
|
|
71
|
+
launch creates a sequence with zero enrollment.
|
|
72
|
+
|
|
73
|
+
**Input**
|
|
74
|
+
|
|
75
|
+
| Field | Type | Required | Description |
|
|
76
|
+
|---|---|---|---|
|
|
77
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
78
|
+
| `body` | `CampaignAttachAudienceRequest` | yes | Request body; fields below. |
|
|
79
|
+
|
|
80
|
+
Body fields (`CampaignAttachAudienceRequest`):
|
|
81
|
+
|
|
82
|
+
| Field | Type | Required | Description |
|
|
83
|
+
|---|---|---|---|
|
|
84
|
+
| `body.list_id` | `string \| null` | no | List ID to attach as the campaign's audience. Pass null to detach. The list must already exist in this org (matches audiences.id, the canonical lists table — accepts an integer or its string form). |
|
|
85
|
+
|
|
86
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
87
|
+
|
|
88
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
89
|
+
|
|
90
|
+
**Example**
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
94
|
+
const result = await g8.api.gtmCampaigns.attachAudienceToCampaign({ path: { campaign_id: "id" }, body: {} });
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
<a id="op-createcampaign"></a>
|
|
100
|
+
|
|
101
|
+
### `g8.api.gtmCampaigns.createCampaign(input)`
|
|
102
|
+
|
|
103
|
+
**Create Campaign**
|
|
104
|
+
|
|
105
|
+
- HTTP: `POST /api/v1/campaigns`
|
|
106
|
+
- operationId: `create_campaign_campaigns_post` (also callable as `g8.api.call("create_campaign_campaigns_post", input)`)
|
|
107
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
108
|
+
- API-key scope: `campaigns:run`
|
|
109
|
+
- ★ Hand-written: [`g8.campaigns.create()`](../sdk-clients.md#g8-campaigns-create)
|
|
110
|
+
|
|
111
|
+
Create a new campaign from scratch — full Studio "Convert to Campaign" parity.
|
|
112
|
+
|
|
113
|
+
The original handler only inserted ``cb_campaigns``. That left two
|
|
114
|
+
Studio-side gaps:
|
|
115
|
+
|
|
116
|
+
1. Studio's Campaigns workbench (``frontend/features/studio/components/
|
|
117
|
+
CampaignUnifiedTable.tsx``) filters ``cb_campaign_ideas`` WHERE
|
|
118
|
+
``converted_to_campaign=true`` and joins back to ``cb_campaigns`` via
|
|
119
|
+
``converted_campaign_id``. With no paired idea row, MCP-created
|
|
120
|
+
campaigns were invisible in the workbench (only the direct
|
|
121
|
+
``/studio?campaignId=...`` URL worked).
|
|
122
|
+
2. No documents were generated, so the campaign sat in "Not Ready" state
|
|
123
|
+
indefinitely. The launch flow silently produced empty sequences.
|
|
124
|
+
|
|
125
|
+
This handler now mirrors ``campaign_builder/routers/campaign_conversion.py
|
|
126
|
+
:convert_idea_to_campaign`` end-to-end:
|
|
127
|
+
|
|
128
|
+
* INSERT cb_campaigns (status=``copy_in_progress`` when generating, else ``draft``)
|
|
129
|
+
* INSERT paired cb_campaign_ideas row with ``source='mcp'``,
|
|
130
|
+
``converted_to_campaign=true``, ``converted_campaign_id=<new>``
|
|
131
|
+
* INSERT cb_campaign_metadata with ``total_documents`` calculated from the
|
|
132
|
+
target channels
|
|
133
|
+
* Scaffold ``sequence`` + ``step_catalog`` stub docs (idempotent)
|
|
134
|
+
* Dispatch ``generate_campaign_files_from_idea.delay(...)`` to Celery
|
|
135
|
+
|
|
136
|
+
Backwards-compatible: original 7-field callers still work AND see
|
|
137
|
+
byte-for-byte identical behavior because ``auto_generate_documents``
|
|
138
|
+
defaults to ``False``. All Studio-parity behavior (paired idea row,
|
|
139
|
+
metadata row, Celery dispatch, status='copy_in_progress') is opt-in
|
|
140
|
+
via ``auto_generate_documents=True``. The MCP ``g8_gtm_create_campaign``
|
|
141
|
+
tool wrapper sets it to ``True`` so Daniel's GTM agent gets the fix
|
|
142
|
+
without affecting any other direct API caller.
|
|
143
|
+
|
|
144
|
+
**Input**
|
|
145
|
+
|
|
146
|
+
| Field | Type | Required | Description |
|
|
147
|
+
|---|---|---|---|
|
|
148
|
+
| `body` | `developer_api__interfaces__v1__gtm_campaigns_router__CampaignCreateRequest` | yes | Request body; fields below. |
|
|
149
|
+
|
|
150
|
+
Body fields (`developer_api__interfaces__v1__gtm_campaigns_router__CampaignCreateRequest`):
|
|
151
|
+
|
|
152
|
+
| Field | Type | Required | Description |
|
|
153
|
+
|---|---|---|---|
|
|
154
|
+
| `body.name` | `string` | yes | Campaign name max length 255 |
|
|
155
|
+
| `body.audience_list_id` | `string \| null` | no | If provided, attaches this list ID to cb_campaigns.audience_list_id at create time. |
|
|
156
|
+
| `body.auto_generate_documents` | `boolean` | no | When True, dispatches the Celery campaign-content generator asynchronously after creation: the paired cb_campaign_ideas row is inserted (so the FE workbench sees the campaign), cb_campaign_metadata is created, the campaign starts in status='copy_in_progress', and flips to 'active' once docs are ready (~60-90s). Default is False to preserve byte-for-byte backwards compatibility with the original b… default `false` |
|
|
157
|
+
| `body.brief` | `string \| null` | no | Campaign brief |
|
|
158
|
+
| `body.category` | `string` | no | Campaign category default `"Outbound"`, max length 100 |
|
|
159
|
+
| `body.core_concept` | `string \| null` | no | Core concept |
|
|
160
|
+
| `body.execution_targets` | `Array<string> \| null` | no | Execution destinations: sequencer, dialer, or content_only. |
|
|
161
|
+
| `body.goal` | `string \| null` | no | Campaign goal max length 255 |
|
|
162
|
+
| `body.primary_hook` | `string \| null` | no | Primary hook text |
|
|
163
|
+
| `body.secondary_hooks` | `Array<string> \| null` | no | Additional hook variations to seed the campaign idea with. |
|
|
164
|
+
| `body.target_channels` | `Array<string> \| null` | no | Channels the campaign will use, e.g. ['email'], ['email','linkedin']. Drives which copy documents the auto-generator creates. Defaults to ['email']. |
|
|
165
|
+
| `body.target_persona` | `string \| null` | no | Target persona max length 200 |
|
|
166
|
+
|
|
167
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
168
|
+
|
|
169
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
170
|
+
|
|
171
|
+
**Example**
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
175
|
+
const result = await g8.api.gtmCampaigns.createCampaign({ body: { name: "Example" } });
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
<a id="op-createcampaigndocument"></a>
|
|
181
|
+
|
|
182
|
+
### `g8.api.gtmCampaigns.createCampaignDocument(input)`
|
|
183
|
+
|
|
184
|
+
**Create Campaign Document**
|
|
185
|
+
|
|
186
|
+
- HTTP: `POST /api/v1/campaigns/{campaign_id}/documents`
|
|
187
|
+
- operationId: `create_campaign_document_campaigns__campaign_id__documents_post` (also callable as `g8.api.call("create_campaign_document_campaigns__campaign_id__documents_post", input)`)
|
|
188
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
189
|
+
- API-key scope: `campaigns:run`
|
|
190
|
+
|
|
191
|
+
Create a campaign document with content stored in metadata.
|
|
192
|
+
|
|
193
|
+
``meta_data`` shape mirrors what the Celery doc-generator writes so the
|
|
194
|
+
FE renders MCP-created docs identically: ``content`` (markdown body),
|
|
195
|
+
``completed`` (mirrors status=='completed' so launch checklist counts
|
|
196
|
+
it), and optional ``structured_data`` (parsed payload, e.g. sequence
|
|
197
|
+
step list).
|
|
198
|
+
|
|
199
|
+
**Input**
|
|
200
|
+
|
|
201
|
+
| Field | Type | Required | Description |
|
|
202
|
+
|---|---|---|---|
|
|
203
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
204
|
+
| `body` | `CampaignDocumentCreateRequest` | yes | Request body; fields below. |
|
|
205
|
+
|
|
206
|
+
Body fields (`CampaignDocumentCreateRequest`):
|
|
207
|
+
|
|
208
|
+
| Field | Type | Required | Description |
|
|
209
|
+
|---|---|---|---|
|
|
210
|
+
| `body.display_name` | `string` | yes | Human-readable document name |
|
|
211
|
+
| `body.file_type` | `string` | yes | Document type, for example campaign_brief or sequence |
|
|
212
|
+
| `body.content` | `string` | no | Document content default `""` |
|
|
213
|
+
| `body.folder_path` | `string \| null` | no | Optional folder path |
|
|
214
|
+
| `body.status` | `string` | no | Document status — 'draft' (default) or 'completed' default `"draft"` |
|
|
215
|
+
| `body.structured_data` | `Record<string, unknown> \| null` | no | Optional structured payload (e.g., sequence steps, persona JSON) stored alongside the markdown content at meta_data.structured_data. Mirrors the update path so the MCP create+update flow is symmetric. |
|
|
216
|
+
|
|
217
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
218
|
+
|
|
219
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
220
|
+
|
|
221
|
+
**Example**
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
225
|
+
const result = await g8.api.gtmCampaigns.createCampaignDocument({
|
|
226
|
+
path: { campaign_id: "id" },
|
|
227
|
+
body: { display_name: "Example", file_type: "example" },
|
|
228
|
+
});
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
<a id="op-createcampaignstep"></a>
|
|
234
|
+
|
|
235
|
+
### `g8.api.gtmCampaigns.createCampaignStep(input)`
|
|
236
|
+
|
|
237
|
+
**Create Campaign Step**
|
|
238
|
+
|
|
239
|
+
- HTTP: `POST /api/v1/campaigns/{campaign_id}/sequence/steps`
|
|
240
|
+
- operationId: `create_campaign_step_campaigns__campaign_id__sequence_steps_post` (also callable as `g8.api.call("create_campaign_step_campaigns__campaign_id__sequence_steps_post", input)`)
|
|
241
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
242
|
+
- API-key scope: `campaigns:run`
|
|
243
|
+
|
|
244
|
+
Create a step definition and append it to the campaign sequence.
|
|
245
|
+
|
|
246
|
+
**Input**
|
|
247
|
+
|
|
248
|
+
| Field | Type | Required | Description |
|
|
249
|
+
|---|---|---|---|
|
|
250
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
251
|
+
| `body` | `CreateStepRequest` | yes | Request body; fields below. |
|
|
252
|
+
|
|
253
|
+
Body fields (`CreateStepRequest`):
|
|
254
|
+
|
|
255
|
+
| Field | Type | Required | Description |
|
|
256
|
+
|---|---|---|---|
|
|
257
|
+
| `body.channel` | `string` | yes | |
|
|
258
|
+
| `body.day` | `integer` | yes | |
|
|
259
|
+
| `body.mode` | `string` | yes | |
|
|
260
|
+
| `body.name` | `string` | yes | |
|
|
261
|
+
| `body.angle_id` | `string \| null` | no | |
|
|
262
|
+
| `body.condition` | `string \| null` | no | |
|
|
263
|
+
| `body.constraints` | `Record<string, unknown>` | no | |
|
|
264
|
+
| `body.cta_type` | `string` | no | default `"soft_ask"` |
|
|
265
|
+
| `body.personalization_level` | `string` | no | default `"medium"` |
|
|
266
|
+
| `body.platform` | `string \| null` | no | |
|
|
267
|
+
| `body.stop_on_reply` | `boolean` | no | default `true` |
|
|
268
|
+
|
|
269
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
270
|
+
|
|
271
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
272
|
+
|
|
273
|
+
**Example**
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
277
|
+
const result = await g8.api.gtmCampaigns.createCampaignStep({
|
|
278
|
+
path: { campaign_id: "id" },
|
|
279
|
+
body: { channel: "example", day: 1, mode: "example", name: "Example" },
|
|
280
|
+
});
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
<a id="op-deletecampaigndocument"></a>
|
|
286
|
+
|
|
287
|
+
### `g8.api.gtmCampaigns.deleteCampaignDocument(input)`
|
|
288
|
+
|
|
289
|
+
**Delete Campaign Document**
|
|
290
|
+
|
|
291
|
+
- HTTP: `DELETE /api/v1/campaigns/{campaign_id}/documents/{document_id}`
|
|
292
|
+
- operationId: `delete_campaign_document_campaigns__campaign_id__documents__document_id__delete` (also callable as `g8.api.call("delete_campaign_document_campaigns__campaign_id__documents__document_id__delete", input)`)
|
|
293
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
294
|
+
- API-key scope: `campaigns:delete`
|
|
295
|
+
|
|
296
|
+
Delete a campaign document.
|
|
297
|
+
|
|
298
|
+
**Input**
|
|
299
|
+
|
|
300
|
+
| Field | Type | Required | Description |
|
|
301
|
+
|---|---|---|---|
|
|
302
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
303
|
+
| `path.document_id` | `string` | yes | Document ID |
|
|
304
|
+
|
|
305
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
306
|
+
|
|
307
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
308
|
+
|
|
309
|
+
**Example**
|
|
310
|
+
|
|
311
|
+
```ts
|
|
312
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
313
|
+
const result = await g8.api.gtmCampaigns.deleteCampaignDocument({ path: { campaign_id: "id", document_id: "id" } });
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
<a id="op-deletecampaignstep"></a>
|
|
319
|
+
|
|
320
|
+
### `g8.api.gtmCampaigns.deleteCampaignStep(input)`
|
|
321
|
+
|
|
322
|
+
**Delete Campaign Step**
|
|
323
|
+
|
|
324
|
+
- HTTP: `DELETE /api/v1/campaigns/{campaign_id}/sequence/steps/{step_id}`
|
|
325
|
+
- operationId: `delete_campaign_step_campaigns__campaign_id__sequence_steps__step_id__delete` (also callable as `g8.api.call("delete_campaign_step_campaigns__campaign_id__sequence_steps__step_id__delete", input)`)
|
|
326
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
327
|
+
- API-key scope: `campaigns:delete`
|
|
328
|
+
|
|
329
|
+
Remove a sequence step from the catalog and sequence order.
|
|
330
|
+
|
|
331
|
+
**Input**
|
|
332
|
+
|
|
333
|
+
| Field | Type | Required | Description |
|
|
334
|
+
|---|---|---|---|
|
|
335
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
336
|
+
| `path.step_id` | `string` | yes | Step ID |
|
|
337
|
+
|
|
338
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
339
|
+
|
|
340
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
341
|
+
|
|
342
|
+
**Example**
|
|
343
|
+
|
|
344
|
+
```ts
|
|
345
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
346
|
+
const result = await g8.api.gtmCampaigns.deleteCampaignStep({ path: { campaign_id: "id", step_id: "id" } });
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
<a id="op-getcampaign"></a>
|
|
352
|
+
|
|
353
|
+
### `g8.api.gtmCampaigns.getCampaign(input)`
|
|
354
|
+
|
|
355
|
+
**Get Campaign**
|
|
356
|
+
|
|
357
|
+
- HTTP: `GET /api/v1/campaigns/{campaign_id}`
|
|
358
|
+
- operationId: `get_campaign_campaigns__campaign_id__get` (also callable as `g8.api.call("get_campaign_campaigns__campaign_id__get", input)`)
|
|
359
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
360
|
+
- API-key scope: `campaigns:read`
|
|
361
|
+
- ★ Hand-written: [`g8.campaigns.get()`](../sdk-clients.md#g8-campaigns-get)
|
|
362
|
+
|
|
363
|
+
Get details of a specific campaign including generated documents.
|
|
364
|
+
|
|
365
|
+
**Input**
|
|
366
|
+
|
|
367
|
+
| Field | Type | Required | Description |
|
|
368
|
+
|---|---|---|---|
|
|
369
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
370
|
+
|
|
371
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
372
|
+
|
|
373
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
374
|
+
|
|
375
|
+
**Example**
|
|
376
|
+
|
|
377
|
+
```ts
|
|
378
|
+
const result = await g8.api.gtmCampaigns.getCampaign({ path: { campaign_id: "id" } });
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
<a id="op-getcampaigndocument"></a>
|
|
384
|
+
|
|
385
|
+
### `g8.api.gtmCampaigns.getCampaignDocument(input)`
|
|
386
|
+
|
|
387
|
+
**Get Campaign Document**
|
|
388
|
+
|
|
389
|
+
- HTTP: `GET /api/v1/campaigns/{campaign_id}/documents/{document_id}`
|
|
390
|
+
- operationId: `get_campaign_document_campaigns__campaign_id__documents__document_id__get` (also callable as `g8.api.call("get_campaign_document_campaigns__campaign_id__documents__document_id__get", input)`)
|
|
391
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
392
|
+
- API-key scope: `campaigns:read`
|
|
393
|
+
|
|
394
|
+
Get full content of a specific campaign document.
|
|
395
|
+
|
|
396
|
+
**Input**
|
|
397
|
+
|
|
398
|
+
| Field | Type | Required | Description |
|
|
399
|
+
|---|---|---|---|
|
|
400
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
401
|
+
| `path.document_id` | `string` | yes | Document ID |
|
|
402
|
+
|
|
403
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
404
|
+
|
|
405
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
406
|
+
|
|
407
|
+
**Example**
|
|
408
|
+
|
|
409
|
+
```ts
|
|
410
|
+
const result = await g8.api.gtmCampaigns.getCampaignDocument({ path: { campaign_id: "id", document_id: "id" } });
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
<a id="op-getcampaignfull"></a>
|
|
416
|
+
|
|
417
|
+
### `g8.api.gtmCampaigns.getCampaignFull(input)`
|
|
418
|
+
|
|
419
|
+
**Get Campaign Full**
|
|
420
|
+
|
|
421
|
+
- HTTP: `GET /api/v1/campaigns/{campaign_id}/full`
|
|
422
|
+
- operationId: `get_campaign_full_campaigns__campaign_id__full_get` (also callable as `g8.api.call("get_campaign_full_campaigns__campaign_id__full_get", input)`)
|
|
423
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
424
|
+
- API-key scope: `campaigns:read`
|
|
425
|
+
|
|
426
|
+
Get the **kitchen-sink** campaign payload in one round trip.
|
|
427
|
+
|
|
428
|
+
Includes: campaign row, attached audience list summary, ALL documents
|
|
429
|
+
(with content), sequence + step catalog, and linked sequencer sequences
|
|
430
|
+
(so the caller can tell at a glance whether the campaign has been
|
|
431
|
+
launched yet).
|
|
432
|
+
|
|
433
|
+
Designed for the MCP "load entire campaign for editing" path so agents
|
|
434
|
+
don't have to chain ``GET /campaigns/{id}`` → ``/documents`` → ``/sequence``
|
|
435
|
+
just to see the current state.
|
|
436
|
+
|
|
437
|
+
**Input**
|
|
438
|
+
|
|
439
|
+
| Field | Type | Required | Description |
|
|
440
|
+
|---|---|---|---|
|
|
441
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
442
|
+
|
|
443
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
444
|
+
|
|
445
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
446
|
+
|
|
447
|
+
**Example**
|
|
448
|
+
|
|
449
|
+
```ts
|
|
450
|
+
const result = await g8.api.gtmCampaigns.getCampaignFull({ path: { campaign_id: "id" } });
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
<a id="op-getcampaignmetrics"></a>
|
|
456
|
+
|
|
457
|
+
### `g8.api.gtmCampaigns.getCampaignMetrics(input)`
|
|
458
|
+
|
|
459
|
+
**Get Campaign Metrics**
|
|
460
|
+
|
|
461
|
+
- HTTP: `GET /api/v1/campaigns/{campaign_id}/metrics`
|
|
462
|
+
- operationId: `get_campaign_metrics_campaigns__campaign_id__metrics_get` (also callable as `g8.api.call("get_campaign_metrics_campaigns__campaign_id__metrics_get", input)`)
|
|
463
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
464
|
+
- API-key scope: `campaigns:read`
|
|
465
|
+
|
|
466
|
+
Get campaign execution metrics — sequence status + email sent/replied counts.
|
|
467
|
+
|
|
468
|
+
Thin wrapper around the existing ``campaigns.metrics`` handler. The
|
|
469
|
+
handler queries ClickHouse for per-sequence event aggregates and joins
|
|
470
|
+
them to the campaign's linked sequences via ``cb_campaign_sequence_links``.
|
|
471
|
+
|
|
472
|
+
Read-only. Returns the same shape the handler produces. Each campaign carries
|
|
473
|
+
a ``metric_status`` (available | zero | stale | unknown | missing) that
|
|
474
|
+
reconciles the ClickHouse engagement rollup against Postgres send receipts
|
|
475
|
+
(``seqcontactexecutedsteps``): if analytics are unreachable the status is
|
|
476
|
+
``unknown`` (NOT a zero), and if send receipts prove sends the rollup has not
|
|
477
|
+
counted the status is ``stale``. Read ``reconciliation`` and ``measured_range``
|
|
478
|
+
before concluding anything about delivery — never treat a bare zero as an outage.
|
|
479
|
+
|
|
480
|
+
**Input**
|
|
481
|
+
|
|
482
|
+
| Field | Type | Required | Description |
|
|
483
|
+
|---|---|---|---|
|
|
484
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
485
|
+
| `query.days` | `integer` | no | Lookback window in days default `30` |
|
|
486
|
+
|
|
487
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
488
|
+
|
|
489
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
490
|
+
|
|
491
|
+
**Example**
|
|
492
|
+
|
|
493
|
+
```ts
|
|
494
|
+
const result = await g8.api.gtmCampaigns.getCampaignMetrics({ path: { campaign_id: "id" } });
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
<a id="op-getcampaignsequence"></a>
|
|
500
|
+
|
|
501
|
+
### `g8.api.gtmCampaigns.getCampaignSequence(input)`
|
|
502
|
+
|
|
503
|
+
**Get Campaign Sequence**
|
|
504
|
+
|
|
505
|
+
- HTTP: `GET /api/v1/campaigns/{campaign_id}/sequence`
|
|
506
|
+
- operationId: `get_campaign_sequence_campaigns__campaign_id__sequence_get` (also callable as `g8.api.call("get_campaign_sequence_campaigns__campaign_id__sequence_get", input)`)
|
|
507
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
508
|
+
- API-key scope: `campaigns:read`
|
|
509
|
+
|
|
510
|
+
Get the campaign sequence and step catalog documents.
|
|
511
|
+
|
|
512
|
+
**Input**
|
|
513
|
+
|
|
514
|
+
| Field | Type | Required | Description |
|
|
515
|
+
|---|---|---|---|
|
|
516
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
517
|
+
|
|
518
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
519
|
+
|
|
520
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
521
|
+
|
|
522
|
+
**Example**
|
|
523
|
+
|
|
524
|
+
```ts
|
|
525
|
+
const result = await g8.api.gtmCampaigns.getCampaignSequence({ path: { campaign_id: "id" } });
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
<a id="op-hidecampaignadimage"></a>
|
|
531
|
+
|
|
532
|
+
### `g8.api.gtmCampaigns.hideCampaignAdImage(input)`
|
|
533
|
+
|
|
534
|
+
**Hide Campaign Ad Image**
|
|
535
|
+
|
|
536
|
+
- HTTP: `POST /api/v1/campaigns/{campaign_id}/ad-images/{image_id}/hide`
|
|
537
|
+
- operationId: `hide_campaign_ad_image_campaigns__campaign_id__ad_images__image_id__hide_post` (also callable as `g8.api.call("hide_campaign_ad_image_campaigns__campaign_id__ad_images__image_id__hide_post", input)`)
|
|
538
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
539
|
+
- API-key scope: `campaigns:run`
|
|
540
|
+
|
|
541
|
+
Mark an ad image as hidden (feedback='down'), so it drops out of the
|
|
542
|
+
MCP App grid and any future listing.
|
|
543
|
+
|
|
544
|
+
Idempotent: re-posting against an already-hidden image is a no-op, still
|
|
545
|
+
returns 200. Returns 404 only if the image doesn't exist (or doesn't
|
|
546
|
+
belong to the caller's org / this campaign).
|
|
547
|
+
|
|
548
|
+
This is the interactive action on the `ui://campaigns/ad-images` MCP
|
|
549
|
+
App. The app calls `g8_hide_ad_image` over postMessage; that tool hits
|
|
550
|
+
this endpoint; the response tells the app which image id to drop from
|
|
551
|
+
its local state.
|
|
552
|
+
|
|
553
|
+
**Input**
|
|
554
|
+
|
|
555
|
+
| Field | Type | Required | Description |
|
|
556
|
+
|---|---|---|---|
|
|
557
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
558
|
+
| `path.image_id` | `string` | yes | Ad image ID (cb_website_images.id) |
|
|
559
|
+
|
|
560
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
561
|
+
|
|
562
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
563
|
+
|
|
564
|
+
**Example**
|
|
565
|
+
|
|
566
|
+
```ts
|
|
567
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
568
|
+
const result = await g8.api.gtmCampaigns.hideCampaignAdImage({ path: { campaign_id: "id", image_id: "id" } });
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
573
|
+
<a id="op-launchcampaign"></a>
|
|
574
|
+
|
|
575
|
+
### `g8.api.gtmCampaigns.launchCampaign(input)`
|
|
576
|
+
|
|
577
|
+
**Launch Campaign**
|
|
578
|
+
|
|
579
|
+
- HTTP: `POST /api/v1/campaigns/{campaign_id}/launch`
|
|
580
|
+
- operationId: `launch_campaign_campaigns__campaign_id__launch_post` (also callable as `g8.api.call("launch_campaign_campaigns__campaign_id__launch_post", input)`)
|
|
581
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
582
|
+
- API-key scope: `campaigns:launch`
|
|
583
|
+
- ★ Hand-written: [`g8.campaigns.launch()`](../sdk-clients.md#g8-campaigns-launch)
|
|
584
|
+
|
|
585
|
+
Launch a campaign through the canonical Sequencer V2 workflow.
|
|
586
|
+
|
|
587
|
+
This does two things end-to-end:
|
|
588
|
+
|
|
589
|
+
1. **Push** the campaign to the sequencer. The bridge loads the campaign's
|
|
590
|
+
generated documents (email/LinkedIn/phone/SMS copy), transforms them
|
|
591
|
+
into sequencer steps, and creates a new ``SeqSequence`` row with the
|
|
592
|
+
campaign content attached. A ``CampaignSequenceLink`` row links the two.
|
|
593
|
+
2. **Run** the sequence through the same V2 workflow used by Sequencer.
|
|
594
|
+
The response reports ``live`` only after synchronous initialization has
|
|
595
|
+
completed, or ``scheduling`` with job details for background work.
|
|
596
|
+
|
|
597
|
+
Idempotency: re-launching a campaign that already has an active sequence
|
|
598
|
+
returns 409 unless ``force`` is implied via a future query-param. This is
|
|
599
|
+
consistent with the UI's bridge/push behaviour.
|
|
600
|
+
|
|
601
|
+
Pre-flight is mandatory. The deprecated ``validate`` parameter is accepted
|
|
602
|
+
only as ``true``; ``false`` is rejected before any sequence is created.
|
|
603
|
+
|
|
604
|
+
WARNING: this begins sending real outreach to real contacts.
|
|
605
|
+
|
|
606
|
+
**Input**
|
|
607
|
+
|
|
608
|
+
| Field | Type | Required | Description |
|
|
609
|
+
|---|---|---|---|
|
|
610
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
611
|
+
| `query.validate` | `boolean` | no | Deprecated compatibility parameter. Readiness validation is always enforced; false is rejected before any sequence is created. default `true` |
|
|
612
|
+
| `body` | `CampaignLaunchRequest \| null` | no | Request body; fields below. |
|
|
613
|
+
|
|
614
|
+
Body fields:
|
|
615
|
+
|
|
616
|
+
| Field | Type | Required | Description |
|
|
617
|
+
|---|---|---|---|
|
|
618
|
+
| `body.appointment_id` | `integer \| null` | no | Calendar event-type ID (from GET /event-types) to attach as the booking link on the sequence. Stamped onto seqsequences.appointment_id. When omitted no booking link is attached and any sequence step referencing `{{booking_link}}` will render the org-default link (or empty). |
|
|
619
|
+
| `body.disable_auto_pick` | `boolean` | no | Deprecated safety escape hatch. Launch now rejects True because a consequential action cannot proceed without an active sender. default `false`, deprecated |
|
|
620
|
+
| `body.schedule_id` | `string \| null` | no | Send-window schedule UUID (from GET /schedules). Stamped onto seqsequences.schedule_id. When omitted the sequencer falls back to its org-default send window. |
|
|
621
|
+
| `body.sender_mailbox_ids` | `Array<integer> \| null` | no | Explicit list of mailbox IDs (from GET /mailboxes) to attach as sequence channels before launch. Each ID must reference a connection_status='active', non-archived mailbox in this org. When omitted, the bridge auto-picks the first active email mailbox (ORDER BY id ASC). If no supported sender is available, launch fails before sequence creation. |
|
|
622
|
+
| `body.textual_agent_name` | `string \| null` | no | Voice-service agent identifier (from GET /agents) used for email / social steps. Stamped onto seqsequences.textual_agent_name. Pass the same value as `voice_agent_name` to use one agent across all channels (the common case — the unified Agent row already bundles persona + voice + phone + the attached appointment event). |
|
|
623
|
+
| `body.voice_agent_name` | `string \| null` | no | Voice-service agent identifier (from GET /agents) used for phone / SMS steps. Stamped onto seqsequences.voice_agent_name. When you want a single agent for all channels, set both this and `textual_agent_name` to the same value. |
|
|
624
|
+
|
|
625
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
626
|
+
|
|
627
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
628
|
+
|
|
629
|
+
**Example**
|
|
630
|
+
|
|
631
|
+
```ts
|
|
632
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
633
|
+
const result = await g8.api.gtmCampaigns.launchCampaign({ path: { campaign_id: "id" } });
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
---
|
|
637
|
+
|
|
638
|
+
<a id="op-listcampaignadimages"></a>
|
|
639
|
+
|
|
640
|
+
### `g8.api.gtmCampaigns.listCampaignAdImages(input)`
|
|
641
|
+
|
|
642
|
+
**List Campaign Ad Images**
|
|
643
|
+
|
|
644
|
+
- HTTP: `GET /api/v1/campaigns/{campaign_id}/ad-images`
|
|
645
|
+
- operationId: `list_campaign_ad_images_campaigns__campaign_id__ad_images_get` (also callable as `g8.api.call("list_campaign_ad_images_campaigns__campaign_id__ad_images_get", input)`)
|
|
646
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
647
|
+
- API-key scope: `campaigns:read`
|
|
648
|
+
|
|
649
|
+
List ad image creatives generated for this campaign.
|
|
650
|
+
|
|
651
|
+
Ad images live in `cb_website_images` with `category='ad'` and a
|
|
652
|
+
`campaign_id` back-reference (the AI generator writes there, NOT into
|
|
653
|
+
`cb_campaign_documents`). This endpoint gives the MCP HTML resource a
|
|
654
|
+
single place to pull the creative grid without reaching into the
|
|
655
|
+
Studio-private `/v1/website-images` path.
|
|
656
|
+
|
|
657
|
+
**Input**
|
|
658
|
+
|
|
659
|
+
| Field | Type | Required | Description |
|
|
660
|
+
|---|---|---|---|
|
|
661
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
662
|
+
|
|
663
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
664
|
+
|
|
665
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
666
|
+
|
|
667
|
+
**Example**
|
|
668
|
+
|
|
669
|
+
```ts
|
|
670
|
+
const result = await g8.api.gtmCampaigns.listCampaignAdImages({ path: { campaign_id: "id" } });
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
675
|
+
<a id="op-listcampaigndocuments"></a>
|
|
676
|
+
|
|
677
|
+
### `g8.api.gtmCampaigns.listCampaignDocuments(input)`
|
|
678
|
+
|
|
679
|
+
**List Campaign Documents**
|
|
680
|
+
|
|
681
|
+
- HTTP: `GET /api/v1/campaigns/{campaign_id}/documents`
|
|
682
|
+
- operationId: `list_campaign_documents_campaigns__campaign_id__documents_get` (also callable as `g8.api.call("list_campaign_documents_campaigns__campaign_id__documents_get", input)`)
|
|
683
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
684
|
+
- API-key scope: `campaigns:read`
|
|
685
|
+
|
|
686
|
+
List document metadata for a campaign.
|
|
687
|
+
|
|
688
|
+
**Input**
|
|
689
|
+
|
|
690
|
+
| Field | Type | Required | Description |
|
|
691
|
+
|---|---|---|---|
|
|
692
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
693
|
+
|
|
694
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
695
|
+
|
|
696
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
697
|
+
|
|
698
|
+
**Example**
|
|
699
|
+
|
|
700
|
+
```ts
|
|
701
|
+
const result = await g8.api.gtmCampaigns.listCampaignDocuments({ path: { campaign_id: "id" } });
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
---
|
|
705
|
+
|
|
706
|
+
<a id="op-listcampaignideas"></a>
|
|
707
|
+
|
|
708
|
+
### `g8.api.gtmCampaigns.listCampaignIdeas(input?)`
|
|
709
|
+
|
|
710
|
+
**List Campaign Ideas**
|
|
711
|
+
|
|
712
|
+
- HTTP: `GET /api/v1/campaigns/ideas`
|
|
713
|
+
- operationId: `list_campaign_ideas_campaigns_ideas_get` (also callable as `g8.api.call("list_campaign_ideas_campaigns_ideas_get", input)`)
|
|
714
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
715
|
+
- API-key scope: `campaigns:read`
|
|
716
|
+
|
|
717
|
+
List saved campaign ideas for this organization.
|
|
718
|
+
|
|
719
|
+
**Input**
|
|
720
|
+
|
|
721
|
+
| Field | Type | Required | Description |
|
|
722
|
+
|---|---|---|---|
|
|
723
|
+
| `query.limit` | `integer` | no | Items per page default `50` |
|
|
724
|
+
| `query.favorited` | `boolean \| null` | no | Filter favorited ideas |
|
|
725
|
+
|
|
726
|
+
**Returns** `ApiResponse_list_dict__`: the envelope `{ data: Array<Record<string, unknown>>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
727
|
+
|
|
728
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
729
|
+
|
|
730
|
+
**Example**
|
|
731
|
+
|
|
732
|
+
```ts
|
|
733
|
+
const result = await g8.api.gtmCampaigns.listCampaignIdeas();
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
---
|
|
737
|
+
|
|
738
|
+
<a id="op-listcampaigns"></a>
|
|
739
|
+
|
|
740
|
+
### `g8.api.gtmCampaigns.listCampaigns(input?)`
|
|
741
|
+
|
|
742
|
+
**List Campaigns**
|
|
743
|
+
|
|
744
|
+
- HTTP: `GET /api/v1/campaigns`
|
|
745
|
+
- operationId: `list_campaigns_campaigns_get` (also callable as `g8.api.call("list_campaigns_campaigns_get", input)`)
|
|
746
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
747
|
+
- API-key scope: `campaigns:read`
|
|
748
|
+
- ★ Hand-written: [`g8.campaigns.list()`](../sdk-clients.md#g8-campaigns-list)
|
|
749
|
+
|
|
750
|
+
List campaigns for this organization.
|
|
751
|
+
|
|
752
|
+
**Input**
|
|
753
|
+
|
|
754
|
+
| Field | Type | Required | Description |
|
|
755
|
+
|---|---|---|---|
|
|
756
|
+
| `query.page` | `integer` | no | Page number default `1` |
|
|
757
|
+
| `query.limit` | `integer` | no | Items per page default `50` |
|
|
758
|
+
|
|
759
|
+
**Returns** `ApiResponse_list_dict__`: the envelope `{ data: Array<Record<string, unknown>>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
760
|
+
|
|
761
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
762
|
+
|
|
763
|
+
**Example**
|
|
764
|
+
|
|
765
|
+
```ts
|
|
766
|
+
const result = await g8.api.gtmCampaigns.listCampaigns();
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
---
|
|
770
|
+
|
|
771
|
+
<a id="op-patchcampaignfull"></a>
|
|
772
|
+
|
|
773
|
+
### `g8.api.gtmCampaigns.patchCampaignFull(input)`
|
|
774
|
+
|
|
775
|
+
**Patch Campaign Full**
|
|
776
|
+
|
|
777
|
+
- HTTP: `PATCH /api/v1/campaigns/{campaign_id}/full`
|
|
778
|
+
- operationId: `patch_campaign_full_campaigns__campaign_id__full_patch` (also callable as `g8.api.call("patch_campaign_full_campaigns__campaign_id__full_patch", input)`)
|
|
779
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
780
|
+
- API-key scope: `campaigns:run`
|
|
781
|
+
|
|
782
|
+
Apply a deep-update to a campaign in one round trip.
|
|
783
|
+
|
|
784
|
+
Behavior:
|
|
785
|
+
- Campaign fields (name/brief/hook/etc.) update the row when present.
|
|
786
|
+
- ``audience_list_id`` attaches; ``detach_audience=true`` clears it.
|
|
787
|
+
- ``documents[*]`` either updates an existing doc by id, or creates a
|
|
788
|
+
new doc when id is omitted (file_type + display_name required).
|
|
789
|
+
- ``sequence_steps`` replaces the sequence ordering verbatim
|
|
790
|
+
(same semantics as PUT /sequence).
|
|
791
|
+
|
|
792
|
+
Returns the full kitchen-sink payload (same shape as GET /full).
|
|
793
|
+
Backwards-compat: omitting any field is a no-op. Existing single-purpose
|
|
794
|
+
endpoints (PATCH /campaigns/{id}, PUT /audience, PUT /sequence, etc.)
|
|
795
|
+
keep working unchanged.
|
|
796
|
+
|
|
797
|
+
**Input**
|
|
798
|
+
|
|
799
|
+
| Field | Type | Required | Description |
|
|
800
|
+
|---|---|---|---|
|
|
801
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
802
|
+
| `body` | `CampaignFullPatchRequest` | yes | Request body; fields below. |
|
|
803
|
+
|
|
804
|
+
Body fields (`CampaignFullPatchRequest`):
|
|
805
|
+
|
|
806
|
+
| Field | Type | Required | Description |
|
|
807
|
+
|---|---|---|---|
|
|
808
|
+
| `body.audience_list_id` | `string \| null` | no | If provided (including empty string treated as detach), updates audience_list_id. Use the dedicated PUT /audience endpoint when you only need to attach. |
|
|
809
|
+
| `body.brief` | `string \| null` | no | |
|
|
810
|
+
| `body.category` | `string \| null` | no | max length 100 |
|
|
811
|
+
| `body.core_concept` | `string \| null` | no | |
|
|
812
|
+
| `body.detach_audience` | `boolean` | no | Set true to explicitly DETACH the audience (audience_list_id=NULL). Required because JSON null in audience_list_id is ambiguous (could mean 'no change'). default `false` |
|
|
813
|
+
| `body.documents` | `Array<CampaignFullPatchDocument> \| null` | no | Per-document patches. Existing docs are updated in place (id required); new docs are created when id is omitted and file_type+display_name are present. |
|
|
814
|
+
| `body.goal` | `string \| null` | no | max length 255 |
|
|
815
|
+
| `body.linked_sequence_ids` | `Array<string> \| null` | no | Existing sequence IDs to bind to this campaign. INSERTs rows with status='linked' into cb_campaign_sequence_links. Skips IDs that are already linked (any status). Use for pre-launch wiring of an existing sequence; launch writes its own 'pushed' audit rows. |
|
|
816
|
+
| `body.name` | `string \| null` | no | max length 255 |
|
|
817
|
+
| `body.primary_hook` | `string \| null` | no | |
|
|
818
|
+
| `body.sequence_steps` | `Array<SequenceStepRef> \| null` | no | If provided, replaces the sequence step ordering (same as PUT /sequence). |
|
|
819
|
+
| `body.target_persona` | `string \| null` | no | max length 200 |
|
|
820
|
+
| `body.unlink_sequence_ids` | `Array<string> \| null` | no | Sequence IDs to UNLINK from this campaign. DELETEs ONLY rows where status='linked'. Launch-audit rows (status='pushed'/'superseded'/'failed') are never touched — those are an immutable historical record. |
|
|
821
|
+
|
|
822
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
823
|
+
|
|
824
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
825
|
+
|
|
826
|
+
**Example**
|
|
827
|
+
|
|
828
|
+
```ts
|
|
829
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
830
|
+
const result = await g8.api.gtmCampaigns.patchCampaignFull({ path: { campaign_id: "id" }, body: {} });
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
---
|
|
834
|
+
|
|
835
|
+
<a id="op-updatecampaign"></a>
|
|
836
|
+
|
|
837
|
+
### `g8.api.gtmCampaigns.updateCampaign(input)`
|
|
838
|
+
|
|
839
|
+
**Update Campaign**
|
|
840
|
+
|
|
841
|
+
- HTTP: `PATCH /api/v1/campaigns/{campaign_id}`
|
|
842
|
+
- operationId: `update_campaign_campaigns__campaign_id__patch` (also callable as `g8.api.call("update_campaign_campaigns__campaign_id__patch", input)`)
|
|
843
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
844
|
+
- API-key scope: `campaigns:run`
|
|
845
|
+
|
|
846
|
+
Update campaign content fields (name, brief, hook, persona, etc.).
|
|
847
|
+
|
|
848
|
+
**Input**
|
|
849
|
+
|
|
850
|
+
| Field | Type | Required | Description |
|
|
851
|
+
|---|---|---|---|
|
|
852
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
853
|
+
| `body` | `developer_api__interfaces__v1__gtm_campaigns_router__CampaignUpdateRequest` | yes | Request body; fields below. |
|
|
854
|
+
|
|
855
|
+
Body fields (`developer_api__interfaces__v1__gtm_campaigns_router__CampaignUpdateRequest`):
|
|
856
|
+
|
|
857
|
+
| Field | Type | Required | Description |
|
|
858
|
+
|---|---|---|---|
|
|
859
|
+
| `body.brief` | `string \| null` | no | Campaign brief |
|
|
860
|
+
| `body.category` | `string \| null` | no | Campaign category max length 100 |
|
|
861
|
+
| `body.core_concept` | `string \| null` | no | Core concept |
|
|
862
|
+
| `body.goal` | `string \| null` | no | Campaign goal max length 255 |
|
|
863
|
+
| `body.name` | `string \| null` | no | Campaign name max length 255 |
|
|
864
|
+
| `body.primary_hook` | `string \| null` | no | Primary hook text |
|
|
865
|
+
| `body.target_persona` | `string \| null` | no | Target persona max length 200 |
|
|
866
|
+
|
|
867
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
868
|
+
|
|
869
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
870
|
+
|
|
871
|
+
**Example**
|
|
872
|
+
|
|
873
|
+
```ts
|
|
874
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
875
|
+
const result = await g8.api.gtmCampaigns.updateCampaign({ path: { campaign_id: "id" }, body: {} });
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
---
|
|
879
|
+
|
|
880
|
+
<a id="op-updatecampaigndocument"></a>
|
|
881
|
+
|
|
882
|
+
### `g8.api.gtmCampaigns.updateCampaignDocument(input)`
|
|
883
|
+
|
|
884
|
+
**Update Campaign Document**
|
|
885
|
+
|
|
886
|
+
- HTTP: `PUT /api/v1/campaigns/{campaign_id}/documents/{document_id}`
|
|
887
|
+
- operationId: `update_campaign_document_campaigns__campaign_id__documents__document_id__put` (also callable as `g8.api.call("update_campaign_document_campaigns__campaign_id__documents__document_id__put", input)`)
|
|
888
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
889
|
+
- API-key scope: `campaigns:run`
|
|
890
|
+
|
|
891
|
+
Update campaign document content and optional structured data.
|
|
892
|
+
|
|
893
|
+
**Input**
|
|
894
|
+
|
|
895
|
+
| Field | Type | Required | Description |
|
|
896
|
+
|---|---|---|---|
|
|
897
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
898
|
+
| `path.document_id` | `string` | yes | Document ID |
|
|
899
|
+
| `body` | `CampaignDocumentUpdateRequest` | yes | Request body; fields below. |
|
|
900
|
+
|
|
901
|
+
Body fields (`CampaignDocumentUpdateRequest`):
|
|
902
|
+
|
|
903
|
+
| Field | Type | Required | Description |
|
|
904
|
+
|---|---|---|---|
|
|
905
|
+
| `body.content` | `string` | no | Document content default `""` |
|
|
906
|
+
| `body.status` | `string \| null` | no | Optional document status |
|
|
907
|
+
| `body.structured_data` | `Record<string, unknown> \| null` | no | Optional structured document data |
|
|
908
|
+
|
|
909
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
910
|
+
|
|
911
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
912
|
+
|
|
913
|
+
**Example**
|
|
914
|
+
|
|
915
|
+
```ts
|
|
916
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
917
|
+
const result = await g8.api.gtmCampaigns.updateCampaignDocument({ path: { campaign_id: "id", document_id: "id" }, body: {} });
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
---
|
|
921
|
+
|
|
922
|
+
<a id="op-updatecampaignsequence"></a>
|
|
923
|
+
|
|
924
|
+
### `g8.api.gtmCampaigns.updateCampaignSequence(input)`
|
|
925
|
+
|
|
926
|
+
**Update Campaign Sequence**
|
|
927
|
+
|
|
928
|
+
- HTTP: `PUT /api/v1/campaigns/{campaign_id}/sequence`
|
|
929
|
+
- operationId: `update_campaign_sequence_campaigns__campaign_id__sequence_put` (also callable as `g8.api.call("update_campaign_sequence_campaigns__campaign_id__sequence_put", input)`)
|
|
930
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
931
|
+
- API-key scope: `campaigns:run`
|
|
932
|
+
|
|
933
|
+
Replace the campaign sequence ordering.
|
|
934
|
+
|
|
935
|
+
**Input**
|
|
936
|
+
|
|
937
|
+
| Field | Type | Required | Description |
|
|
938
|
+
|---|---|---|---|
|
|
939
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
940
|
+
| `body` | `developer_api__interfaces__v1__gtm_campaigns_router__UpdateSequenceRequest` | yes | Request body; fields below. |
|
|
941
|
+
|
|
942
|
+
Body fields (`developer_api__interfaces__v1__gtm_campaigns_router__UpdateSequenceRequest`):
|
|
943
|
+
|
|
944
|
+
| Field | Type | Required | Description |
|
|
945
|
+
|---|---|---|---|
|
|
946
|
+
| `body.steps` | `Array<SequenceStepRef>` | yes | |
|
|
947
|
+
|
|
948
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
949
|
+
|
|
950
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
951
|
+
|
|
952
|
+
**Example**
|
|
953
|
+
|
|
954
|
+
```ts
|
|
955
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
956
|
+
const result = await g8.api.gtmCampaigns.updateCampaignSequence({
|
|
957
|
+
path: { campaign_id: "id" },
|
|
958
|
+
body: { steps: [{ day: 1, step_id: "id" }] },
|
|
959
|
+
});
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
---
|
|
963
|
+
|
|
964
|
+
<a id="op-updatecampaignstep"></a>
|
|
965
|
+
|
|
966
|
+
### `g8.api.gtmCampaigns.updateCampaignStep(input)`
|
|
967
|
+
|
|
968
|
+
**Update Campaign Step**
|
|
969
|
+
|
|
970
|
+
- HTTP: `PUT /api/v1/campaigns/{campaign_id}/sequence/steps/{step_id}`
|
|
971
|
+
- operationId: `update_campaign_step_campaigns__campaign_id__sequence_steps__step_id__put` (also callable as `g8.api.call("update_campaign_step_campaigns__campaign_id__sequence_steps__step_id__put", input)`)
|
|
972
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
973
|
+
- API-key scope: `campaigns:run`
|
|
974
|
+
|
|
975
|
+
Update a sequence step definition and optional placement metadata.
|
|
976
|
+
|
|
977
|
+
**Input**
|
|
978
|
+
|
|
979
|
+
| Field | Type | Required | Description |
|
|
980
|
+
|---|---|---|---|
|
|
981
|
+
| `path.campaign_id` | `string` | yes | Campaign ID |
|
|
982
|
+
| `path.step_id` | `string` | yes | Step ID |
|
|
983
|
+
| `body` | `UpdateStepRequest` | yes | Request body; fields below. |
|
|
984
|
+
|
|
985
|
+
Body fields (`UpdateStepRequest`):
|
|
986
|
+
|
|
987
|
+
| Field | Type | Required | Description |
|
|
988
|
+
|---|---|---|---|
|
|
989
|
+
| `body.angle_id` | `string \| null` | no | |
|
|
990
|
+
| `body.channel` | `string \| null` | no | |
|
|
991
|
+
| `body.condition` | `string \| null` | no | |
|
|
992
|
+
| `body.constraints` | `Record<string, unknown> \| null` | no | |
|
|
993
|
+
| `body.cta_type` | `string \| null` | no | |
|
|
994
|
+
| `body.day` | `integer \| null` | no | |
|
|
995
|
+
| `body.do_not_send_rules` | `Array<string> \| null` | no | |
|
|
996
|
+
| `body.mode` | `string \| null` | no | |
|
|
997
|
+
| `body.name` | `string \| null` | no | |
|
|
998
|
+
| `body.personalization_level` | `string \| null` | no | |
|
|
999
|
+
| `body.platform` | `string \| null` | no | |
|
|
1000
|
+
| `body.stop_on_reply` | `boolean \| null` | no | |
|
|
1001
|
+
|
|
1002
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1003
|
+
|
|
1004
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1005
|
+
|
|
1006
|
+
**Example**
|
|
1007
|
+
|
|
1008
|
+
```ts
|
|
1009
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
1010
|
+
const result = await g8.api.gtmCampaigns.updateCampaignStep({ path: { campaign_id: "id", step_id: "id" }, body: {} });
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
---
|
|
1014
|
+
|
|
1015
|
+
## Referenced types
|
|
1016
|
+
|
|
1017
|
+
Named types that appear in the tables above. Full TypeScript definitions: `G8Contract.<Name>` (`import type { G8Contract } from "@graph8/sdk"`).
|
|
1018
|
+
|
|
1019
|
+
<a id="type-campaignfullpatchdocument"></a>
|
|
1020
|
+
|
|
1021
|
+
### `CampaignFullPatchDocument`
|
|
1022
|
+
|
|
1023
|
+
A single-document patch for `PATCH /campaigns/{id}/full`.
|
|
1024
|
+
|
|
1025
|
+
| Field | Type | Required | Description |
|
|
1026
|
+
|---|---|---|---|
|
|
1027
|
+
| `content` | `string \| null` | no | Plain string content (replaces existing meta_data.content). |
|
|
1028
|
+
| `display_name` | `string \| null` | no | Display name (create only) |
|
|
1029
|
+
| `file_type` | `string \| null` | no | Required when creating; ignored on update of existing id. |
|
|
1030
|
+
| `folder_path` | `string \| null` | no | Folder path (create only) |
|
|
1031
|
+
| `id` | `string \| null` | no | Existing document id. When omitted, a new document is created. |
|
|
1032
|
+
| `status` | `string \| null` | no | Document status |
|
|
1033
|
+
| `structured_data` | `Record<string, unknown> \| null` | no | Optional structured data, merged into meta_data.structured_data. |
|
|
1034
|
+
|
|
1035
|
+
<a id="type-sequencestepref"></a>
|
|
1036
|
+
|
|
1037
|
+
### `SequenceStepRef`
|
|
1038
|
+
|
|
1039
|
+
| Field | Type | Required | Description |
|
|
1040
|
+
|---|---|---|---|
|
|
1041
|
+
| `day` | `integer` | yes | |
|
|
1042
|
+
| `step_id` | `string` | yes | |
|
|
1043
|
+
| `condition` | `string \| null` | no | |
|
|
1044
|
+
| `stop_on_reply` | `boolean` | no | default `true` |
|