@graph8/sdk 0.245.0 → 0.260.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 +19 -5
- package/dist/cli.js +216 -0
- package/dist/index.d.mts +283 -12
- package/dist/index.d.ts +283 -12
- package/dist/index.js +88 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +274 -12
- package/dist/react.d.ts +274 -12
- package/dist/react.js +106 -10
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +97 -11
- 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 +1696 -0
- package/docs/api/deals.md +2432 -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,608 @@
|
|
|
1
|
+
<!-- Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. -->
|
|
2
|
+
|
|
3
|
+
# `g8.api.revenue`: Revenue
|
|
4
|
+
|
|
5
|
+
14 operations (7 read, 3 write, 3 destructive, 1 billable).
|
|
6
|
+
|
|
7
|
+
No hand-written client covers this area. Call it through `g8.api.revenue.*` as shown below, or by operationId with `g8.api.call(operationId, input)`.
|
|
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: [revenue.d.ts](revenue.d.ts).
|
|
20
|
+
|
|
21
|
+
## Operations
|
|
22
|
+
|
|
23
|
+
| Call | HTTP | Tier | Scope | Summary |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| [`cancelStageDocBackfillJob`](#op-cancelstagedocbackfilljob) | `POST /api/v1/revenue/backfills/{job_id}/cancel` | destructive | `deals:delete` | Cancel Stage Doc Backfill Job |
|
|
26
|
+
| [`estimateAllStageDocBackfills`](#op-estimateallstagedocbackfills) | `POST /api/v1/revenue/backfills/estimate` | read | `deals:read` | Estimate All Stage Doc Backfills |
|
|
27
|
+
| [`estimateStageDocBackfill`](#op-estimatestagedocbackfill) | `POST /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}/backfill/estimate` | read | `deals:read` | Estimate Stage Doc Backfill |
|
|
28
|
+
| [`getEventCatalog`](#op-geteventcatalog) | `GET /api/v1/revenue/lifecycle/event-catalog` | read | `deals:read` | Get Event Catalog |
|
|
29
|
+
| [`getStageDocBackfillJob`](#op-getstagedocbackfilljob) | `GET /api/v1/revenue/backfills/{job_id}` | read | `deals:read` | Get Stage Doc Backfill Job |
|
|
30
|
+
| [`getStageDocCatalog`](#op-getstagedoccatalog) | `GET /api/v1/revenue/stage-docs/catalog` | read | `deals:read` | Get Stage Doc Catalog |
|
|
31
|
+
| [`getStageDocDefaults`](#op-getstagedocdefaults) | `GET /api/v1/revenue/stage-docs/defaults` | read | `deals:read` | Get Stage Doc Defaults |
|
|
32
|
+
| [`getStageDocSlot`](#op-getstagedocslot) | `GET /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}` | read | `deals:read` | Get Stage Doc Slot |
|
|
33
|
+
| [`patchStageDocSlot`](#op-patchstagedocslot) | `PATCH /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}` | write | `deals:write` | Patch Stage Doc Slot |
|
|
34
|
+
| [`resetStageDocSlot`](#op-resetstagedocslot) | `POST /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}/reset` | destructive | `deals:delete` | Reset Stage Doc Slot |
|
|
35
|
+
| [`seedLifecycleDefaults`](#op-seedlifecycledefaults) | `POST /api/v1/revenue/lifecycle/seed-defaults` | destructive | `deals:delete` | Seed Lifecycle Defaults |
|
|
36
|
+
| [`startStageDocBackfill`](#op-startstagedocbackfill) | `POST /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}/backfill` | billable | `knowledge:run` | Start Stage Doc Backfill |
|
|
37
|
+
| [`syncLifecycleLists`](#op-synclifecyclelists) | `POST /api/v1/revenue/lifecycle/sync-lists` | write | `deals:write` | Sync Lifecycle Lists |
|
|
38
|
+
| [`updateLifecycles`](#op-updatelifecycles) | `PUT /api/v1/revenue/lifecycle` | write | `deals:write` | Update Lifecycles |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
<a id="op-cancelstagedocbackfilljob"></a>
|
|
43
|
+
|
|
44
|
+
### `g8.api.revenue.cancelStageDocBackfillJob(input)`
|
|
45
|
+
|
|
46
|
+
**Cancel Stage Doc Backfill Job**
|
|
47
|
+
|
|
48
|
+
- HTTP: `POST /api/v1/revenue/backfills/{job_id}/cancel`
|
|
49
|
+
- operationId: `cancel_stage_doc_backfill_job_revenue_backfills__job_id__cancel_post` (also callable as `g8.api.call("cancel_stage_doc_backfill_job_revenue_backfills__job_id__cancel_post", input)`)
|
|
50
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
51
|
+
- API-key scope: `deals:delete`
|
|
52
|
+
|
|
53
|
+
Stop a running backfill, and stop it spending.
|
|
54
|
+
|
|
55
|
+
IDEMPOTENT: a job that already finished or failed comes back with the
|
|
56
|
+
status it has, not an error. Credits already spent are not refunded -
|
|
57
|
+
cancelling stops the next document, it does not undo the last one.
|
|
58
|
+
|
|
59
|
+
**Input**
|
|
60
|
+
|
|
61
|
+
| Field | Type | Required | Description |
|
|
62
|
+
|---|---|---|---|
|
|
63
|
+
| `path.job_id` | `string` | yes | Backfill job id (UUID). |
|
|
64
|
+
|
|
65
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
66
|
+
|
|
67
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
68
|
+
|
|
69
|
+
**Example**
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
73
|
+
const result = await g8.api.revenue.cancelStageDocBackfillJob({ path: { job_id: "id" } });
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
<a id="op-estimateallstagedocbackfills"></a>
|
|
79
|
+
|
|
80
|
+
### `g8.api.revenue.estimateAllStageDocBackfills(input?)`
|
|
81
|
+
|
|
82
|
+
**Estimate All Stage Doc Backfills**
|
|
83
|
+
|
|
84
|
+
- HTTP: `POST /api/v1/revenue/backfills/estimate`
|
|
85
|
+
- operationId: `estimate_all_stage_doc_backfills_revenue_backfills_estimate_post` (also callable as `g8.api.call("estimate_all_stage_doc_backfills_revenue_backfills_estimate_post", input)`)
|
|
86
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
87
|
+
- API-key scope: `deals:read`
|
|
88
|
+
|
|
89
|
+
What backfilling EVERY stage and both entities would cost. Spends nothing.
|
|
90
|
+
|
|
91
|
+
The totals plus a per-stage, per-entity breakdown. Published although the
|
|
92
|
+
matching "start them all" route is NOT (see the module docstring): seeing
|
|
93
|
+
the whole bill in one call is exactly what a caller needs before deciding
|
|
94
|
+
which stages to backfill, and this one cannot spend anything.
|
|
95
|
+
|
|
96
|
+
Declared BEFORE `/backfills/{job_id}` so the literal wins. The two do not
|
|
97
|
+
actually collide - one is a POST and the other a GET - but the ordering is
|
|
98
|
+
the habit, and the test checks the job route still resolves.
|
|
99
|
+
|
|
100
|
+
**Input**: none.
|
|
101
|
+
|
|
102
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
103
|
+
|
|
104
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
105
|
+
|
|
106
|
+
**Example**
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
const result = await g8.api.revenue.estimateAllStageDocBackfills();
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
<a id="op-estimatestagedocbackfill"></a>
|
|
115
|
+
|
|
116
|
+
### `g8.api.revenue.estimateStageDocBackfill(input)`
|
|
117
|
+
|
|
118
|
+
**Estimate Stage Doc Backfill**
|
|
119
|
+
|
|
120
|
+
- HTTP: `POST /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}/backfill/estimate`
|
|
121
|
+
- operationId: `estimate_stage_doc_backfill_revenue_stage_docs__lifecycle_entry_id___entity__backfill_estimate_post` (also callable as `g8.api.call("estimate_stage_doc_backfill_revenue_stage_docs__lifecycle_entry_id___entity__backfill_estimate_post", input)`)
|
|
122
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
123
|
+
- API-key scope: `deals:read`
|
|
124
|
+
|
|
125
|
+
What a backfill of this stage WOULD cost. Spends nothing.
|
|
126
|
+
|
|
127
|
+
Records affected, documents to generate, and credits. It counts and
|
|
128
|
+
returns; it queues no job and writes nothing. Call it first and use
|
|
129
|
+
`estimated_credits` as the `max_credits` you send to the backfill below.
|
|
130
|
+
|
|
131
|
+
**Input**
|
|
132
|
+
|
|
133
|
+
| Field | Type | Required | Description |
|
|
134
|
+
|---|---|---|---|
|
|
135
|
+
| `path.lifecycle_entry_id` | `string` | yes | Lifecycle stage id (UUID). |
|
|
136
|
+
| `path.entity` | `"company" \| "contact"` | yes | Which record kind the stage's documents are for. `company` and `contact` are configured independently - the same stage can generate documents for one and not the other. |
|
|
137
|
+
|
|
138
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
139
|
+
|
|
140
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
141
|
+
|
|
142
|
+
**Example**
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
const result = await g8.api.revenue.estimateStageDocBackfill({ path: { lifecycle_entry_id: "id", entity: "company" } });
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
<a id="op-geteventcatalog"></a>
|
|
151
|
+
|
|
152
|
+
### `g8.api.revenue.getEventCatalog(input?)`
|
|
153
|
+
|
|
154
|
+
**Get Event Catalog**
|
|
155
|
+
|
|
156
|
+
- HTTP: `GET /api/v1/revenue/lifecycle/event-catalog`
|
|
157
|
+
- operationId: `get_event_catalog_revenue_lifecycle_event_catalog_get` (also callable as `g8.api.call("get_event_catalog_revenue_lifecycle_event_catalog_get", input)`)
|
|
158
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
159
|
+
- API-key scope: `deals:read`
|
|
160
|
+
|
|
161
|
+
Product events seen for this org in the last 30 days, busiest first.
|
|
162
|
+
|
|
163
|
+
The source of the `event_name` values a stage's `event_tracking` config
|
|
164
|
+
accepts - configure one that has never fired and the stage tracks nothing.
|
|
165
|
+
|
|
166
|
+
A brand-new org has no events table yet; that is an empty list, not an
|
|
167
|
+
error.
|
|
168
|
+
|
|
169
|
+
**Input**: none.
|
|
170
|
+
|
|
171
|
+
**Returns** `ApiResponse_ReportListPayload_`: the envelope `{ data: ReportListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
172
|
+
|
|
173
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
174
|
+
|
|
175
|
+
`ReportListPayload` fields:
|
|
176
|
+
|
|
177
|
+
| Field | Type | Required | Description |
|
|
178
|
+
|---|---|---|---|
|
|
179
|
+
| `items` | `Array<unknown>` | no | |
|
|
180
|
+
|
|
181
|
+
**Example**
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
const result = await g8.api.revenue.getEventCatalog();
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
<a id="op-getstagedocbackfilljob"></a>
|
|
190
|
+
|
|
191
|
+
### `g8.api.revenue.getStageDocBackfillJob(input)`
|
|
192
|
+
|
|
193
|
+
**Get Stage Doc Backfill Job**
|
|
194
|
+
|
|
195
|
+
- HTTP: `GET /api/v1/revenue/backfills/{job_id}`
|
|
196
|
+
- operationId: `get_stage_doc_backfill_job_revenue_backfills__job_id__get` (also callable as `g8.api.call("get_stage_doc_backfill_job_revenue_backfills__job_id__get", input)`)
|
|
197
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
198
|
+
- API-key scope: `deals:read`
|
|
199
|
+
|
|
200
|
+
How a backfill is going: status, progress, credits USED so far, errors.
|
|
201
|
+
|
|
202
|
+
`credits_used` is the number that matters while a job runs - it is the
|
|
203
|
+
spend that has actually happened, against the `max_credits` ceiling the
|
|
204
|
+
job was started with.
|
|
205
|
+
|
|
206
|
+
**Input**
|
|
207
|
+
|
|
208
|
+
| Field | Type | Required | Description |
|
|
209
|
+
|---|---|---|---|
|
|
210
|
+
| `path.job_id` | `string` | yes | Backfill job id (UUID). |
|
|
211
|
+
|
|
212
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
213
|
+
|
|
214
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
215
|
+
|
|
216
|
+
**Example**
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
const result = await g8.api.revenue.getStageDocBackfillJob({ path: { job_id: "id" } });
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
<a id="op-getstagedoccatalog"></a>
|
|
225
|
+
|
|
226
|
+
### `g8.api.revenue.getStageDocCatalog(input?)`
|
|
227
|
+
|
|
228
|
+
**Get Stage Doc Catalog**
|
|
229
|
+
|
|
230
|
+
- HTTP: `GET /api/v1/revenue/stage-docs/catalog`
|
|
231
|
+
- operationId: `get_stage_doc_catalog_revenue_stage_docs_catalog_get` (also callable as `g8.api.call("get_stage_doc_catalog_revenue_stage_docs_catalog_get", input)`)
|
|
232
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
233
|
+
- API-key scope: `deals:read`
|
|
234
|
+
|
|
235
|
+
Every document type a stage can generate, with its tier and grounding.
|
|
236
|
+
|
|
237
|
+
The source of the `type` values `PATCH /revenue/stage-docs/{id}/{entity}`
|
|
238
|
+
accepts, and of the `tier` that decides what each one costs. Read it before
|
|
239
|
+
configuring a slot: a type is only offerable for certain stages and
|
|
240
|
+
entities, and both are listed here.
|
|
241
|
+
|
|
242
|
+
**Input**: none.
|
|
243
|
+
|
|
244
|
+
**Returns** `ApiResponse_ReportListPayload_`: the envelope `{ data: ReportListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
245
|
+
|
|
246
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
247
|
+
|
|
248
|
+
`ReportListPayload` fields:
|
|
249
|
+
|
|
250
|
+
| Field | Type | Required | Description |
|
|
251
|
+
|---|---|---|---|
|
|
252
|
+
| `items` | `Array<unknown>` | no | |
|
|
253
|
+
|
|
254
|
+
**Example**
|
|
255
|
+
|
|
256
|
+
```ts
|
|
257
|
+
const result = await g8.api.revenue.getStageDocCatalog();
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
<a id="op-getstagedocdefaults"></a>
|
|
263
|
+
|
|
264
|
+
### `g8.api.revenue.getStageDocDefaults(input?)`
|
|
265
|
+
|
|
266
|
+
**Get Stage Doc Defaults**
|
|
267
|
+
|
|
268
|
+
- HTTP: `GET /api/v1/revenue/stage-docs/defaults`
|
|
269
|
+
- operationId: `get_stage_doc_defaults_revenue_stage_docs_defaults_get` (also callable as `g8.api.call("get_stage_doc_defaults_revenue_stage_docs_defaults_get", input)`)
|
|
270
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
271
|
+
- API-key scope: `deals:read`
|
|
272
|
+
|
|
273
|
+
The whole document-defaults matrix - every stage, both entities.
|
|
274
|
+
|
|
275
|
+
**Input**: none.
|
|
276
|
+
|
|
277
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
278
|
+
|
|
279
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
280
|
+
|
|
281
|
+
**Example**
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
const result = await g8.api.revenue.getStageDocDefaults();
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
<a id="op-getstagedocslot"></a>
|
|
290
|
+
|
|
291
|
+
### `g8.api.revenue.getStageDocSlot(input)`
|
|
292
|
+
|
|
293
|
+
**Get Stage Doc Slot**
|
|
294
|
+
|
|
295
|
+
- HTTP: `GET /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}`
|
|
296
|
+
- operationId: `get_stage_doc_slot_revenue_stage_docs__lifecycle_entry_id___entity__get` (also callable as `g8.api.call("get_stage_doc_slot_revenue_stage_docs__lifecycle_entry_id___entity__get", input)`)
|
|
297
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
298
|
+
- API-key scope: `deals:read`
|
|
299
|
+
|
|
300
|
+
One stage's document configuration for one entity kind.
|
|
301
|
+
|
|
302
|
+
**Input**
|
|
303
|
+
|
|
304
|
+
| Field | Type | Required | Description |
|
|
305
|
+
|---|---|---|---|
|
|
306
|
+
| `path.lifecycle_entry_id` | `string` | yes | Lifecycle stage id (UUID). |
|
|
307
|
+
| `path.entity` | `"company" \| "contact"` | yes | Which record kind the stage's documents are for. `company` and `contact` are configured independently - the same stage can generate documents for one and not the other. |
|
|
308
|
+
|
|
309
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
310
|
+
|
|
311
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
312
|
+
|
|
313
|
+
**Example**
|
|
314
|
+
|
|
315
|
+
```ts
|
|
316
|
+
const result = await g8.api.revenue.getStageDocSlot({ path: { lifecycle_entry_id: "id", entity: "company" } });
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
<a id="op-patchstagedocslot"></a>
|
|
322
|
+
|
|
323
|
+
### `g8.api.revenue.patchStageDocSlot(input)`
|
|
324
|
+
|
|
325
|
+
**Patch Stage Doc Slot**
|
|
326
|
+
|
|
327
|
+
- HTTP: `PATCH /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}`
|
|
328
|
+
- operationId: `patch_stage_doc_slot_revenue_stage_docs__lifecycle_entry_id___entity__patch` (also callable as `g8.api.call("patch_stage_doc_slot_revenue_stage_docs__lifecycle_entry_id___entity__patch", input)`)
|
|
329
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
330
|
+
- API-key scope: `deals:write`
|
|
331
|
+
|
|
332
|
+
Change one stage's document configuration for one entity kind.
|
|
333
|
+
|
|
334
|
+
A MERGE: only the fields you send are applied. A field cannot be CLEARED
|
|
335
|
+
by sending null - the app drops nulls from the patch rather than writing
|
|
336
|
+
them - so send the value you want instead.
|
|
337
|
+
|
|
338
|
+
`auto_generate` is the switch that costs money: with it on, every record
|
|
339
|
+
that ARRIVES in this stage generates its `docs` immediately. `credit_cap`
|
|
340
|
+
bounds that ongoing spend; the types come from
|
|
341
|
+
`GET /revenue/stage-docs/catalog`.
|
|
342
|
+
|
|
343
|
+
**Input**
|
|
344
|
+
|
|
345
|
+
| Field | Type | Required | Description |
|
|
346
|
+
|---|---|---|---|
|
|
347
|
+
| `path.lifecycle_entry_id` | `string` | yes | Lifecycle stage id (UUID). |
|
|
348
|
+
| `path.entity` | `"company" \| "contact"` | yes | Which record kind the stage's documents are for. `company` and `contact` are configured independently - the same stage can generate documents for one and not the other. |
|
|
349
|
+
| `body` | `StageDocSlotPatchRequest` | yes | Request body; fields below. |
|
|
350
|
+
|
|
351
|
+
Body fields (`StageDocSlotPatchRequest`):
|
|
352
|
+
|
|
353
|
+
| Field | Type | Required | Description |
|
|
354
|
+
|---|---|---|---|
|
|
355
|
+
| `body.auto_generate` | `boolean \| null` | no | |
|
|
356
|
+
| `body.credit_cap` | `integer \| null` | no | min 0 |
|
|
357
|
+
| `body.docs` | `Array<StageDocSpecRequest> \| null` | no | |
|
|
358
|
+
| `body.on_demand` | `Array<string> \| null` | no | |
|
|
359
|
+
| `body.reuse_if_fresh_days` | `integer \| null` | no | min 0, max 365 |
|
|
360
|
+
| `body.top_n_contacts` | `integer \| null` | no | min 1, max 100 |
|
|
361
|
+
|
|
362
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
363
|
+
|
|
364
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
365
|
+
|
|
366
|
+
**Example**
|
|
367
|
+
|
|
368
|
+
```ts
|
|
369
|
+
const result = await g8.api.revenue.patchStageDocSlot({ path: { lifecycle_entry_id: "id", entity: "company" }, body: {} });
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
<a id="op-resetstagedocslot"></a>
|
|
375
|
+
|
|
376
|
+
### `g8.api.revenue.resetStageDocSlot(input)`
|
|
377
|
+
|
|
378
|
+
**Reset Stage Doc Slot**
|
|
379
|
+
|
|
380
|
+
- HTTP: `POST /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}/reset`
|
|
381
|
+
- operationId: `reset_stage_doc_slot_revenue_stage_docs__lifecycle_entry_id___entity__reset_post` (also callable as `g8.api.call("reset_stage_doc_slot_revenue_stage_docs__lifecycle_entry_id___entity__reset_post", input)`)
|
|
382
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
383
|
+
- API-key scope: `deals:delete`
|
|
384
|
+
|
|
385
|
+
Put one slot back to its seeded default. Discards the configuration.
|
|
386
|
+
|
|
387
|
+
**Input**
|
|
388
|
+
|
|
389
|
+
| Field | Type | Required | Description |
|
|
390
|
+
|---|---|---|---|
|
|
391
|
+
| `path.lifecycle_entry_id` | `string` | yes | Lifecycle stage id (UUID). |
|
|
392
|
+
| `path.entity` | `"company" \| "contact"` | yes | Which record kind the stage's documents are for. `company` and `contact` are configured independently - the same stage can generate documents for one and not the other. |
|
|
393
|
+
|
|
394
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
395
|
+
|
|
396
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
397
|
+
|
|
398
|
+
**Example**
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
402
|
+
const result = await g8.api.revenue.resetStageDocSlot({ path: { lifecycle_entry_id: "id", entity: "company" } });
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
<a id="op-seedlifecycledefaults"></a>
|
|
408
|
+
|
|
409
|
+
### `g8.api.revenue.seedLifecycleDefaults(input?)`
|
|
410
|
+
|
|
411
|
+
**Seed Lifecycle Defaults**
|
|
412
|
+
|
|
413
|
+
- HTTP: `POST /api/v1/revenue/lifecycle/seed-defaults`
|
|
414
|
+
- operationId: `seed_lifecycle_defaults_revenue_lifecycle_seed_defaults_post` (also callable as `g8.api.call("seed_lifecycle_defaults_revenue_lifecycle_seed_defaults_post", input)`)
|
|
415
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
416
|
+
- API-key scope: `deals:delete`
|
|
417
|
+
|
|
418
|
+
Force-replace the stage config with the four seeded defaults.
|
|
419
|
+
|
|
420
|
+
DESTRUCTIVE, and the app's own word for it is "force-replace": every
|
|
421
|
+
custom stage and every document default attached to it is gone. Recoverable
|
|
422
|
+
only by PUTting the old config back, so read it first if you might want it.
|
|
423
|
+
|
|
424
|
+
**Input**: none.
|
|
425
|
+
|
|
426
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
427
|
+
|
|
428
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
429
|
+
|
|
430
|
+
**Example**
|
|
431
|
+
|
|
432
|
+
```ts
|
|
433
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
434
|
+
const result = await g8.api.revenue.seedLifecycleDefaults();
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
<a id="op-startstagedocbackfill"></a>
|
|
440
|
+
|
|
441
|
+
### `g8.api.revenue.startStageDocBackfill(input)`
|
|
442
|
+
|
|
443
|
+
**Start Stage Doc Backfill**
|
|
444
|
+
|
|
445
|
+
- HTTP: `POST /api/v1/revenue/stage-docs/{lifecycle_entry_id}/{entity}/backfill`
|
|
446
|
+
- operationId: `start_stage_doc_backfill_revenue_stage_docs__lifecycle_entry_id___entity__backfill_post` (also callable as `g8.api.call("start_stage_doc_backfill_revenue_stage_docs__lifecycle_entry_id___entity__backfill_post", input)`)
|
|
447
|
+
- Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
|
|
448
|
+
- API-key scope: `knowledge:run`
|
|
449
|
+
|
|
450
|
+
Generate this stage's documents for records already in it. SPENDS CREDITS.
|
|
451
|
+
|
|
452
|
+
Queues a job and returns its id - poll `GET /revenue/backfills/{job_id}`.
|
|
453
|
+
The work is asynchronous, so a 202 here is not a completed backfill and not
|
|
454
|
+
a completed CHARGE either; the spend accrues as documents are produced.
|
|
455
|
+
|
|
456
|
+
`max_credits` is a hard ceiling the worker enforces, not advice: the job
|
|
457
|
+
stops the moment spend reaches it. `confirm` must be true - the app refuses
|
|
458
|
+
the call otherwise, deliberately, because this is the one route here that
|
|
459
|
+
costs money.
|
|
460
|
+
|
|
461
|
+
**Input**
|
|
462
|
+
|
|
463
|
+
| Field | Type | Required | Description |
|
|
464
|
+
|---|---|---|---|
|
|
465
|
+
| `path.lifecycle_entry_id` | `string` | yes | Lifecycle stage id (UUID). |
|
|
466
|
+
| `path.entity` | `"company" \| "contact"` | yes | Which record kind the stage's documents are for. `company` and `contact` are configured independently - the same stage can generate documents for one and not the other. |
|
|
467
|
+
| `body` | `StageBackfillRequest` | yes | Request body; fields below. |
|
|
468
|
+
|
|
469
|
+
Body fields (`StageBackfillRequest`):
|
|
470
|
+
|
|
471
|
+
| Field | Type | Required | Description |
|
|
472
|
+
|---|---|---|---|
|
|
473
|
+
| `body.confirm` | `boolean` | yes | Must be true. The app refuses the call with 400 otherwise - a deliberate second hand on a job that spends credits. |
|
|
474
|
+
| `body.max_credits` | `integer` | yes | Hard credit ceiling for this job. The worker stops when spend reaches it. REQUIRED - there is no default, because a default would be a number nobody chose. min 0 |
|
|
475
|
+
|
|
476
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
477
|
+
|
|
478
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
479
|
+
|
|
480
|
+
**Example**
|
|
481
|
+
|
|
482
|
+
```ts
|
|
483
|
+
// billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
|
|
484
|
+
const result = await g8.api.revenue.startStageDocBackfill({
|
|
485
|
+
path: { lifecycle_entry_id: "id", entity: "company" },
|
|
486
|
+
body: { confirm: true, max_credits: 0 },
|
|
487
|
+
});
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
<a id="op-synclifecyclelists"></a>
|
|
493
|
+
|
|
494
|
+
### `g8.api.revenue.syncLifecycleLists(input?)`
|
|
495
|
+
|
|
496
|
+
**Sync Lifecycle Lists**
|
|
497
|
+
|
|
498
|
+
- HTTP: `POST /api/v1/revenue/lifecycle/sync-lists`
|
|
499
|
+
- operationId: `sync_lifecycle_lists_revenue_lifecycle_sync_lists_post` (also callable as `g8.api.call("sync_lifecycle_lists_revenue_lifecycle_sync_lists_post", input)`)
|
|
500
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
501
|
+
- API-key scope: `deals:write`
|
|
502
|
+
|
|
503
|
+
Rebuild the saved list behind each lifecycle stage.
|
|
504
|
+
|
|
505
|
+
202 and returns immediately - the rebuild runs in the background and there
|
|
506
|
+
is no job id to poll, by the app's design. Call it after changing what a
|
|
507
|
+
stage matches; membership is recomputed from the new rules.
|
|
508
|
+
|
|
509
|
+
**Input**: none.
|
|
510
|
+
|
|
511
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
512
|
+
|
|
513
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
514
|
+
|
|
515
|
+
**Example**
|
|
516
|
+
|
|
517
|
+
```ts
|
|
518
|
+
const result = await g8.api.revenue.syncLifecycleLists();
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
<a id="op-updatelifecycles"></a>
|
|
524
|
+
|
|
525
|
+
### `g8.api.revenue.updateLifecycles(input)`
|
|
526
|
+
|
|
527
|
+
**Update Lifecycles**
|
|
528
|
+
|
|
529
|
+
- HTTP: `PUT /api/v1/revenue/lifecycle`
|
|
530
|
+
- operationId: `update_lifecycles_revenue_lifecycle_put` (also callable as `g8.api.call("update_lifecycles_revenue_lifecycle_put", input)`)
|
|
531
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
532
|
+
- API-key scope: `deals:write`
|
|
533
|
+
|
|
534
|
+
REPLACE the whole set of Revenue lifecycle stages.
|
|
535
|
+
|
|
536
|
+
Not a merge. The posted `entries` array becomes the config, so a stage left
|
|
537
|
+
out of it is DELETED along with the document defaults attached to it. Read
|
|
538
|
+
`GET /lifecycle-stages` first and send the full list back with your change
|
|
539
|
+
applied.
|
|
540
|
+
|
|
541
|
+
An entry with an empty `id` is treated as NEW and gets a fresh UUID. An
|
|
542
|
+
entry that keeps its id keeps its stage document defaults - those are
|
|
543
|
+
merged forward by id, not rebuilt.
|
|
544
|
+
|
|
545
|
+
**Input**
|
|
546
|
+
|
|
547
|
+
| Field | Type | Required | Description |
|
|
548
|
+
|---|---|---|---|
|
|
549
|
+
| `body` | `UpdateLifecyclesRequest` | yes | Request body; fields below. |
|
|
550
|
+
|
|
551
|
+
Body fields (`UpdateLifecyclesRequest`):
|
|
552
|
+
|
|
553
|
+
| Field | Type | Required | Description |
|
|
554
|
+
|---|---|---|---|
|
|
555
|
+
| `body.entries` | `Array<LifecycleEntryRequest>` | yes | |
|
|
556
|
+
|
|
557
|
+
**Returns** `ApiResponse_ReportPayload_`: the envelope `{ data: ReportPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
558
|
+
|
|
559
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
560
|
+
|
|
561
|
+
**Example**
|
|
562
|
+
|
|
563
|
+
```ts
|
|
564
|
+
const result = await g8.api.revenue.updateLifecycles({
|
|
565
|
+
body: { entries: [{ id: "id", name: "Example", slug: "example" }] },
|
|
566
|
+
});
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
---
|
|
570
|
+
|
|
571
|
+
## Referenced types
|
|
572
|
+
|
|
573
|
+
Named types that appear in the tables above. Full TypeScript definitions: `G8Contract.<Name>` (`import type { G8Contract } from "@graph8/sdk"`).
|
|
574
|
+
|
|
575
|
+
<a id="type-lifecycleentryrequest"></a>
|
|
576
|
+
|
|
577
|
+
### `LifecycleEntryRequest`
|
|
578
|
+
|
|
579
|
+
One Revenue lifecycle stage. `id` is REQUIRED and may be the empty string: the app assigns a fresh UUID to any entry that arrives without one, which is how a new stage is created. Mirrored as required-but-emptyable rather than optional so the field cannot be omitted by accident on an entry that was meant to be an UPDATE - a missing id there does not fail, it silently creates a duplicate stage and orphans the original's documents.
|
|
580
|
+
|
|
581
|
+
| Field | Type | Required | Description |
|
|
582
|
+
|---|---|---|---|
|
|
583
|
+
| `id` | `string` | yes | |
|
|
584
|
+
| `name` | `string` | yes | min length 1, max length 64 |
|
|
585
|
+
| `slug` | `string` | yes | min length 1, max length 64 |
|
|
586
|
+
| `auto_hide_if_empty` | `boolean` | no | default `true` |
|
|
587
|
+
| `churn_reason_categories` | `Array<string> \| null` | no | |
|
|
588
|
+
| `custom_status_match` | `Array<string>` | no | |
|
|
589
|
+
| `description` | `string \| null` | no | |
|
|
590
|
+
| `event_tracking` | `LifecycleEventTrackingRequest \| null` | no | |
|
|
591
|
+
| `hidden` | `boolean` | no | default `false` |
|
|
592
|
+
| `icon` | `string` | no | default `"Target"` |
|
|
593
|
+
| `is_system_seed` | `boolean` | no | default `false` |
|
|
594
|
+
| `sort_order` | `integer` | no | default `0` |
|
|
595
|
+
| `status_match` | `Array<string>` | no | |
|
|
596
|
+
| `subscription_filter` | `Array<string> \| null` | no | |
|
|
597
|
+
|
|
598
|
+
<a id="type-stagedocspecrequest"></a>
|
|
599
|
+
|
|
600
|
+
### `StageDocSpecRequest`
|
|
601
|
+
|
|
602
|
+
| Field | Type | Required | Description |
|
|
603
|
+
|---|---|---|---|
|
|
604
|
+
| `type` | `string` | yes | min length 1, max length 100 |
|
|
605
|
+
| `mandatory` | `boolean` | no | default `false` |
|
|
606
|
+
| `schedule` | `Record<string, unknown> \| null` | no | |
|
|
607
|
+
| `tier` | `string` | no | default `"sonnet"`, min length 1, max length 32 |
|
|
608
|
+
| `trigger` | `"instant" \| "scheduled"` | no | default `"instant"` |
|