@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,2436 @@
|
|
|
1
|
+
<!-- Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. -->
|
|
2
|
+
|
|
3
|
+
# `g8.api.deals`: Deals
|
|
4
|
+
|
|
5
|
+
48 operations (21 read, 17 write, 7 destructive, 3 billable).
|
|
6
|
+
|
|
7
|
+
8 of these also have a hand-written method (`g8.deals`), 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: [deals.d.ts](deals.d.ts).
|
|
20
|
+
|
|
21
|
+
## Operations
|
|
22
|
+
|
|
23
|
+
| Call | HTTP | Tier | Scope | Summary |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| [`addDealContact`](#op-adddealcontact) | `POST /api/v1/deals/{deal_id}/contacts` | write | `deals:write` | Add Deal Contact |
|
|
26
|
+
| [`archiveDealCloseReason`](#op-archivedealclosereason) | `DELETE /api/v1/deals/close-reasons/{reason_id}` | destructive | `deals:delete` | Archive Deal Close Reason |
|
|
27
|
+
| [`bulkUpdateDeals`](#op-bulkupdatedeals) | `POST /api/v1/deals/bulk` | write | `deals:write` | Bulk Update Deals |
|
|
28
|
+
| [`createAccountDeal`](#op-createaccountdeal) | `POST /api/v1/accounts/{account_id}/deals` | write | `deals:write` | Create Account Deal |
|
|
29
|
+
| [`createDeal`](#op-createdeal) ★ | `POST /api/v1/deals` | write | `deals:write` | Create Deal |
|
|
30
|
+
| [`createDealCloseReason`](#op-createdealclosereason) | `POST /api/v1/deals/close-reasons` | write | `deals:write` | Create Deal Close Reason |
|
|
31
|
+
| [`createDealColumn`](#op-createdealcolumn) | `POST /api/v1/deals/columns/create` | write | `deals:write` | Create Deal Column |
|
|
32
|
+
| [`deleteDeal`](#op-deletedeal) ★ | `DELETE /api/v1/deals/{deal_id}` | destructive | `deals:delete` | Delete Deal |
|
|
33
|
+
| [`deleteDealColumn`](#op-deletedealcolumn) | `DELETE /api/v1/deals/columns/{column_id}` | destructive | `deals:delete` | Delete Deal Column |
|
|
34
|
+
| [`deleteDealDocument`](#op-deletedealdocument) | `DELETE /api/v1/deals/{deal_id}/documents/{document_id}` | destructive | `deals:delete` | Delete Deal Document |
|
|
35
|
+
| [`deleteDealNote`](#op-deletedealnote) | `DELETE /api/v1/deals/{deal_id}/notes/{note_id}` | destructive | `deals:delete` | Delete Deal Note |
|
|
36
|
+
| [`generateAllDealDocuments`](#op-generatealldealdocuments) | `POST /api/v1/deals/{deal_id}/documents/generate-all` | billable | `deals:run` | Generate All Deal Documents |
|
|
37
|
+
| [`generateDealDocument`](#op-generatedealdocument) | `POST /api/v1/deals/{deal_id}/documents/types/{doc_type}/generate` | billable | `deals:run` | Generate Deal Document |
|
|
38
|
+
| [`getCompanyDeals`](#op-getcompanydeals) ★ | `GET /api/v1/companies/{company_id}/deals` | read | `deals:read` | Get Company Deals |
|
|
39
|
+
| [`getContactDeals`](#op-getcontactdeals) ★ | `GET /api/v1/contacts/{contact_id}/deals` | read | `deals:read` | Get Contact Deals |
|
|
40
|
+
| [`getDeal`](#op-getdeal) ★ | `GET /api/v1/deals/{deal_id}` | read | `deals:read` | Get Deal |
|
|
41
|
+
| [`getDealAnalytics`](#op-getdealanalytics) | `GET /api/v1/deals/analytics` | read | `deals:read` | Get Deal Analytics |
|
|
42
|
+
| [`getDealCrossfire`](#op-getdealcrossfire) | `GET /api/v1/deals/{deal_id}/crossfire` | read | `deals:read` | Get Deal Crossfire |
|
|
43
|
+
| [`getDealDetail`](#op-getdealdetail) | `GET /api/v1/deals/{deal_id}/detail` | read | `deals:read` | Get Deal Detail |
|
|
44
|
+
| [`getDealDocument`](#op-getdealdocument) | `GET /api/v1/deals/{deal_id}/documents/types/{doc_type}` | read | `deals:read` | Get Deal Document |
|
|
45
|
+
| [`getDealDocumentGenerationStatus`](#op-getdealdocumentgenerationstatus) | `GET /api/v1/deals/{deal_id}/documents/generation-status` | read | `deals:read` | Get Deal Document Generation Status |
|
|
46
|
+
| [`getDealSignals`](#op-getdealsignals) | `GET /api/v1/deals/{deal_id}/signals` | read | `deals:read` | Get Deal Signals |
|
|
47
|
+
| [`getDealStageVelocity`](#op-getdealstagevelocity) | `GET /api/v1/deals/stage-velocity` | read | `deals:read` | Get Deal Stage Velocity |
|
|
48
|
+
| [`listAccountDeals`](#op-listaccountdeals) | `GET /api/v1/accounts/{account_id}/deals` | read | `deals:read` | List Account Deals |
|
|
49
|
+
| [`listDealCloseReasons`](#op-listdealclosereasons) | `GET /api/v1/deals/close-reasons` | read | `deals:read` | List Deal Close Reasons |
|
|
50
|
+
| [`listDealColumns`](#op-listdealcolumns) | `GET /api/v1/deals/columns` | read | `deals:read` | List Deal Columns |
|
|
51
|
+
| [`listDealContacts`](#op-listdealcontacts) | `GET /api/v1/deals/{deal_id}/contacts` | read | `deals:read` | List Deal Contacts |
|
|
52
|
+
| [`listDealCustomFieldDiConfig`](#op-listdealcustomfielddiconfig) | `GET /api/v1/deals/custom-fields/di-config` | read | `deals:read` | List Deal Custom Field Di Config |
|
|
53
|
+
| [`listDealDocuments`](#op-listdealdocuments) | `GET /api/v1/deals/{deal_id}/documents` | read | `deals:read` | List Deal Documents |
|
|
54
|
+
| [`listDealHistory`](#op-listdealhistory) | `GET /api/v1/deals/{deal_id}/history` | read | `deals:read` | List Deal History |
|
|
55
|
+
| [`listDealLineItems`](#op-listdeallineitems) | `GET /api/v1/deals/{deal_id}/line-items` | read | `deals:read` | List Deal Line Items |
|
|
56
|
+
| [`listDeals`](#op-listdeals) ★ | `GET /api/v1/deals` | read | `deals:read` | List Deals |
|
|
57
|
+
| [`listPipelines`](#op-listpipelines) ★ | `GET /api/v1/deals/pipelines` | read | `deals:read` | List Pipelines |
|
|
58
|
+
| [`mergeDeal`](#op-mergedeal) | `POST /api/v1/deals/{deal_id}/merge` | destructive | `deals:delete` | Merge Deal |
|
|
59
|
+
| [`moveDealToPipeline`](#op-movedealtopipeline) | `PUT /api/v1/deals/{deal_id}/pipeline` | write | `deals:write` | Move Deal To Pipeline |
|
|
60
|
+
| [`previewDealMerge`](#op-previewdealmerge) | `GET /api/v1/deals/{deal_id}/merge/preview` | read | `deals:read` | Preview Deal Merge |
|
|
61
|
+
| [`regenerateDealDocument`](#op-regeneratedealdocument) | `POST /api/v1/deals/{deal_id}/documents/types/{doc_type}/regenerate` | billable | `deals:run` | Regenerate Deal Document |
|
|
62
|
+
| [`removeDealContact`](#op-removedealcontact) | `DELETE /api/v1/deals/{deal_id}/contacts/{person_id}` | destructive | `deals:delete` | Remove Deal Contact |
|
|
63
|
+
| [`replaceDealLineItems`](#op-replacedeallineitems) | `PUT /api/v1/deals/{deal_id}/line-items` | write | `deals:write` | Replace Deal Line Items |
|
|
64
|
+
| [`setDealColumnValues`](#op-setdealcolumnvalues) | `PUT /api/v1/deals/{deal_id}/columns/values` | write | `deals:write` | Set Deal Column Values |
|
|
65
|
+
| [`setDealCompany`](#op-setdealcompany) | `PUT /api/v1/deals/{deal_id}/company` | write | `deals:write` | Set Deal Company |
|
|
66
|
+
| [`setDealContactRole`](#op-setdealcontactrole) | `PUT /api/v1/deals/{deal_id}/contacts/{contact_id}` | write | `deals:write` | Set Deal Contact Role |
|
|
67
|
+
| [`setPrimaryDealContact`](#op-setprimarydealcontact) | `PUT /api/v1/deals/{deal_id}/contacts/{person_id}/primary` | write | `deals:write` | Set Primary Deal Contact |
|
|
68
|
+
| [`setRivalAttach`](#op-setrivalattach) | `POST /api/v1/deals/{deal_id}/rival-attach` | write | `deals:write` | Set Rival Attach |
|
|
69
|
+
| [`updateDeal`](#op-updatedeal) ★ | `PATCH /api/v1/deals/{deal_id}` | write | `deals:write` | Update Deal |
|
|
70
|
+
| [`updateDealDocument`](#op-updatedealdocument) | `PUT /api/v1/deals/{deal_id}/documents/{document_id}` | write | `deals:write` | Update Deal Document |
|
|
71
|
+
| [`updateDealNote`](#op-updatedealnote) | `PUT /api/v1/deals/{deal_id}/notes/{note_id}` | write | `deals:write` | Update Deal Note |
|
|
72
|
+
| [`upsertDealCustomFieldDiConfig`](#op-upsertdealcustomfielddiconfig) | `POST /api/v1/deals/custom-fields/di-config` | write | `deals:write` | Upsert Deal Custom Field Di Config |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
<a id="op-adddealcontact"></a>
|
|
77
|
+
|
|
78
|
+
### `g8.api.deals.addDealContact(input)`
|
|
79
|
+
|
|
80
|
+
**Add Deal Contact**
|
|
81
|
+
|
|
82
|
+
- HTTP: `POST /api/v1/deals/{deal_id}/contacts`
|
|
83
|
+
- operationId: `add_deal_contact_deals__deal_id__contacts_post` (also callable as `g8.api.call("add_deal_contact_deals__deal_id__contacts_post", input)`)
|
|
84
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
85
|
+
- API-key scope: `deals:write`
|
|
86
|
+
|
|
87
|
+
Link a contact to this deal.
|
|
88
|
+
|
|
89
|
+
**Input**
|
|
90
|
+
|
|
91
|
+
| Field | Type | Required | Description |
|
|
92
|
+
|---|---|---|---|
|
|
93
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
94
|
+
| `body` | `DealContactCreateRequest` | yes | Request body; fields below. |
|
|
95
|
+
|
|
96
|
+
Body fields (`DealContactCreateRequest`):
|
|
97
|
+
|
|
98
|
+
| Field | Type | Required | Description |
|
|
99
|
+
|---|---|---|---|
|
|
100
|
+
| `body.person_id` | `string` | yes | Contact to link to the deal. |
|
|
101
|
+
| `body.role` | `string \| null` | no | Role on this deal: champion, decision_maker, influencer, blocker, coach or end_user. The app does not constrain the value, so it is left open here rather than declaring an enum this surface would then have to keep in lock-step. |
|
|
102
|
+
|
|
103
|
+
**Returns** `ApiResponse_DealContact_`: the envelope `{ data: DealContact, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
104
|
+
|
|
105
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
106
|
+
|
|
107
|
+
`DealContact` fields:
|
|
108
|
+
|
|
109
|
+
| Field | Type | Required | Description |
|
|
110
|
+
|---|---|---|---|
|
|
111
|
+
| `buying_role` | `string \| null` | no | General buying role from the contact record. |
|
|
112
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
113
|
+
| `email` | `string \| null` | no | |
|
|
114
|
+
| `id` | `string \| null` | no | Link id, not the person id. |
|
|
115
|
+
| `is_primary` | `boolean \| null` | no | |
|
|
116
|
+
| `name` | `string \| null` | no | |
|
|
117
|
+
| `person_id` | `string \| null` | no | |
|
|
118
|
+
| `role` | `string \| null` | no | Role on THIS deal. |
|
|
119
|
+
| `title` | `string \| null` | no | |
|
|
120
|
+
|
|
121
|
+
**Example**
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
const result = await g8.api.deals.addDealContact({ path: { deal_id: "id" }, body: { person_id: "id" } });
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
<a id="op-archivedealclosereason"></a>
|
|
130
|
+
|
|
131
|
+
### `g8.api.deals.archiveDealCloseReason(input)`
|
|
132
|
+
|
|
133
|
+
**Archive Deal Close Reason**
|
|
134
|
+
|
|
135
|
+
- HTTP: `DELETE /api/v1/deals/close-reasons/{reason_id}`
|
|
136
|
+
- operationId: `archive_deal_close_reason_deals_close_reasons__reason_id__delete` (also callable as `g8.api.call("archive_deal_close_reason_deals_close_reasons__reason_id__delete", input)`)
|
|
137
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
138
|
+
- API-key scope: `deals:delete`
|
|
139
|
+
|
|
140
|
+
Archive a close reason.
|
|
141
|
+
|
|
142
|
+
ENTRY GATE: `_REASON_MUTATE_PERMISSIONS`, the SAME route dependency the app
|
|
143
|
+
declares. Beyond the gate the decision is CREATOR OR MANAGER, not
|
|
144
|
+
manager-only - the app's own note: manager-only removal "would make every
|
|
145
|
+
rep's typo permanent and org-wide, in a list" a rep is expected to extend
|
|
146
|
+
inline. `can_manage` (forwarded to the app handler) enforces that in-body
|
|
147
|
+
creator-or-manager check, and tells a caller in advance which rows they may
|
|
148
|
+
remove.
|
|
149
|
+
|
|
150
|
+
**Input**
|
|
151
|
+
|
|
152
|
+
| Field | Type | Required | Description |
|
|
153
|
+
|---|---|---|---|
|
|
154
|
+
| `path.reason_id` | `string` | yes | Close reason id. |
|
|
155
|
+
|
|
156
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
157
|
+
|
|
158
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
159
|
+
|
|
160
|
+
**Example**
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
164
|
+
const result = await g8.api.deals.archiveDealCloseReason({ path: { reason_id: "id" } });
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
<a id="op-bulkupdatedeals"></a>
|
|
170
|
+
|
|
171
|
+
### `g8.api.deals.bulkUpdateDeals(input)`
|
|
172
|
+
|
|
173
|
+
**Bulk Update Deals**
|
|
174
|
+
|
|
175
|
+
- HTTP: `POST /api/v1/deals/bulk`
|
|
176
|
+
- operationId: `bulk_update_deals_deals_bulk_post` (also callable as `g8.api.call("bulk_update_deals_deals_bulk_post", input)`)
|
|
177
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
178
|
+
- API-key scope: `deals:write`
|
|
179
|
+
|
|
180
|
+
Apply ONE change to up to 100 deals.
|
|
181
|
+
|
|
182
|
+
PUT semantics on every field of `change`: null leaves a value alone, an
|
|
183
|
+
EMPTY STRING clears it. Omitting a field and sending `""` are therefore
|
|
184
|
+
different instructions and the second one is destructive.
|
|
185
|
+
|
|
186
|
+
Read the per-deal result rather than the HTTP status: a deal the caller
|
|
187
|
+
cannot write is reported, not fatal.
|
|
188
|
+
|
|
189
|
+
**Input**
|
|
190
|
+
|
|
191
|
+
| Field | Type | Required | Description |
|
|
192
|
+
|---|---|---|---|
|
|
193
|
+
| `body` | `BulkDealUpdateRequest` | yes | Request body; fields below. |
|
|
194
|
+
|
|
195
|
+
Body fields (`BulkDealUpdateRequest`):
|
|
196
|
+
|
|
197
|
+
| Field | Type | Required | Description |
|
|
198
|
+
|---|---|---|---|
|
|
199
|
+
| `body.change` | `BulkDealChange` | yes | |
|
|
200
|
+
| `body.deal_ids` | `Array<string>` | yes | min items 1, max items 100 |
|
|
201
|
+
|
|
202
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
203
|
+
|
|
204
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
205
|
+
|
|
206
|
+
**Example**
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
const result = await g8.api.deals.bulkUpdateDeals({ body: { change: {}, deal_ids: ["id"] } });
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
<a id="op-createaccountdeal"></a>
|
|
215
|
+
|
|
216
|
+
### `g8.api.deals.createAccountDeal(input)`
|
|
217
|
+
|
|
218
|
+
**Create Account Deal**
|
|
219
|
+
|
|
220
|
+
- HTTP: `POST /api/v1/accounts/{account_id}/deals`
|
|
221
|
+
- operationId: `create_account_deal_accounts__account_id__deals_post` (also callable as `g8.api.call("create_account_deal_accounts__account_id__deals_post", input)`)
|
|
222
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
223
|
+
- API-key scope: `deals:write`
|
|
224
|
+
|
|
225
|
+
Create a deal already attached to an account.
|
|
226
|
+
|
|
227
|
+
`POST /deals` creates one standalone; this attaches it in the same call,
|
|
228
|
+
closing the window where a deal exists with no account.
|
|
229
|
+
|
|
230
|
+
No per-record gate, matching the app: there is no existing deal to check
|
|
231
|
+
against, and the account is validated by the handler.
|
|
232
|
+
|
|
233
|
+
**Input**
|
|
234
|
+
|
|
235
|
+
| Field | Type | Required | Description |
|
|
236
|
+
|---|---|---|---|
|
|
237
|
+
| `path.account_id` | `string` | yes | Account the deal belongs to. |
|
|
238
|
+
| `body` | `AccountDealCreateRequest` | yes | Request body; fields below. |
|
|
239
|
+
|
|
240
|
+
Body fields (`AccountDealCreateRequest`):
|
|
241
|
+
|
|
242
|
+
| Field | Type | Required | Description |
|
|
243
|
+
|---|---|---|---|
|
|
244
|
+
| `body.name` | `string` | yes | |
|
|
245
|
+
| `body.amount` | `number \| null` | no | |
|
|
246
|
+
| `body.close_date` | `string (date-time) \| null` | no | |
|
|
247
|
+
| `body.contact_ids` | `Array<string>` | no | max items 100 |
|
|
248
|
+
| `body.currency` | `string` | no | default `"USD"` |
|
|
249
|
+
| `body.description` | `string \| null` | no | |
|
|
250
|
+
| `body.owner_id` | `string \| null` | no | Who owns the deal. Omit to take the app's default - an API key is an ORGANISATION credential, so there is no 'me' to fall back to. |
|
|
251
|
+
| `body.pipeline_id` | `string \| null` | no | |
|
|
252
|
+
| `body.products` | `Array<string>` | no | |
|
|
253
|
+
| `body.stage` | `string` | no | Stage NAME, not id. default `"discovery"` |
|
|
254
|
+
| `body.stage_id` | `string \| null` | no | Stage id. Takes precedence over `stage`. |
|
|
255
|
+
|
|
256
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
257
|
+
|
|
258
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
259
|
+
|
|
260
|
+
**Example**
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
const result = await g8.api.deals.createAccountDeal({ path: { account_id: "id" }, body: { name: "Example" } });
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
<a id="op-createdeal"></a>
|
|
269
|
+
|
|
270
|
+
### `g8.api.deals.createDeal(input)`
|
|
271
|
+
|
|
272
|
+
**Create Deal**
|
|
273
|
+
|
|
274
|
+
- HTTP: `POST /api/v1/deals`
|
|
275
|
+
- operationId: `create_deal_deals_post` (also callable as `g8.api.call("create_deal_deals_post", input)`)
|
|
276
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
277
|
+
- API-key scope: `deals:write`
|
|
278
|
+
- ★ Hand-written: [`g8.deals.create()`](../sdk-clients.md#g8-deals-create)
|
|
279
|
+
|
|
280
|
+
Create a new deal. Defaults to the org's default pipeline and first stage if not specified.
|
|
281
|
+
|
|
282
|
+
``background_tasks`` carries the ``deal.created`` event only (#16242). Like
|
|
283
|
+
the PATCH endpoint's stage fan-out it is injected, not a body field, so it
|
|
284
|
+
does not appear in the OpenAPI schema and the request contract is unchanged.
|
|
285
|
+
Queuing it there rather than publishing inline keeps the Redis round trip
|
|
286
|
+
off the caller's latency budget and makes "strictly after the commit"
|
|
287
|
+
structural: the task is queued only once the session context has exited,
|
|
288
|
+
and FastAPI attaches background tasks to the SUCCESS response, so a raise
|
|
289
|
+
anywhere above publishes nothing.
|
|
290
|
+
|
|
291
|
+
**Input**
|
|
292
|
+
|
|
293
|
+
| Field | Type | Required | Description |
|
|
294
|
+
|---|---|---|---|
|
|
295
|
+
| `body` | `DealCreateRequest` | yes | Request body; fields below. |
|
|
296
|
+
|
|
297
|
+
Body fields (`DealCreateRequest`):
|
|
298
|
+
|
|
299
|
+
| Field | Type | Required | Description |
|
|
300
|
+
|---|---|---|---|
|
|
301
|
+
| `body.contact_ids` | `Array<integer>` | yes | mashup_contact_ids to associate with the deal (>=1 required; all must share one company) min items 1 |
|
|
302
|
+
| `body.name` | `string` | yes | Deal name |
|
|
303
|
+
| `body.owner_id` | `string` | yes | Deal owner (user id or email). Required. |
|
|
304
|
+
| `body.allow_duplicate` | `boolean` | no | Set true to create a deal even if one already exists for the company default `false` |
|
|
305
|
+
| `body.amount` | `number \| null` | no | Deal monetary value |
|
|
306
|
+
| `body.close_date` | `string \| null` | no | Expected close date (ISO 8601) |
|
|
307
|
+
| `body.company_id` | `integer \| null` | no | Deprecated: the company is derived from the contacts. If sent, it must match; otherwise omit it. |
|
|
308
|
+
| `body.currency` | `string \| null` | no | Currency code (default: USD) default `"USD"` |
|
|
309
|
+
| `body.description` | `string \| null` | no | Deal description |
|
|
310
|
+
| `body.pipeline_id` | `string \| null` | no | Pipeline ID (defaults to org default) |
|
|
311
|
+
| `body.stage_id` | `string \| null` | no | Stage ID (from /deals/pipelines) |
|
|
312
|
+
|
|
313
|
+
**Returns** `ApiResponse_DealResponse_`: the envelope `{ data: DealResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
314
|
+
|
|
315
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
316
|
+
|
|
317
|
+
`DealResponse` fields:
|
|
318
|
+
|
|
319
|
+
| Field | Type | Required | Description |
|
|
320
|
+
|---|---|---|---|
|
|
321
|
+
| `amount` | `number \| null` | no | |
|
|
322
|
+
| `close_date` | `string \| null` | no | |
|
|
323
|
+
| `closed_lost_reason` | `string \| null` | no | |
|
|
324
|
+
| `company_id` | `unknown \| null` | no | |
|
|
325
|
+
| `contact_count` | `integer` | no | default `0` |
|
|
326
|
+
| `contacts` | `Array<ContactBrief> \| null` | no | |
|
|
327
|
+
| `created_at` | `string \| null` | no | |
|
|
328
|
+
| `currency` | `string \| null` | no | |
|
|
329
|
+
| `description` | `string \| null` | no | |
|
|
330
|
+
| `id` | `string \| null` | no | |
|
|
331
|
+
| `last_activity_at` | `string \| null` | no | |
|
|
332
|
+
| `name` | `string \| null` | no | |
|
|
333
|
+
| `owner_email` | `string \| null` | no | |
|
|
334
|
+
| `owner_id` | `string \| null` | no | |
|
|
335
|
+
| `owner_name` | `string \| null` | no | |
|
|
336
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
337
|
+
| `pipeline_name` | `string \| null` | no | |
|
|
338
|
+
| `primary_contact` | `ContactBrief \| null` | no | |
|
|
339
|
+
| `revision` | `integer \| null` | no | CRM revision after a conditional update |
|
|
340
|
+
| `stage_id` | `string \| null` | no | |
|
|
341
|
+
| `stage_name` | `string \| null` | no | |
|
|
342
|
+
| `updated_at` | `string \| null` | no | |
|
|
343
|
+
|
|
344
|
+
**Example**
|
|
345
|
+
|
|
346
|
+
```ts
|
|
347
|
+
const result = await g8.api.deals.createDeal({ body: { contact_ids: [123], name: "Example", owner_id: "id" } });
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
<a id="op-createdealclosereason"></a>
|
|
353
|
+
|
|
354
|
+
### `g8.api.deals.createDealCloseReason(input)`
|
|
355
|
+
|
|
356
|
+
**Create Deal Close Reason**
|
|
357
|
+
|
|
358
|
+
- HTTP: `POST /api/v1/deals/close-reasons`
|
|
359
|
+
- operationId: `create_deal_close_reason_deals_close_reasons_post` (also callable as `g8.api.call("create_deal_close_reason_deals_close_reasons_post", input)`)
|
|
360
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
361
|
+
- API-key scope: `deals:write`
|
|
362
|
+
|
|
363
|
+
Add a close reason.
|
|
364
|
+
|
|
365
|
+
ENTRY GATE: `_REASON_MUTATE_PERMISSIONS`, the SAME route dependency the app
|
|
366
|
+
declares - wider than the manager tier (a rep may extend the list inline
|
|
367
|
+
while closing their own deal) but NOT open to org members with no deal
|
|
368
|
+
access. `can_manage` is still resolved for the handler; `may_seed` is now
|
|
369
|
+
enforced by the route gate rather than discarded.
|
|
370
|
+
|
|
371
|
+
**Input**
|
|
372
|
+
|
|
373
|
+
| Field | Type | Required | Description |
|
|
374
|
+
|---|---|---|---|
|
|
375
|
+
| `body` | `CloseReasonCreateRequest` | yes | Request body; fields below. |
|
|
376
|
+
|
|
377
|
+
Body fields (`CloseReasonCreateRequest`):
|
|
378
|
+
|
|
379
|
+
| Field | Type | Required | Description |
|
|
380
|
+
|---|---|---|---|
|
|
381
|
+
| `body.kind` | `string` | yes | Which list this reason belongs to, e.g. won or lost. |
|
|
382
|
+
| `body.label` | `string` | yes | min length 1, max length 255 |
|
|
383
|
+
|
|
384
|
+
**Returns** `ApiResponse_DealOpResponse_`: the envelope `{ data: DealOpResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
385
|
+
|
|
386
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
387
|
+
|
|
388
|
+
**Example**
|
|
389
|
+
|
|
390
|
+
```ts
|
|
391
|
+
const result = await g8.api.deals.createDealCloseReason({ body: { kind: "example", label: "example" } });
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
<a id="op-createdealcolumn"></a>
|
|
397
|
+
|
|
398
|
+
### `g8.api.deals.createDealColumn(input)`
|
|
399
|
+
|
|
400
|
+
**Create Deal Column**
|
|
401
|
+
|
|
402
|
+
- HTTP: `POST /api/v1/deals/columns/create`
|
|
403
|
+
- operationId: `create_deal_column_deals_columns_create_post` (also callable as `g8.api.call("create_deal_column_deals_columns_create_post", input)`)
|
|
404
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
405
|
+
- API-key scope: `deals:write`
|
|
406
|
+
|
|
407
|
+
Add a custom column.
|
|
408
|
+
|
|
409
|
+
`list_id` null creates a GLOBAL column, visible on every deals grid in the
|
|
410
|
+
org. That is the wider blast radius of the two, so it is what you get by
|
|
411
|
+
omission only because it is the app's own default.
|
|
412
|
+
|
|
413
|
+
The path is `/columns/create` rather than a POST to `/columns`, matching
|
|
414
|
+
the app exactly - a different spelling here would be a second way to say
|
|
415
|
+
the same thing.
|
|
416
|
+
|
|
417
|
+
**Input**
|
|
418
|
+
|
|
419
|
+
| Field | Type | Required | Description |
|
|
420
|
+
|---|---|---|---|
|
|
421
|
+
| `body` | `CreateDealColumnRequest` | yes | Request body; fields below. |
|
|
422
|
+
|
|
423
|
+
Body fields (`CreateDealColumnRequest`):
|
|
424
|
+
|
|
425
|
+
| Field | Type | Required | Description |
|
|
426
|
+
|---|---|---|---|
|
|
427
|
+
| `body.title` | `string` | yes | Display name. min length 1, max length 100 |
|
|
428
|
+
| `body.data_type` | `"text" \| "int" \| "numeric" \| "number" \| "boolean" \| "date"` | no | Closed to what the app accepts. It validates this inside the handler, so a free string would raise there and escape as a 500 instead of a 422 naming the valid types. default `"text"` |
|
|
429
|
+
| `body.list_id` | `integer \| null` | no | Scope the column to one list. Null creates a GLOBAL column. |
|
|
430
|
+
|
|
431
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
432
|
+
|
|
433
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
434
|
+
|
|
435
|
+
**Example**
|
|
436
|
+
|
|
437
|
+
```ts
|
|
438
|
+
const result = await g8.api.deals.createDealColumn({ body: { title: "Example" } });
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
<a id="op-deletedeal"></a>
|
|
444
|
+
|
|
445
|
+
### `g8.api.deals.deleteDeal(input)`
|
|
446
|
+
|
|
447
|
+
**Delete Deal**
|
|
448
|
+
|
|
449
|
+
- HTTP: `DELETE /api/v1/deals/{deal_id}`
|
|
450
|
+
- operationId: `delete_deal_deals__deal_id__delete` (also callable as `g8.api.call("delete_deal_deals__deal_id__delete", input)`)
|
|
451
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
452
|
+
- API-key scope: `deals:delete`
|
|
453
|
+
- ★ Hand-written: [`g8.deals.delete()`](../sdk-clients.md#g8-deals-delete)
|
|
454
|
+
|
|
455
|
+
Delete a deal.
|
|
456
|
+
|
|
457
|
+
THE TOMBSTONE RULE (#16242): ``deal.deleted`` has to be self-contained,
|
|
458
|
+
because by the time a consumer reads it the row is gone and ``deal_id``
|
|
459
|
+
resolves to nothing. The payload therefore comes from ``RETURNING`` on the
|
|
460
|
+
DELETE itself — one round trip, and no window in which a concurrent write
|
|
461
|
+
could change what a preceding SELECT had read. ``background_tasks`` is
|
|
462
|
+
injected (not a body field, so the OpenAPI schema is unchanged) for the
|
|
463
|
+
same reason as on PATCH.
|
|
464
|
+
|
|
465
|
+
**Input**
|
|
466
|
+
|
|
467
|
+
| Field | Type | Required | Description |
|
|
468
|
+
|---|---|---|---|
|
|
469
|
+
| `path.deal_id` | `string` | yes | Deal ID (UUID) |
|
|
470
|
+
|
|
471
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
472
|
+
|
|
473
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
474
|
+
|
|
475
|
+
**Example**
|
|
476
|
+
|
|
477
|
+
```ts
|
|
478
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
479
|
+
const result = await g8.api.deals.deleteDeal({ path: { deal_id: "id" } });
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
<a id="op-deletedealcolumn"></a>
|
|
485
|
+
|
|
486
|
+
### `g8.api.deals.deleteDealColumn(input)`
|
|
487
|
+
|
|
488
|
+
**Delete Deal Column**
|
|
489
|
+
|
|
490
|
+
- HTTP: `DELETE /api/v1/deals/columns/{column_id}`
|
|
491
|
+
- operationId: `delete_deal_column_deals_columns__column_id__delete` (also callable as `g8.api.call("delete_deal_column_deals_columns__column_id__delete", input)`)
|
|
492
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
493
|
+
- API-key scope: `deals:delete`
|
|
494
|
+
|
|
495
|
+
Remove a custom column, and the values every deal held in it.
|
|
496
|
+
|
|
497
|
+
**Input**
|
|
498
|
+
|
|
499
|
+
| Field | Type | Required | Description |
|
|
500
|
+
|---|---|---|---|
|
|
501
|
+
| `path.column_id` | `integer` | yes | Column id. |
|
|
502
|
+
|
|
503
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
504
|
+
|
|
505
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
506
|
+
|
|
507
|
+
**Example**
|
|
508
|
+
|
|
509
|
+
```ts
|
|
510
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
511
|
+
const result = await g8.api.deals.deleteDealColumn({ path: { column_id: 123 } });
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
<a id="op-deletedealdocument"></a>
|
|
517
|
+
|
|
518
|
+
### `g8.api.deals.deleteDealDocument(input)`
|
|
519
|
+
|
|
520
|
+
**Delete Deal Document**
|
|
521
|
+
|
|
522
|
+
- HTTP: `DELETE /api/v1/deals/{deal_id}/documents/{document_id}`
|
|
523
|
+
- operationId: `delete_deal_document_deals__deal_id__documents__document_id__delete` (also callable as `g8.api.call("delete_deal_document_deals__deal_id__documents__document_id__delete", input)`)
|
|
524
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
525
|
+
- API-key scope: `deals:delete`
|
|
526
|
+
|
|
527
|
+
Remove a generated document.
|
|
528
|
+
|
|
529
|
+
Not destructive in the way a deleted record is: the document can be
|
|
530
|
+
generated again from the same sources - at the cost of the credits that
|
|
531
|
+
takes.
|
|
532
|
+
|
|
533
|
+
**Input**
|
|
534
|
+
|
|
535
|
+
| Field | Type | Required | Description |
|
|
536
|
+
|---|---|---|---|
|
|
537
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
538
|
+
| `path.document_id` | `string` | yes | Document id, from the list read. |
|
|
539
|
+
|
|
540
|
+
**Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
541
|
+
|
|
542
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
543
|
+
|
|
544
|
+
**Example**
|
|
545
|
+
|
|
546
|
+
```ts
|
|
547
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
548
|
+
const result = await g8.api.deals.deleteDealDocument({ path: { deal_id: "id", document_id: "id" } });
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
<a id="op-deletedealnote"></a>
|
|
554
|
+
|
|
555
|
+
### `g8.api.deals.deleteDealNote(input)`
|
|
556
|
+
|
|
557
|
+
**Delete Deal Note**
|
|
558
|
+
|
|
559
|
+
- HTTP: `DELETE /api/v1/deals/{deal_id}/notes/{note_id}`
|
|
560
|
+
- operationId: `delete_deal_note_deals__deal_id__notes__note_id__delete` (also callable as `g8.api.call("delete_deal_note_deals__deal_id__notes__note_id__delete", input)`)
|
|
561
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
562
|
+
- API-key scope: `deals:delete`
|
|
563
|
+
|
|
564
|
+
Delete a note. The deal and its other notes are untouched.
|
|
565
|
+
|
|
566
|
+
**Input**
|
|
567
|
+
|
|
568
|
+
| Field | Type | Required | Description |
|
|
569
|
+
|---|---|---|---|
|
|
570
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
571
|
+
| `path.note_id` | `string` | yes | Note id. |
|
|
572
|
+
|
|
573
|
+
**Returns** `ApiResponse_DealOpResponse_`: the envelope `{ data: DealOpResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
574
|
+
|
|
575
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
576
|
+
|
|
577
|
+
**Example**
|
|
578
|
+
|
|
579
|
+
```ts
|
|
580
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
581
|
+
const result = await g8.api.deals.deleteDealNote({ path: { deal_id: "id", note_id: "id" } });
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
---
|
|
585
|
+
|
|
586
|
+
<a id="op-generatealldealdocuments"></a>
|
|
587
|
+
|
|
588
|
+
### `g8.api.deals.generateAllDealDocuments(input)`
|
|
589
|
+
|
|
590
|
+
**Generate All Deal Documents**
|
|
591
|
+
|
|
592
|
+
- HTTP: `POST /api/v1/deals/{deal_id}/documents/generate-all`
|
|
593
|
+
- operationId: `generate_all_deal_documents_deals__deal_id__documents_generate_all_post` (also callable as `g8.api.call("generate_all_deal_documents_deals__deal_id__documents_generate_all_post", input)`)
|
|
594
|
+
- Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
|
|
595
|
+
- API-key scope: `deals:run`
|
|
596
|
+
|
|
597
|
+
Generate all six documents for this deal. SPENDS CREDITS.
|
|
598
|
+
|
|
599
|
+
ASYNCHRONOUS: the work is queued and this returns straight away. Poll
|
|
600
|
+
`/documents/generation-status`.
|
|
601
|
+
|
|
602
|
+
The app REFUSES this when the deal's company has no completed synthesis
|
|
603
|
+
documents of its own - the deal documents are written from them, so
|
|
604
|
+
without them there is nothing to write from. Generate the company
|
|
605
|
+
documents first.
|
|
606
|
+
|
|
607
|
+
**Input**
|
|
608
|
+
|
|
609
|
+
| Field | Type | Required | Description |
|
|
610
|
+
|---|---|---|---|
|
|
611
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
612
|
+
|
|
613
|
+
**Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
614
|
+
|
|
615
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
616
|
+
|
|
617
|
+
**Example**
|
|
618
|
+
|
|
619
|
+
```ts
|
|
620
|
+
// billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
|
|
621
|
+
const result = await g8.api.deals.generateAllDealDocuments({ path: { deal_id: "id" } });
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
---
|
|
625
|
+
|
|
626
|
+
<a id="op-generatedealdocument"></a>
|
|
627
|
+
|
|
628
|
+
### `g8.api.deals.generateDealDocument(input)`
|
|
629
|
+
|
|
630
|
+
**Generate Deal Document**
|
|
631
|
+
|
|
632
|
+
- HTTP: `POST /api/v1/deals/{deal_id}/documents/types/{doc_type}/generate`
|
|
633
|
+
- operationId: `generate_deal_document_deals__deal_id__documents_types__doc_type__generate_post` (also callable as `g8.api.call("generate_deal_document_deals__deal_id__documents_types__doc_type__generate_post", input)`)
|
|
634
|
+
- Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
|
|
635
|
+
- API-key scope: `deals:run`
|
|
636
|
+
|
|
637
|
+
Generate ONE document. SPENDS CREDITS.
|
|
638
|
+
|
|
639
|
+
IDEMPOTENT ONLY IN THE SENSE THAT IT WILL NOT DUPLICATE: if the document
|
|
640
|
+
already exists this OVERWRITES it, and the response says so with
|
|
641
|
+
`is_regeneration`. It does not skip, so a retried call is a second spend.
|
|
642
|
+
|
|
643
|
+
Queued, not synchronous - poll `/documents/generation-status`.
|
|
644
|
+
|
|
645
|
+
**Input**
|
|
646
|
+
|
|
647
|
+
| Field | Type | Required | Description |
|
|
648
|
+
|---|---|---|---|
|
|
649
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
650
|
+
| `path.doc_type` | `"deal_risks" \| "next_steps" \| "close_plan" \| "scope_of_work" \| "roi_analysis" \| "competitive_analysis"` | yes | Which generated document. One of the six the deal synthesis produces; anything else is a 422 naming them. |
|
|
651
|
+
|
|
652
|
+
**Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
653
|
+
|
|
654
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
655
|
+
|
|
656
|
+
**Example**
|
|
657
|
+
|
|
658
|
+
```ts
|
|
659
|
+
// billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
|
|
660
|
+
const result = await g8.api.deals.generateDealDocument({ path: { deal_id: "id", doc_type: "deal_risks" } });
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
---
|
|
664
|
+
|
|
665
|
+
<a id="op-getcompanydeals"></a>
|
|
666
|
+
|
|
667
|
+
### `g8.api.deals.getCompanyDeals(input)`
|
|
668
|
+
|
|
669
|
+
**Get Company Deals**
|
|
670
|
+
|
|
671
|
+
- HTTP: `GET /api/v1/companies/{company_id}/deals`
|
|
672
|
+
- operationId: `get_company_deals_companies__company_id__deals_get` (also callable as `g8.api.call("get_company_deals_companies__company_id__deals_get", input)`)
|
|
673
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
674
|
+
- API-key scope: `deals:read`
|
|
675
|
+
- ★ Hand-written: [`g8.deals.forCompany()`](../sdk-clients.md#g8-deals-forcompany)
|
|
676
|
+
|
|
677
|
+
Get all deals associated with a company.
|
|
678
|
+
|
|
679
|
+
**Input**
|
|
680
|
+
|
|
681
|
+
| Field | Type | Required | Description |
|
|
682
|
+
|---|---|---|---|
|
|
683
|
+
| `path.company_id` | `integer` | yes | Company ID |
|
|
684
|
+
|
|
685
|
+
**Returns** `ApiResponse_list_ContactDealResponse__`: the envelope `{ data: Array<ContactDealResponse>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
686
|
+
|
|
687
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
688
|
+
|
|
689
|
+
`ContactDealResponse` fields:
|
|
690
|
+
|
|
691
|
+
| Field | Type | Required | Description |
|
|
692
|
+
|---|---|---|---|
|
|
693
|
+
| `close_date` | `string \| null` | no | |
|
|
694
|
+
| `created_at` | `string \| null` | no | |
|
|
695
|
+
| `currency` | `string \| null` | no | |
|
|
696
|
+
| `deal_id` | `string \| null` | no | |
|
|
697
|
+
| `name` | `string \| null` | no | |
|
|
698
|
+
| `owner_id` | `string \| null` | no | |
|
|
699
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
700
|
+
| `role` | `string \| null` | no | |
|
|
701
|
+
| `stage` | `string \| null` | no | |
|
|
702
|
+
| `value` | `number \| null` | no | |
|
|
703
|
+
|
|
704
|
+
**Example**
|
|
705
|
+
|
|
706
|
+
```ts
|
|
707
|
+
const result = await g8.api.deals.getCompanyDeals({ path: { company_id: 123 } });
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
712
|
+
<a id="op-getcontactdeals"></a>
|
|
713
|
+
|
|
714
|
+
### `g8.api.deals.getContactDeals(input)`
|
|
715
|
+
|
|
716
|
+
**Get Contact Deals**
|
|
717
|
+
|
|
718
|
+
- HTTP: `GET /api/v1/contacts/{contact_id}/deals`
|
|
719
|
+
- operationId: `get_contact_deals_contacts__contact_id__deals_get` (also callable as `g8.api.call("get_contact_deals_contacts__contact_id__deals_get", input)`)
|
|
720
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
721
|
+
- API-key scope: `deals:read`
|
|
722
|
+
- ★ Hand-written: [`g8.deals.forContact()`](../sdk-clients.md#g8-deals-forcontact)
|
|
723
|
+
|
|
724
|
+
Get all deals associated with a contact.
|
|
725
|
+
|
|
726
|
+
**Input**
|
|
727
|
+
|
|
728
|
+
| Field | Type | Required | Description |
|
|
729
|
+
|---|---|---|---|
|
|
730
|
+
| `path.contact_id` | `integer` | yes | Contact ID |
|
|
731
|
+
|
|
732
|
+
**Returns** `ApiResponse_list_ContactDealResponse__`: the envelope `{ data: Array<ContactDealResponse>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
733
|
+
|
|
734
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
735
|
+
|
|
736
|
+
`ContactDealResponse` fields:
|
|
737
|
+
|
|
738
|
+
| Field | Type | Required | Description |
|
|
739
|
+
|---|---|---|---|
|
|
740
|
+
| `close_date` | `string \| null` | no | |
|
|
741
|
+
| `created_at` | `string \| null` | no | |
|
|
742
|
+
| `currency` | `string \| null` | no | |
|
|
743
|
+
| `deal_id` | `string \| null` | no | |
|
|
744
|
+
| `name` | `string \| null` | no | |
|
|
745
|
+
| `owner_id` | `string \| null` | no | |
|
|
746
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
747
|
+
| `role` | `string \| null` | no | |
|
|
748
|
+
| `stage` | `string \| null` | no | |
|
|
749
|
+
| `value` | `number \| null` | no | |
|
|
750
|
+
|
|
751
|
+
**Example**
|
|
752
|
+
|
|
753
|
+
```ts
|
|
754
|
+
const result = await g8.api.deals.getContactDeals({ path: { contact_id: 123 } });
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
---
|
|
758
|
+
|
|
759
|
+
<a id="op-getdeal"></a>
|
|
760
|
+
|
|
761
|
+
### `g8.api.deals.getDeal(input)`
|
|
762
|
+
|
|
763
|
+
**Get Deal**
|
|
764
|
+
|
|
765
|
+
- HTTP: `GET /api/v1/deals/{deal_id}`
|
|
766
|
+
- operationId: `get_deal_deals__deal_id__get` (also callable as `g8.api.call("get_deal_deals__deal_id__get", input)`)
|
|
767
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
768
|
+
- API-key scope: `deals:read`
|
|
769
|
+
- ★ Hand-written: [`g8.deals.get()`](../sdk-clients.md#g8-deals-get)
|
|
770
|
+
|
|
771
|
+
Get a single deal by ID.
|
|
772
|
+
|
|
773
|
+
**Input**
|
|
774
|
+
|
|
775
|
+
| Field | Type | Required | Description |
|
|
776
|
+
|---|---|---|---|
|
|
777
|
+
| `path.deal_id` | `string` | yes | Deal ID (UUID) |
|
|
778
|
+
|
|
779
|
+
**Returns** `ApiResponse_DealResponse_`: the envelope `{ data: DealResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
780
|
+
|
|
781
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
782
|
+
|
|
783
|
+
`DealResponse` fields:
|
|
784
|
+
|
|
785
|
+
| Field | Type | Required | Description |
|
|
786
|
+
|---|---|---|---|
|
|
787
|
+
| `amount` | `number \| null` | no | |
|
|
788
|
+
| `close_date` | `string \| null` | no | |
|
|
789
|
+
| `closed_lost_reason` | `string \| null` | no | |
|
|
790
|
+
| `company_id` | `unknown \| null` | no | |
|
|
791
|
+
| `contact_count` | `integer` | no | default `0` |
|
|
792
|
+
| `contacts` | `Array<ContactBrief> \| null` | no | |
|
|
793
|
+
| `created_at` | `string \| null` | no | |
|
|
794
|
+
| `currency` | `string \| null` | no | |
|
|
795
|
+
| `description` | `string \| null` | no | |
|
|
796
|
+
| `id` | `string \| null` | no | |
|
|
797
|
+
| `last_activity_at` | `string \| null` | no | |
|
|
798
|
+
| `name` | `string \| null` | no | |
|
|
799
|
+
| `owner_email` | `string \| null` | no | |
|
|
800
|
+
| `owner_id` | `string \| null` | no | |
|
|
801
|
+
| `owner_name` | `string \| null` | no | |
|
|
802
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
803
|
+
| `pipeline_name` | `string \| null` | no | |
|
|
804
|
+
| `primary_contact` | `ContactBrief \| null` | no | |
|
|
805
|
+
| `revision` | `integer \| null` | no | CRM revision after a conditional update |
|
|
806
|
+
| `stage_id` | `string \| null` | no | |
|
|
807
|
+
| `stage_name` | `string \| null` | no | |
|
|
808
|
+
| `updated_at` | `string \| null` | no | |
|
|
809
|
+
|
|
810
|
+
**Example**
|
|
811
|
+
|
|
812
|
+
```ts
|
|
813
|
+
const result = await g8.api.deals.getDeal({ path: { deal_id: "id" } });
|
|
814
|
+
```
|
|
815
|
+
|
|
816
|
+
---
|
|
817
|
+
|
|
818
|
+
<a id="op-getdealanalytics"></a>
|
|
819
|
+
|
|
820
|
+
### `g8.api.deals.getDealAnalytics(input?)`
|
|
821
|
+
|
|
822
|
+
**Get Deal Analytics**
|
|
823
|
+
|
|
824
|
+
- HTTP: `GET /api/v1/deals/analytics`
|
|
825
|
+
- operationId: `get_deal_analytics_deals_analytics_get` (also callable as `g8.api.call("get_deal_analytics_deals_analytics_get", input)`)
|
|
826
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
827
|
+
- API-key scope: `deals:read`
|
|
828
|
+
|
|
829
|
+
Pipeline totals, stage breakdown, win rate and velocity over the deals the key can see.
|
|
830
|
+
|
|
831
|
+
**Input**
|
|
832
|
+
|
|
833
|
+
| Field | Type | Required | Description |
|
|
834
|
+
|---|---|---|---|
|
|
835
|
+
| `query.pipeline_id` | `string \| null` | no | Only this pipeline. |
|
|
836
|
+
| `query.owner_ids` | `Array<string> \| null` | no | Only these owners. Repeatable. |
|
|
837
|
+
| `query.stage_ids` | `Array<string> \| null` | no | Only these stages. Repeatable. |
|
|
838
|
+
| `query.close_date_from` | `string \| null` | no | Close date lower bound, YYYY-MM-DD. |
|
|
839
|
+
| `query.close_date_to` | `string \| null` | no | Close date upper bound, YYYY-MM-DD. |
|
|
840
|
+
| `query.search` | `string \| null` | no | Match on deal or account name. |
|
|
841
|
+
| `query.segmentFilter` | `string \| null` | no | Advanced filter tree as JSON, the same one `GET /deals` accepts. 400 if unparseable. |
|
|
842
|
+
|
|
843
|
+
**Returns** `ApiResponse_CrmRecordPayload_`: the envelope `{ data: CrmRecordPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
844
|
+
|
|
845
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
846
|
+
|
|
847
|
+
**Example**
|
|
848
|
+
|
|
849
|
+
```ts
|
|
850
|
+
const result = await g8.api.deals.getDealAnalytics();
|
|
851
|
+
```
|
|
852
|
+
|
|
853
|
+
---
|
|
854
|
+
|
|
855
|
+
<a id="op-getdealcrossfire"></a>
|
|
856
|
+
|
|
857
|
+
### `g8.api.deals.getDealCrossfire(input)`
|
|
858
|
+
|
|
859
|
+
**Get Deal Crossfire**
|
|
860
|
+
|
|
861
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/crossfire`
|
|
862
|
+
- operationId: `get_deal_crossfire_deals__deal_id__crossfire_get` (also callable as `g8.api.call("get_deal_crossfire_deals__deal_id__crossfire_get", input)`)
|
|
863
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
864
|
+
- API-key scope: `deals:read`
|
|
865
|
+
|
|
866
|
+
Competitive pressure on this deal.
|
|
867
|
+
|
|
868
|
+
Open-shaped: this is an ADVISORY read whose contents grow with the
|
|
869
|
+
product, and a dropped field reads as "nothing to worry about" rather than
|
|
870
|
+
"we did not tell you".
|
|
871
|
+
|
|
872
|
+
**Input**
|
|
873
|
+
|
|
874
|
+
| Field | Type | Required | Description |
|
|
875
|
+
|---|---|---|---|
|
|
876
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
877
|
+
|
|
878
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
879
|
+
|
|
880
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
881
|
+
|
|
882
|
+
**Example**
|
|
883
|
+
|
|
884
|
+
```ts
|
|
885
|
+
const result = await g8.api.deals.getDealCrossfire({ path: { deal_id: "id" } });
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
---
|
|
889
|
+
|
|
890
|
+
<a id="op-getdealdetail"></a>
|
|
891
|
+
|
|
892
|
+
### `g8.api.deals.getDealDetail(input)`
|
|
893
|
+
|
|
894
|
+
**Get Deal Detail**
|
|
895
|
+
|
|
896
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/detail`
|
|
897
|
+
- operationId: `get_deal_detail_deals__deal_id__detail_get` (also callable as `g8.api.call("get_deal_detail_deals__deal_id__detail_get", input)`)
|
|
898
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
899
|
+
- API-key scope: `deals:read`
|
|
900
|
+
|
|
901
|
+
The full deal record the detail page reads.
|
|
902
|
+
|
|
903
|
+
**Input**
|
|
904
|
+
|
|
905
|
+
| Field | Type | Required | Description |
|
|
906
|
+
|---|---|---|---|
|
|
907
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
908
|
+
| `query.include_revision` | `boolean` | no | Include the optimistic-concurrency revision. Null in the response means this org has no revision tracking, so a save is unconditional - it does NOT mean revision 1. default `false` |
|
|
909
|
+
|
|
910
|
+
**Returns** `ApiResponse_DealDetail_`: the envelope `{ data: DealDetail, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
911
|
+
|
|
912
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
913
|
+
|
|
914
|
+
`DealDetail` fields:
|
|
915
|
+
|
|
916
|
+
| Field | Type | Required | Description |
|
|
917
|
+
|---|---|---|---|
|
|
918
|
+
| `amount` | `number \| null` | no | |
|
|
919
|
+
| `close_date` | `string (date-time) \| null` | no | |
|
|
920
|
+
| `company_id` | `string \| null` | no | |
|
|
921
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
922
|
+
| `currency` | `string \| null` | no | |
|
|
923
|
+
| `description` | `string \| null` | no | |
|
|
924
|
+
| `id` | `string \| null` | no | |
|
|
925
|
+
| `name` | `string \| null` | no | |
|
|
926
|
+
| `owner_id` | `string \| null` | no | |
|
|
927
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
928
|
+
| `revision` | `integer \| null` | no | Optimistic-concurrency token. None means this org has no revision tracking, so a save is unconditional - it does NOT mean 1. |
|
|
929
|
+
| `stage` | `string \| null` | no | |
|
|
930
|
+
| `stage_id` | `string \| null` | no | |
|
|
931
|
+
| `status` | `string \| null` | no | |
|
|
932
|
+
| `updated_at` | `string (date-time) \| null` | no | |
|
|
933
|
+
|
|
934
|
+
**Example**
|
|
935
|
+
|
|
936
|
+
```ts
|
|
937
|
+
const result = await g8.api.deals.getDealDetail({ path: { deal_id: "id" } });
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
---
|
|
941
|
+
|
|
942
|
+
<a id="op-getdealdocument"></a>
|
|
943
|
+
|
|
944
|
+
### `g8.api.deals.getDealDocument(input)`
|
|
945
|
+
|
|
946
|
+
**Get Deal Document**
|
|
947
|
+
|
|
948
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/documents/types/{doc_type}`
|
|
949
|
+
- operationId: `get_deal_document_deals__deal_id__documents_types__doc_type__get` (also callable as `g8.api.call("get_deal_document_deals__deal_id__documents_types__doc_type__get", input)`)
|
|
950
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
951
|
+
- API-key scope: `deals:read`
|
|
952
|
+
|
|
953
|
+
One generated document, in full.
|
|
954
|
+
|
|
955
|
+
There is at most ONE document per type per deal, which is why the type
|
|
956
|
+
identifies it. 404 when it has not been generated yet.
|
|
957
|
+
|
|
958
|
+
**Input**
|
|
959
|
+
|
|
960
|
+
| Field | Type | Required | Description |
|
|
961
|
+
|---|---|---|---|
|
|
962
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
963
|
+
| `path.doc_type` | `"deal_risks" \| "next_steps" \| "close_plan" \| "scope_of_work" \| "roi_analysis" \| "competitive_analysis"` | yes | Which generated document. One of the six the deal synthesis produces; anything else is a 422 naming them. |
|
|
964
|
+
|
|
965
|
+
**Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
966
|
+
|
|
967
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
968
|
+
|
|
969
|
+
**Example**
|
|
970
|
+
|
|
971
|
+
```ts
|
|
972
|
+
const result = await g8.api.deals.getDealDocument({ path: { deal_id: "id", doc_type: "deal_risks" } });
|
|
973
|
+
```
|
|
974
|
+
|
|
975
|
+
---
|
|
976
|
+
|
|
977
|
+
<a id="op-getdealdocumentgenerationstatus"></a>
|
|
978
|
+
|
|
979
|
+
### `g8.api.deals.getDealDocumentGenerationStatus(input)`
|
|
980
|
+
|
|
981
|
+
**Get Deal Document Generation Status**
|
|
982
|
+
|
|
983
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/documents/generation-status`
|
|
984
|
+
- operationId: `get_deal_document_generation_status_deals__deal_id__documents_generation_status_get` (also callable as `g8.api.call("get_deal_document_generation_status_deals__deal_id__documents_generation_status_get", input)`)
|
|
985
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
986
|
+
- API-key scope: `deals:read`
|
|
987
|
+
|
|
988
|
+
How the generation is going - the cheap read to POLL.
|
|
989
|
+
|
|
990
|
+
Counts rather than content: total, ready, generating, failed. Listing the
|
|
991
|
+
documents transfers every body, which is the wrong call in a poll loop.
|
|
992
|
+
|
|
993
|
+
**Input**
|
|
994
|
+
|
|
995
|
+
| Field | Type | Required | Description |
|
|
996
|
+
|---|---|---|---|
|
|
997
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
998
|
+
|
|
999
|
+
**Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1000
|
+
|
|
1001
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1002
|
+
|
|
1003
|
+
**Example**
|
|
1004
|
+
|
|
1005
|
+
```ts
|
|
1006
|
+
const result = await g8.api.deals.getDealDocumentGenerationStatus({ path: { deal_id: "id" } });
|
|
1007
|
+
```
|
|
1008
|
+
|
|
1009
|
+
---
|
|
1010
|
+
|
|
1011
|
+
<a id="op-getdealsignals"></a>
|
|
1012
|
+
|
|
1013
|
+
### `g8.api.deals.getDealSignals(input)`
|
|
1014
|
+
|
|
1015
|
+
**Get Deal Signals**
|
|
1016
|
+
|
|
1017
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/signals`
|
|
1018
|
+
- operationId: `get_deal_signals_deals__deal_id__signals_get` (also callable as `g8.api.call("get_deal_signals_deals__deal_id__signals_get", input)`)
|
|
1019
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1020
|
+
- API-key scope: `deals:read`
|
|
1021
|
+
|
|
1022
|
+
Intent and activity signals attached to this deal.
|
|
1023
|
+
|
|
1024
|
+
Returned as an open object rather than a pinned shape: the signals payload
|
|
1025
|
+
is assembled from several upstreams and declaring a schema here would
|
|
1026
|
+
silently DROP a signal type the moment one is added.
|
|
1027
|
+
|
|
1028
|
+
**Input**
|
|
1029
|
+
|
|
1030
|
+
| Field | Type | Required | Description |
|
|
1031
|
+
|---|---|---|---|
|
|
1032
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
1033
|
+
|
|
1034
|
+
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1035
|
+
|
|
1036
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1037
|
+
|
|
1038
|
+
**Example**
|
|
1039
|
+
|
|
1040
|
+
```ts
|
|
1041
|
+
const result = await g8.api.deals.getDealSignals({ path: { deal_id: "id" } });
|
|
1042
|
+
```
|
|
1043
|
+
|
|
1044
|
+
---
|
|
1045
|
+
|
|
1046
|
+
<a id="op-getdealstagevelocity"></a>
|
|
1047
|
+
|
|
1048
|
+
### `g8.api.deals.getDealStageVelocity(input?)`
|
|
1049
|
+
|
|
1050
|
+
**Get Deal Stage Velocity**
|
|
1051
|
+
|
|
1052
|
+
- HTTP: `GET /api/v1/deals/stage-velocity`
|
|
1053
|
+
- operationId: `get_deal_stage_velocity_deals_stage_velocity_get` (also callable as `g8.api.call("get_deal_stage_velocity_deals_stage_velocity_get", input)`)
|
|
1054
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1055
|
+
- API-key scope: `deals:read`
|
|
1056
|
+
|
|
1057
|
+
Time in stage, stage conversion and stuck deals over the deals the key can see.
|
|
1058
|
+
|
|
1059
|
+
**Input**
|
|
1060
|
+
|
|
1061
|
+
| Field | Type | Required | Description |
|
|
1062
|
+
|---|---|---|---|
|
|
1063
|
+
| `query.pipeline_id` | `string \| null` | no | Only this pipeline (UUID). |
|
|
1064
|
+
| `query.owner_ids` | `Array<string> \| null` | no | Only these owners. Repeatable, at most 100. |
|
|
1065
|
+
| `query.stuck_threshold_days` | `integer` | no | A deal with no stage change in this many days is 'stuck'. default `30` |
|
|
1066
|
+
|
|
1067
|
+
**Returns** `ApiResponse_DealStageVelocityPayload_`: the envelope `{ data: DealStageVelocityPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1068
|
+
|
|
1069
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1070
|
+
|
|
1071
|
+
`DealStageVelocityPayload` fields:
|
|
1072
|
+
|
|
1073
|
+
| Field | Type | Required | Description |
|
|
1074
|
+
|---|---|---|---|
|
|
1075
|
+
| `stuck_deals` | `DealStageVelocityStuckSummary` | yes | |
|
|
1076
|
+
| `by_stage` | `Array<DealStageVelocityBucket>` | no | |
|
|
1077
|
+
| `disclosures` | `Array<string>` | no | |
|
|
1078
|
+
|
|
1079
|
+
**Example**
|
|
1080
|
+
|
|
1081
|
+
```ts
|
|
1082
|
+
const result = await g8.api.deals.getDealStageVelocity();
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
---
|
|
1086
|
+
|
|
1087
|
+
<a id="op-listaccountdeals"></a>
|
|
1088
|
+
|
|
1089
|
+
### `g8.api.deals.listAccountDeals(input)`
|
|
1090
|
+
|
|
1091
|
+
**List Account Deals**
|
|
1092
|
+
|
|
1093
|
+
- HTTP: `GET /api/v1/accounts/{account_id}/deals`
|
|
1094
|
+
- operationId: `list_account_deals_accounts__account_id__deals_get` (also callable as `g8.api.call("list_account_deals_accounts__account_id__deals_get", input)`)
|
|
1095
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1096
|
+
- API-key scope: `deals:read`
|
|
1097
|
+
|
|
1098
|
+
Deals on one account.
|
|
1099
|
+
|
|
1100
|
+
No per-record gate: a LIST is filtered by `deal_scope`, which the app
|
|
1101
|
+
handler takes as a parameter and applies itself. Gating row by row here
|
|
1102
|
+
would be both redundant and wrong - there is no single deal id to check.
|
|
1103
|
+
|
|
1104
|
+
**Input**
|
|
1105
|
+
|
|
1106
|
+
| Field | Type | Required | Description |
|
|
1107
|
+
|---|---|---|---|
|
|
1108
|
+
| `path.account_id` | `string` | yes | Account id. |
|
|
1109
|
+
|
|
1110
|
+
**Returns** `ApiResponse_DealListResponse_`: the envelope `{ data: DealListResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1111
|
+
|
|
1112
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1113
|
+
|
|
1114
|
+
`DealListResponse` fields:
|
|
1115
|
+
|
|
1116
|
+
| Field | Type | Required | Description |
|
|
1117
|
+
|---|---|---|---|
|
|
1118
|
+
| `deals` | `Array<DealSummary>` | no | |
|
|
1119
|
+
| `total` | `integer` | no | default `0` |
|
|
1120
|
+
|
|
1121
|
+
**Example**
|
|
1122
|
+
|
|
1123
|
+
```ts
|
|
1124
|
+
const result = await g8.api.deals.listAccountDeals({ path: { account_id: "id" } });
|
|
1125
|
+
```
|
|
1126
|
+
|
|
1127
|
+
---
|
|
1128
|
+
|
|
1129
|
+
<a id="op-listdealclosereasons"></a>
|
|
1130
|
+
|
|
1131
|
+
### `g8.api.deals.listDealCloseReasons(input?)`
|
|
1132
|
+
|
|
1133
|
+
**List Deal Close Reasons**
|
|
1134
|
+
|
|
1135
|
+
- HTTP: `GET /api/v1/deals/close-reasons`
|
|
1136
|
+
- operationId: `list_deal_close_reasons_deals_close_reasons_get` (also callable as `g8.api.call("list_deal_close_reasons_deals_close_reasons_get", input)`)
|
|
1137
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1138
|
+
- API-key scope: `deals:read`
|
|
1139
|
+
|
|
1140
|
+
The org's close reasons, and what this caller may do with them.
|
|
1141
|
+
|
|
1142
|
+
`can_manage` comes back WITH the list, resolved by the same rule the
|
|
1143
|
+
archive endpoint enforces - the app does that deliberately so the control a
|
|
1144
|
+
UI renders and the permission the endpoint applies cannot drift. A
|
|
1145
|
+
rebuilder without it has to guess which rows are removable.
|
|
1146
|
+
|
|
1147
|
+
LITERAL PATH: registered before `deals_router` so `/deals/{deal_id}` cannot
|
|
1148
|
+
read "close-reasons" as a deal id.
|
|
1149
|
+
|
|
1150
|
+
**Input**
|
|
1151
|
+
|
|
1152
|
+
| Field | Type | Required | Description |
|
|
1153
|
+
|---|---|---|---|
|
|
1154
|
+
| `query.kind` | `string \| null` | no | Filter to one list, e.g. won or lost. |
|
|
1155
|
+
|
|
1156
|
+
**Returns** `ApiResponse_CloseReasonListResponse_`: the envelope `{ data: CloseReasonListResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1157
|
+
|
|
1158
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1159
|
+
|
|
1160
|
+
`CloseReasonListResponse` fields:
|
|
1161
|
+
|
|
1162
|
+
| Field | Type | Required | Description |
|
|
1163
|
+
|---|---|---|---|
|
|
1164
|
+
| `can_manage` | `boolean \| null` | no | Whether this caller may archive reasons they did not create. |
|
|
1165
|
+
| `reasons` | `Array<Record<string, unknown>>` | no | |
|
|
1166
|
+
|
|
1167
|
+
**Example**
|
|
1168
|
+
|
|
1169
|
+
```ts
|
|
1170
|
+
const result = await g8.api.deals.listDealCloseReasons();
|
|
1171
|
+
```
|
|
1172
|
+
|
|
1173
|
+
---
|
|
1174
|
+
|
|
1175
|
+
<a id="op-listdealcolumns"></a>
|
|
1176
|
+
|
|
1177
|
+
### `g8.api.deals.listDealColumns(input?)`
|
|
1178
|
+
|
|
1179
|
+
**List Deal Columns**
|
|
1180
|
+
|
|
1181
|
+
- HTTP: `GET /api/v1/deals/columns`
|
|
1182
|
+
- operationId: `list_deal_columns_deals_columns_get` (also callable as `g8.api.call("list_deal_columns_deals_columns_get", input)`)
|
|
1183
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1184
|
+
- API-key scope: `deals:read`
|
|
1185
|
+
|
|
1186
|
+
The custom columns the deals grid can show.
|
|
1187
|
+
|
|
1188
|
+
The source of the keys `PUT /deals/{id}/columns/values` accepts - writing
|
|
1189
|
+
to anything else is refused.
|
|
1190
|
+
|
|
1191
|
+
**Input**
|
|
1192
|
+
|
|
1193
|
+
| Field | Type | Required | Description |
|
|
1194
|
+
|---|---|---|---|
|
|
1195
|
+
| `query.list_id` | `integer \| null` | no | Only columns scoped to this list, plus the global ones. Omit for the global set alone. |
|
|
1196
|
+
|
|
1197
|
+
**Returns** `ApiResponse_DealCollectionPayload_`: the envelope `{ data: DealCollectionPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1198
|
+
|
|
1199
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1200
|
+
|
|
1201
|
+
`DealCollectionPayload` fields:
|
|
1202
|
+
|
|
1203
|
+
| Field | Type | Required | Description |
|
|
1204
|
+
|---|---|---|---|
|
|
1205
|
+
| `items` | `Array<unknown>` | no | |
|
|
1206
|
+
|
|
1207
|
+
**Example**
|
|
1208
|
+
|
|
1209
|
+
```ts
|
|
1210
|
+
const result = await g8.api.deals.listDealColumns();
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
---
|
|
1214
|
+
|
|
1215
|
+
<a id="op-listdealcontacts"></a>
|
|
1216
|
+
|
|
1217
|
+
### `g8.api.deals.listDealContacts(input)`
|
|
1218
|
+
|
|
1219
|
+
**List Deal Contacts**
|
|
1220
|
+
|
|
1221
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/contacts`
|
|
1222
|
+
- operationId: `list_deal_contacts_deals__deal_id__contacts_get` (also callable as `g8.api.call("list_deal_contacts_deals__deal_id__contacts_get", input)`)
|
|
1223
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1224
|
+
- API-key scope: `deals:read`
|
|
1225
|
+
|
|
1226
|
+
Everyone linked to this deal, with their role on it.
|
|
1227
|
+
|
|
1228
|
+
**Input**
|
|
1229
|
+
|
|
1230
|
+
| Field | Type | Required | Description |
|
|
1231
|
+
|---|---|---|---|
|
|
1232
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
1233
|
+
|
|
1234
|
+
**Returns** `ApiResponse_DealContactListResponse_`: the envelope `{ data: DealContactListResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1235
|
+
|
|
1236
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1237
|
+
|
|
1238
|
+
`DealContactListResponse` fields:
|
|
1239
|
+
|
|
1240
|
+
| Field | Type | Required | Description |
|
|
1241
|
+
|---|---|---|---|
|
|
1242
|
+
| `contacts` | `Array<DealContact>` | no | |
|
|
1243
|
+
| `total` | `integer` | no | default `0` |
|
|
1244
|
+
|
|
1245
|
+
**Example**
|
|
1246
|
+
|
|
1247
|
+
```ts
|
|
1248
|
+
const result = await g8.api.deals.listDealContacts({ path: { deal_id: "id" } });
|
|
1249
|
+
```
|
|
1250
|
+
|
|
1251
|
+
---
|
|
1252
|
+
|
|
1253
|
+
<a id="op-listdealcustomfielddiconfig"></a>
|
|
1254
|
+
|
|
1255
|
+
### `g8.api.deals.listDealCustomFieldDiConfig(input?)`
|
|
1256
|
+
|
|
1257
|
+
**List Deal Custom Field Di Config**
|
|
1258
|
+
|
|
1259
|
+
- HTTP: `GET /api/v1/deals/custom-fields/di-config`
|
|
1260
|
+
- operationId: `list_deal_custom_field_di_config_deals_custom_fields_di_config_get` (also callable as `g8.api.call("list_deal_custom_field_di_config_deals_custom_fields_di_config_get", input)`)
|
|
1261
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1262
|
+
- API-key scope: `deals:read`
|
|
1263
|
+
|
|
1264
|
+
Which deal custom fields exist and how they map outward.
|
|
1265
|
+
|
|
1266
|
+
No per-record gate: this is org-level configuration, not a deal.
|
|
1267
|
+
|
|
1268
|
+
NOTE ON ROUTING ORDER: this path is LITERAL and would otherwise be
|
|
1269
|
+
swallowed by `/deals/{deal_id}` in the existing deals router, which would
|
|
1270
|
+
read "custom-fields" as a deal id. That is why this router is registered
|
|
1271
|
+
BEFORE it in `app.py` - see the comment there.
|
|
1272
|
+
|
|
1273
|
+
**Input**
|
|
1274
|
+
|
|
1275
|
+
| Field | Type | Required | Description |
|
|
1276
|
+
|---|---|---|---|
|
|
1277
|
+
| `query.crm_provider` | `string \| null` | no | Filter to one CRM provider's mappings. |
|
|
1278
|
+
|
|
1279
|
+
**Returns** `ApiResponse_CustomFieldDiConfigListResponse_`: the envelope `{ data: CustomFieldDiConfigListResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1280
|
+
|
|
1281
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1282
|
+
|
|
1283
|
+
`CustomFieldDiConfigListResponse` fields:
|
|
1284
|
+
|
|
1285
|
+
| Field | Type | Required | Description |
|
|
1286
|
+
|---|---|---|---|
|
|
1287
|
+
| `configs` | `Array<Record<string, unknown>>` | no | |
|
|
1288
|
+
| `total` | `integer` | no | default `0` |
|
|
1289
|
+
|
|
1290
|
+
**Example**
|
|
1291
|
+
|
|
1292
|
+
```ts
|
|
1293
|
+
const result = await g8.api.deals.listDealCustomFieldDiConfig();
|
|
1294
|
+
```
|
|
1295
|
+
|
|
1296
|
+
---
|
|
1297
|
+
|
|
1298
|
+
<a id="op-listdealdocuments"></a>
|
|
1299
|
+
|
|
1300
|
+
### `g8.api.deals.listDealDocuments(input)`
|
|
1301
|
+
|
|
1302
|
+
**List Deal Documents**
|
|
1303
|
+
|
|
1304
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/documents`
|
|
1305
|
+
- operationId: `list_deal_documents_deals__deal_id__documents_get` (also callable as `g8.api.call("list_deal_documents_deals__deal_id__documents_get", input)`)
|
|
1306
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1307
|
+
- API-key scope: `deals:read`
|
|
1308
|
+
|
|
1309
|
+
Every generated document on this deal, newest first.
|
|
1310
|
+
|
|
1311
|
+
Carries each document's body, so it is the wrong read for a poll loop -
|
|
1312
|
+
use `/documents/generation-status` for that.
|
|
1313
|
+
|
|
1314
|
+
**Input**
|
|
1315
|
+
|
|
1316
|
+
| Field | Type | Required | Description |
|
|
1317
|
+
|---|---|---|---|
|
|
1318
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
1319
|
+
| `query.folder` | `string \| null` | no | `strategy` or `analysis`. Not validated by the app - an unrecognised folder matches nothing rather than failing. |
|
|
1320
|
+
|
|
1321
|
+
**Returns** `ApiResponse_DocumentListPayload_`: the envelope `{ data: DocumentListPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1322
|
+
|
|
1323
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1324
|
+
|
|
1325
|
+
`DocumentListPayload` fields:
|
|
1326
|
+
|
|
1327
|
+
| Field | Type | Required | Description |
|
|
1328
|
+
|---|---|---|---|
|
|
1329
|
+
| `items` | `Array<unknown>` | no | |
|
|
1330
|
+
|
|
1331
|
+
**Example**
|
|
1332
|
+
|
|
1333
|
+
```ts
|
|
1334
|
+
const result = await g8.api.deals.listDealDocuments({ path: { deal_id: "id" } });
|
|
1335
|
+
```
|
|
1336
|
+
|
|
1337
|
+
---
|
|
1338
|
+
|
|
1339
|
+
<a id="op-listdealhistory"></a>
|
|
1340
|
+
|
|
1341
|
+
### `g8.api.deals.listDealHistory(input)`
|
|
1342
|
+
|
|
1343
|
+
**List Deal History**
|
|
1344
|
+
|
|
1345
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/history`
|
|
1346
|
+
- operationId: `list_deal_history_deals__deal_id__history_get` (also callable as `g8.api.call("list_deal_history_deals__deal_id__history_get", input)`)
|
|
1347
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1348
|
+
- API-key scope: `deals:read`
|
|
1349
|
+
|
|
1350
|
+
What changed on this deal, and who changed it.
|
|
1351
|
+
|
|
1352
|
+
**Input**
|
|
1353
|
+
|
|
1354
|
+
| Field | Type | Required | Description |
|
|
1355
|
+
|---|---|---|---|
|
|
1356
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
1357
|
+
| `query.limit` | `integer` | no | The app's cap, and it is a real ceiling rather than a default to raise: a long history pages through `offset`. default `200` |
|
|
1358
|
+
| `query.offset` | `integer` | no | default `0` |
|
|
1359
|
+
|
|
1360
|
+
**Returns** `ApiResponse_DealCollectionPayload_`: the envelope `{ data: DealCollectionPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1361
|
+
|
|
1362
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1363
|
+
|
|
1364
|
+
`DealCollectionPayload` fields:
|
|
1365
|
+
|
|
1366
|
+
| Field | Type | Required | Description |
|
|
1367
|
+
|---|---|---|---|
|
|
1368
|
+
| `items` | `Array<unknown>` | no | |
|
|
1369
|
+
|
|
1370
|
+
**Example**
|
|
1371
|
+
|
|
1372
|
+
```ts
|
|
1373
|
+
const result = await g8.api.deals.listDealHistory({ path: { deal_id: "id" } });
|
|
1374
|
+
```
|
|
1375
|
+
|
|
1376
|
+
---
|
|
1377
|
+
|
|
1378
|
+
<a id="op-listdeallineitems"></a>
|
|
1379
|
+
|
|
1380
|
+
### `g8.api.deals.listDealLineItems(input)`
|
|
1381
|
+
|
|
1382
|
+
**List Deal Line Items**
|
|
1383
|
+
|
|
1384
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/line-items`
|
|
1385
|
+
- operationId: `list_deal_line_items_deals__deal_id__line_items_get` (also callable as `g8.api.call("list_deal_line_items_deals__deal_id__line_items_get", input)`)
|
|
1386
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1387
|
+
- API-key scope: `deals:read`
|
|
1388
|
+
|
|
1389
|
+
A deal's line items, its derived amount, and whether it disagrees with its linked quote.
|
|
1390
|
+
|
|
1391
|
+
**Input**
|
|
1392
|
+
|
|
1393
|
+
| Field | Type | Required | Description |
|
|
1394
|
+
|---|---|---|---|
|
|
1395
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
1396
|
+
|
|
1397
|
+
**Returns** `ApiResponse_DealLineItemsPayload_`: the envelope `{ data: DealLineItemsPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1398
|
+
|
|
1399
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1400
|
+
|
|
1401
|
+
`DealLineItemsPayload` fields:
|
|
1402
|
+
|
|
1403
|
+
| Field | Type | Required | Description |
|
|
1404
|
+
|---|---|---|---|
|
|
1405
|
+
| `deal_id` | `string` | yes | |
|
|
1406
|
+
| `amount` | `number \| null` | no | |
|
|
1407
|
+
| `amount_mismatch` | `boolean` | no | default `false` |
|
|
1408
|
+
| `currency` | `string \| null` | no | |
|
|
1409
|
+
| `line_items` | `Array<DealLineItemRecord>` | no | |
|
|
1410
|
+
| `linked_quote_total` | `number \| null` | no | |
|
|
1411
|
+
|
|
1412
|
+
**Example**
|
|
1413
|
+
|
|
1414
|
+
```ts
|
|
1415
|
+
const result = await g8.api.deals.listDealLineItems({ path: { deal_id: "id" } });
|
|
1416
|
+
```
|
|
1417
|
+
|
|
1418
|
+
---
|
|
1419
|
+
|
|
1420
|
+
<a id="op-listdeals"></a>
|
|
1421
|
+
|
|
1422
|
+
### `g8.api.deals.listDeals(input?)`
|
|
1423
|
+
|
|
1424
|
+
**List Deals**
|
|
1425
|
+
|
|
1426
|
+
- HTTP: `GET /api/v1/deals`
|
|
1427
|
+
- operationId: `list_deals_deals_get` (also callable as `g8.api.call("list_deals_deals_get", input)`)
|
|
1428
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1429
|
+
- API-key scope: `deals:read`
|
|
1430
|
+
- ★ Hand-written: [`g8.deals.list()`](../sdk-clients.md#g8-deals-list)
|
|
1431
|
+
|
|
1432
|
+
List all deals org-wide with optional filters and pagination.
|
|
1433
|
+
|
|
1434
|
+
**Input**
|
|
1435
|
+
|
|
1436
|
+
| Field | Type | Required | Description |
|
|
1437
|
+
|---|---|---|---|
|
|
1438
|
+
| `query.page` | `integer` | no | Page number default `1` |
|
|
1439
|
+
| `query.limit` | `integer` | no | Items per page default `50` |
|
|
1440
|
+
| `query.stage_id` | `string \| null` | no | Filter by stage ID |
|
|
1441
|
+
| `query.pipeline_id` | `string \| null` | no | Filter by pipeline ID |
|
|
1442
|
+
| `query.search` | `string \| null` | no | Search by deal name |
|
|
1443
|
+
| `query.owner_id` | `string \| null` | no | Filter by owner ID |
|
|
1444
|
+
| `query.owner_email` | `string \| null` | no | Filter by owner email |
|
|
1445
|
+
| `query.outcome` | `"won" \| "lost" \| "open" \| null` | no | Filter by deal outcome. A deal is won, lost, or open - exactly one. Prefer this over is_closed_won: the boolean's false branch means 'not won', which returns open AND unclassified deals alongside lost ones, and is the wrong cohort for closed-lost re-engagement. |
|
|
1446
|
+
| `query.is_closed_won` | `boolean \| null` | no | LEGACY - prefer outcome=. Retained for backwards compatibility with existing consumers. true means won; false means NOT won (open, lost and unclassified deals), which is rarely what a caller intends. |
|
|
1447
|
+
| `query.last_activity_before` | `string (date-time) \| null` | no | Only deals last touched before this timestamp |
|
|
1448
|
+
| `query.stale_before` | `string (date-time) \| null` | no | Deals last touched before this timestamp OR never touched at all. Union of last_activity_before and the no-activity cohort - use this for 'my stale deals' (last_activity_before alone excludes deals with no recorded activity, since NULL is never earlier-than). |
|
|
1449
|
+
| `query.has_activity` | `boolean \| null` | no | Filter by whether the deal has recorded activity |
|
|
1450
|
+
| `query.has_contact` | `boolean \| null` | no | Filter by whether the deal has a route to any contact. false returns the orphaned-deal cohort: no cb_deal_contacts row AND no live primary contact (a primary_contact_id pointing at a soft-deleted or merged-away contact counts as no route). Same definition the Data Quality panel counts, so the two can never disagree. |
|
|
1451
|
+
| `query.close_after` | `string (date-time) \| null` | no | Only deals whose close_date is on/after this timestamp (inclusive lower bound). Pair with close_before for a period window, and with outcome=won for 'deals we closed-won in this period'. A period count needs BOTH a lower bound and the outcome join: close_before alone sums the entire deal history into every period. Deals with a NULL close_date are excluded (a deal with no close date is not closing… |
|
|
1452
|
+
| `query.close_before` | `string (date-time) \| null` | no | Only deals whose close_date is strictly before this timestamp (exclusive upper bound). The window is half-open [close_after, close_before) so adjacent periods never double-count a deal that closes exactly on a boundary. A naive timestamp is treated as UTC (the close_date column is timestamp without time zone). |
|
|
1453
|
+
|
|
1454
|
+
**Returns** `ApiResponse_list_DealResponse__`: the envelope `{ data: Array<DealResponse>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1455
|
+
|
|
1456
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1457
|
+
|
|
1458
|
+
`DealResponse` fields:
|
|
1459
|
+
|
|
1460
|
+
| Field | Type | Required | Description |
|
|
1461
|
+
|---|---|---|---|
|
|
1462
|
+
| `amount` | `number \| null` | no | |
|
|
1463
|
+
| `close_date` | `string \| null` | no | |
|
|
1464
|
+
| `closed_lost_reason` | `string \| null` | no | |
|
|
1465
|
+
| `company_id` | `unknown \| null` | no | |
|
|
1466
|
+
| `contact_count` | `integer` | no | default `0` |
|
|
1467
|
+
| `contacts` | `Array<ContactBrief> \| null` | no | |
|
|
1468
|
+
| `created_at` | `string \| null` | no | |
|
|
1469
|
+
| `currency` | `string \| null` | no | |
|
|
1470
|
+
| `description` | `string \| null` | no | |
|
|
1471
|
+
| `id` | `string \| null` | no | |
|
|
1472
|
+
| `last_activity_at` | `string \| null` | no | |
|
|
1473
|
+
| `name` | `string \| null` | no | |
|
|
1474
|
+
| `owner_email` | `string \| null` | no | |
|
|
1475
|
+
| `owner_id` | `string \| null` | no | |
|
|
1476
|
+
| `owner_name` | `string \| null` | no | |
|
|
1477
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
1478
|
+
| `pipeline_name` | `string \| null` | no | |
|
|
1479
|
+
| `primary_contact` | `ContactBrief \| null` | no | |
|
|
1480
|
+
| `revision` | `integer \| null` | no | CRM revision after a conditional update |
|
|
1481
|
+
| `stage_id` | `string \| null` | no | |
|
|
1482
|
+
| `stage_name` | `string \| null` | no | |
|
|
1483
|
+
| `updated_at` | `string \| null` | no | |
|
|
1484
|
+
|
|
1485
|
+
**Example**
|
|
1486
|
+
|
|
1487
|
+
```ts
|
|
1488
|
+
const result = await g8.api.deals.listDeals();
|
|
1489
|
+
```
|
|
1490
|
+
|
|
1491
|
+
---
|
|
1492
|
+
|
|
1493
|
+
<a id="op-listpipelines"></a>
|
|
1494
|
+
|
|
1495
|
+
### `g8.api.deals.listPipelines(input?)`
|
|
1496
|
+
|
|
1497
|
+
**List Pipelines**
|
|
1498
|
+
|
|
1499
|
+
- HTTP: `GET /api/v1/deals/pipelines`
|
|
1500
|
+
- operationId: `list_pipelines_deals_pipelines_get` (also callable as `g8.api.call("list_pipelines_deals_pipelines_get", input)`)
|
|
1501
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1502
|
+
- API-key scope: `deals:read`
|
|
1503
|
+
- ★ Hand-written: [`g8.deals.pipelines()`](../sdk-clients.md#g8-deals-pipelines)
|
|
1504
|
+
|
|
1505
|
+
List all deal pipelines and their stages.
|
|
1506
|
+
|
|
1507
|
+
**Input**: none.
|
|
1508
|
+
|
|
1509
|
+
**Returns** `ApiResponse_list_PipelineResponse__`: the envelope `{ data: Array<PipelineResponse>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1510
|
+
|
|
1511
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1512
|
+
|
|
1513
|
+
`PipelineResponse` fields:
|
|
1514
|
+
|
|
1515
|
+
| Field | Type | Required | Description |
|
|
1516
|
+
|---|---|---|---|
|
|
1517
|
+
| `id` | `string` | yes | |
|
|
1518
|
+
| `name` | `string` | yes | |
|
|
1519
|
+
| `is_default` | `boolean` | no | default `false` |
|
|
1520
|
+
| `stages` | `Array<PipelineStageResponse>` | no | default `[]` |
|
|
1521
|
+
|
|
1522
|
+
**Example**
|
|
1523
|
+
|
|
1524
|
+
```ts
|
|
1525
|
+
const result = await g8.api.deals.listPipelines();
|
|
1526
|
+
```
|
|
1527
|
+
|
|
1528
|
+
---
|
|
1529
|
+
|
|
1530
|
+
<a id="op-mergedeal"></a>
|
|
1531
|
+
|
|
1532
|
+
### `g8.api.deals.mergeDeal(input)`
|
|
1533
|
+
|
|
1534
|
+
**Merge Deal**
|
|
1535
|
+
|
|
1536
|
+
- HTTP: `POST /api/v1/deals/{deal_id}/merge`
|
|
1537
|
+
- operationId: `merge_deal_deals__deal_id__merge_post` (also callable as `g8.api.call("merge_deal_deals__deal_id__merge_post", input)`)
|
|
1538
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
1539
|
+
- API-key scope: `deals:delete`
|
|
1540
|
+
|
|
1541
|
+
Merge `secondary_id` into this deal. NOT REVERSIBLE.
|
|
1542
|
+
|
|
1543
|
+
The secondary deal stops existing; its contacts, notes and activity move
|
|
1544
|
+
onto the survivor. `field_overrides` is the only way to keep a value from
|
|
1545
|
+
the deal being merged away.
|
|
1546
|
+
|
|
1547
|
+
Preview it first. There is no unmerge.
|
|
1548
|
+
|
|
1549
|
+
**Input**
|
|
1550
|
+
|
|
1551
|
+
| Field | Type | Required | Description |
|
|
1552
|
+
|---|---|---|---|
|
|
1553
|
+
| `path.deal_id` | `string` | yes | The deal that SURVIVES. |
|
|
1554
|
+
| `body` | `MergeDealRequest` | yes | Request body; fields below. |
|
|
1555
|
+
|
|
1556
|
+
Body fields (`MergeDealRequest`):
|
|
1557
|
+
|
|
1558
|
+
| Field | Type | Required | Description |
|
|
1559
|
+
|---|---|---|---|
|
|
1560
|
+
| `body.secondary_id` | `string` | yes | The deal to merge AWAY. Must be a UUID; the path deal survives. |
|
|
1561
|
+
| `body.field_overrides` | `Array<DealFieldOverride>` | no | Decide individual fields yourself instead of taking the app's rules. |
|
|
1562
|
+
| `body.suggestion_id` | `string \| null` | no | The duplicate-suggestion this merge acts on, if any. |
|
|
1563
|
+
| `body.trigger` | `"manual" \| "queue" \| "bulk_criterion"` | no | What prompted the merge. Recorded on the audit row. default `"manual"` |
|
|
1564
|
+
|
|
1565
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1566
|
+
|
|
1567
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1568
|
+
|
|
1569
|
+
**Example**
|
|
1570
|
+
|
|
1571
|
+
```ts
|
|
1572
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
1573
|
+
const result = await g8.api.deals.mergeDeal({ path: { deal_id: "id" }, body: { secondary_id: "id" } });
|
|
1574
|
+
```
|
|
1575
|
+
|
|
1576
|
+
---
|
|
1577
|
+
|
|
1578
|
+
<a id="op-movedealtopipeline"></a>
|
|
1579
|
+
|
|
1580
|
+
### `g8.api.deals.moveDealToPipeline(input)`
|
|
1581
|
+
|
|
1582
|
+
**Move Deal To Pipeline**
|
|
1583
|
+
|
|
1584
|
+
- HTTP: `PUT /api/v1/deals/{deal_id}/pipeline`
|
|
1585
|
+
- operationId: `move_deal_to_pipeline_deals__deal_id__pipeline_put` (also callable as `g8.api.call("move_deal_to_pipeline_deals__deal_id__pipeline_put", input)`)
|
|
1586
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
1587
|
+
- API-key scope: `deals:write`
|
|
1588
|
+
|
|
1589
|
+
Move a deal into a different pipeline.
|
|
1590
|
+
|
|
1591
|
+
The deal keeps its identity and history. Its STAGE does not carry over -
|
|
1592
|
+
the target pipeline has its own stages and the app re-seats the deal within
|
|
1593
|
+
them, so a caller should read the deal back rather than assume its stage.
|
|
1594
|
+
|
|
1595
|
+
The path is `/pipeline` rather than the app's `/move-pipeline`: the verb is
|
|
1596
|
+
already in the PUT.
|
|
1597
|
+
|
|
1598
|
+
**Input**
|
|
1599
|
+
|
|
1600
|
+
| Field | Type | Required | Description |
|
|
1601
|
+
|---|---|---|---|
|
|
1602
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
1603
|
+
| `body` | `DealMovePipelineRequest` | yes | Request body; fields below. |
|
|
1604
|
+
|
|
1605
|
+
Body fields (`DealMovePipelineRequest`):
|
|
1606
|
+
|
|
1607
|
+
| Field | Type | Required | Description |
|
|
1608
|
+
|---|---|---|---|
|
|
1609
|
+
| `body.target_pipeline_id` | `string` | yes | Pipeline to move the deal into. |
|
|
1610
|
+
|
|
1611
|
+
**Returns** `ApiResponse_DealOpResponse_`: the envelope `{ data: DealOpResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1612
|
+
|
|
1613
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1614
|
+
|
|
1615
|
+
**Example**
|
|
1616
|
+
|
|
1617
|
+
```ts
|
|
1618
|
+
const result = await g8.api.deals.moveDealToPipeline({ path: { deal_id: "id" }, body: { target_pipeline_id: "id" } });
|
|
1619
|
+
```
|
|
1620
|
+
|
|
1621
|
+
---
|
|
1622
|
+
|
|
1623
|
+
<a id="op-previewdealmerge"></a>
|
|
1624
|
+
|
|
1625
|
+
### `g8.api.deals.previewDealMerge(input)`
|
|
1626
|
+
|
|
1627
|
+
**Preview Deal Merge**
|
|
1628
|
+
|
|
1629
|
+
- HTTP: `GET /api/v1/deals/{deal_id}/merge/preview`
|
|
1630
|
+
- operationId: `preview_deal_merge_deals__deal_id__merge_preview_get` (also callable as `g8.api.call("preview_deal_merge_deals__deal_id__merge_preview_get", input)`)
|
|
1631
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
1632
|
+
- API-key scope: `deals:read`
|
|
1633
|
+
|
|
1634
|
+
What the merge WOULD do. Changes nothing.
|
|
1635
|
+
|
|
1636
|
+
Worth calling first for the same reason the app does: merging is not
|
|
1637
|
+
reversible, and this is the only place that says which field values change
|
|
1638
|
+
and which records move before they do.
|
|
1639
|
+
|
|
1640
|
+
**Input**
|
|
1641
|
+
|
|
1642
|
+
| Field | Type | Required | Description |
|
|
1643
|
+
|---|---|---|---|
|
|
1644
|
+
| `path.deal_id` | `string` | yes | The deal that SURVIVES. |
|
|
1645
|
+
| `query.secondary` | `string` | yes | The deal that would be merged AWAY. |
|
|
1646
|
+
|
|
1647
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1648
|
+
|
|
1649
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1650
|
+
|
|
1651
|
+
**Example**
|
|
1652
|
+
|
|
1653
|
+
```ts
|
|
1654
|
+
const result = await g8.api.deals.previewDealMerge({ path: { deal_id: "id" }, query: { secondary: "example" } });
|
|
1655
|
+
```
|
|
1656
|
+
|
|
1657
|
+
---
|
|
1658
|
+
|
|
1659
|
+
<a id="op-regeneratedealdocument"></a>
|
|
1660
|
+
|
|
1661
|
+
### `g8.api.deals.regenerateDealDocument(input)`
|
|
1662
|
+
|
|
1663
|
+
**Regenerate Deal Document**
|
|
1664
|
+
|
|
1665
|
+
- HTTP: `POST /api/v1/deals/{deal_id}/documents/types/{doc_type}/regenerate`
|
|
1666
|
+
- operationId: `regenerate_deal_document_deals__deal_id__documents_types__doc_type__regenerate_post` (also callable as `g8.api.call("regenerate_deal_document_deals__deal_id__documents_types__doc_type__regenerate_post", input)`)
|
|
1667
|
+
- Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
|
|
1668
|
+
- API-key scope: `deals:run`
|
|
1669
|
+
|
|
1670
|
+
Re-write a document that already exists. SPENDS CREDITS.
|
|
1671
|
+
|
|
1672
|
+
The difference from `/generate` is what happens when the document is
|
|
1673
|
+
MISSING: this 404s, `/generate` creates it. Use this when you want to be
|
|
1674
|
+
sure you are replacing rather than creating.
|
|
1675
|
+
|
|
1676
|
+
**Input**
|
|
1677
|
+
|
|
1678
|
+
| Field | Type | Required | Description |
|
|
1679
|
+
|---|---|---|---|
|
|
1680
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
1681
|
+
| `path.doc_type` | `"deal_risks" \| "next_steps" \| "close_plan" \| "scope_of_work" \| "roi_analysis" \| "competitive_analysis"` | yes | Which generated document. One of the six the deal synthesis produces; anything else is a 422 naming them. |
|
|
1682
|
+
|
|
1683
|
+
**Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1684
|
+
|
|
1685
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1686
|
+
|
|
1687
|
+
**Example**
|
|
1688
|
+
|
|
1689
|
+
```ts
|
|
1690
|
+
// billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
|
|
1691
|
+
const result = await g8.api.deals.regenerateDealDocument({ path: { deal_id: "id", doc_type: "deal_risks" } });
|
|
1692
|
+
```
|
|
1693
|
+
|
|
1694
|
+
---
|
|
1695
|
+
|
|
1696
|
+
<a id="op-removedealcontact"></a>
|
|
1697
|
+
|
|
1698
|
+
### `g8.api.deals.removeDealContact(input)`
|
|
1699
|
+
|
|
1700
|
+
**Remove Deal Contact**
|
|
1701
|
+
|
|
1702
|
+
- HTTP: `DELETE /api/v1/deals/{deal_id}/contacts/{person_id}`
|
|
1703
|
+
- operationId: `remove_deal_contact_deals__deal_id__contacts__person_id__delete` (also callable as `g8.api.call("remove_deal_contact_deals__deal_id__contacts__person_id__delete", input)`)
|
|
1704
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
1705
|
+
- API-key scope: `deals:delete`
|
|
1706
|
+
|
|
1707
|
+
Unlink a contact from the deal. The contact record itself is untouched.
|
|
1708
|
+
|
|
1709
|
+
**Input**
|
|
1710
|
+
|
|
1711
|
+
| Field | Type | Required | Description |
|
|
1712
|
+
|---|---|---|---|
|
|
1713
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
1714
|
+
| `path.person_id` | `string` | yes | Contact id. |
|
|
1715
|
+
|
|
1716
|
+
**Returns**: no JSON body is declared for the success response.
|
|
1717
|
+
|
|
1718
|
+
**Example**
|
|
1719
|
+
|
|
1720
|
+
```ts
|
|
1721
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
1722
|
+
const result = await g8.api.deals.removeDealContact({ path: { deal_id: "id", person_id: "id" } });
|
|
1723
|
+
```
|
|
1724
|
+
|
|
1725
|
+
---
|
|
1726
|
+
|
|
1727
|
+
<a id="op-replacedeallineitems"></a>
|
|
1728
|
+
|
|
1729
|
+
### `g8.api.deals.replaceDealLineItems(input)`
|
|
1730
|
+
|
|
1731
|
+
**Replace Deal Line Items**
|
|
1732
|
+
|
|
1733
|
+
- HTTP: `PUT /api/v1/deals/{deal_id}/line-items`
|
|
1734
|
+
- operationId: `replace_deal_line_items_deals__deal_id__line_items_put` (also callable as `g8.api.call("replace_deal_line_items_deals__deal_id__line_items_put", input)`)
|
|
1735
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
1736
|
+
- API-key scope: `deals:write`
|
|
1737
|
+
|
|
1738
|
+
Replace a deal's line items. The FULL set, not a delta.
|
|
1739
|
+
|
|
1740
|
+
A non-empty set makes the deal amount the sum of the lines (audited in the
|
|
1741
|
+
deal history). An empty set clears the lines and keeps the typed amount.
|
|
1742
|
+
|
|
1743
|
+
**Input**
|
|
1744
|
+
|
|
1745
|
+
| Field | Type | Required | Description |
|
|
1746
|
+
|---|---|---|---|
|
|
1747
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
1748
|
+
| `body` | `DealLineItemsReplaceBody` | yes | Request body; fields below. |
|
|
1749
|
+
|
|
1750
|
+
Body fields (`DealLineItemsReplaceBody`):
|
|
1751
|
+
|
|
1752
|
+
| Field | Type | Required | Description |
|
|
1753
|
+
|---|---|---|---|
|
|
1754
|
+
| `body.line_items` | `Array<DealLineItemWrite>` | no | |
|
|
1755
|
+
|
|
1756
|
+
**Returns** `ApiResponse_DealLineItemsPayload_`: the envelope `{ data: DealLineItemsPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1757
|
+
|
|
1758
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1759
|
+
|
|
1760
|
+
`DealLineItemsPayload` fields:
|
|
1761
|
+
|
|
1762
|
+
| Field | Type | Required | Description |
|
|
1763
|
+
|---|---|---|---|
|
|
1764
|
+
| `deal_id` | `string` | yes | |
|
|
1765
|
+
| `amount` | `number \| null` | no | |
|
|
1766
|
+
| `amount_mismatch` | `boolean` | no | default `false` |
|
|
1767
|
+
| `currency` | `string \| null` | no | |
|
|
1768
|
+
| `line_items` | `Array<DealLineItemRecord>` | no | |
|
|
1769
|
+
| `linked_quote_total` | `number \| null` | no | |
|
|
1770
|
+
|
|
1771
|
+
**Example**
|
|
1772
|
+
|
|
1773
|
+
```ts
|
|
1774
|
+
const result = await g8.api.deals.replaceDealLineItems({ path: { deal_id: "id" }, body: {} });
|
|
1775
|
+
```
|
|
1776
|
+
|
|
1777
|
+
---
|
|
1778
|
+
|
|
1779
|
+
<a id="op-setdealcolumnvalues"></a>
|
|
1780
|
+
|
|
1781
|
+
### `g8.api.deals.setDealColumnValues(input)`
|
|
1782
|
+
|
|
1783
|
+
**Set Deal Column Values**
|
|
1784
|
+
|
|
1785
|
+
- HTTP: `PUT /api/v1/deals/{deal_id}/columns/values`
|
|
1786
|
+
- operationId: `set_deal_column_values_deals__deal_id__columns_values_put` (also callable as `g8.api.call("set_deal_column_values_deals__deal_id__columns_values_put", input)`)
|
|
1787
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
1788
|
+
- API-key scope: `deals:write`
|
|
1789
|
+
|
|
1790
|
+
Write custom column values on one deal.
|
|
1791
|
+
|
|
1792
|
+
A null CLEARS that column rather than leaving it alone. Keys come from
|
|
1793
|
+
`GET /deals/columns`; anything else is refused.
|
|
1794
|
+
|
|
1795
|
+
**Input**
|
|
1796
|
+
|
|
1797
|
+
| Field | Type | Required | Description |
|
|
1798
|
+
|---|---|---|---|
|
|
1799
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
1800
|
+
| `body` | `SetDealColumnValuesRequest` | yes | Request body; fields below. |
|
|
1801
|
+
| `query.list_id` | `integer \| null` | no | Resolve list-scoped columns against this list. |
|
|
1802
|
+
|
|
1803
|
+
Body fields (`SetDealColumnValuesRequest`):
|
|
1804
|
+
|
|
1805
|
+
| Field | Type | Required | Description |
|
|
1806
|
+
|---|---|---|---|
|
|
1807
|
+
| `body.values` | `Record<string, string \| integer \| number \| boolean \| null>` | yes | Column key -> value. A null clears that column. |
|
|
1808
|
+
|
|
1809
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1810
|
+
|
|
1811
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1812
|
+
|
|
1813
|
+
**Example**
|
|
1814
|
+
|
|
1815
|
+
```ts
|
|
1816
|
+
const result = await g8.api.deals.setDealColumnValues({ path: { deal_id: "id" }, body: { values: {} } });
|
|
1817
|
+
```
|
|
1818
|
+
|
|
1819
|
+
---
|
|
1820
|
+
|
|
1821
|
+
<a id="op-setdealcompany"></a>
|
|
1822
|
+
|
|
1823
|
+
### `g8.api.deals.setDealCompany(input)`
|
|
1824
|
+
|
|
1825
|
+
**Set Deal Company**
|
|
1826
|
+
|
|
1827
|
+
- HTTP: `PUT /api/v1/deals/{deal_id}/company`
|
|
1828
|
+
- operationId: `set_deal_company_deals__deal_id__company_put` (also callable as `g8.api.call("set_deal_company_deals__deal_id__company_put", input)`)
|
|
1829
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
1830
|
+
- API-key scope: `deals:write`
|
|
1831
|
+
|
|
1832
|
+
Attach or change the company on a deal.
|
|
1833
|
+
|
|
1834
|
+
`mashup_company_id` is the CANONICAL company id, not a
|
|
1835
|
+
`cb_company_extensions` / ABM overlay id. They are different tables with
|
|
1836
|
+
different ids, and the wrong one attaches the deal to nothing.
|
|
1837
|
+
|
|
1838
|
+
**Input**
|
|
1839
|
+
|
|
1840
|
+
| Field | Type | Required | Description |
|
|
1841
|
+
|---|---|---|---|
|
|
1842
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
1843
|
+
| `body` | `DealCompanyRequest` | yes | Request body; fields below. |
|
|
1844
|
+
|
|
1845
|
+
Body fields (`DealCompanyRequest`):
|
|
1846
|
+
|
|
1847
|
+
| Field | Type | Required | Description |
|
|
1848
|
+
|---|---|---|---|
|
|
1849
|
+
| `body.mashup_company_id` | `integer` | yes | The CANONICAL company id (`mashup_companies`), not a `cb_company_extensions` / ABM overlay id. The two are different tables with different ids and passing the wrong one attaches the deal to nothing. |
|
|
1850
|
+
|
|
1851
|
+
**Returns** `ApiResponse_DealOpResponse_`: the envelope `{ data: DealOpResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1852
|
+
|
|
1853
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1854
|
+
|
|
1855
|
+
**Example**
|
|
1856
|
+
|
|
1857
|
+
```ts
|
|
1858
|
+
const result = await g8.api.deals.setDealCompany({ path: { deal_id: "id" }, body: { mashup_company_id: 123 } });
|
|
1859
|
+
```
|
|
1860
|
+
|
|
1861
|
+
---
|
|
1862
|
+
|
|
1863
|
+
<a id="op-setdealcontactrole"></a>
|
|
1864
|
+
|
|
1865
|
+
### `g8.api.deals.setDealContactRole(input)`
|
|
1866
|
+
|
|
1867
|
+
**Set Deal Contact Role**
|
|
1868
|
+
|
|
1869
|
+
- HTTP: `PUT /api/v1/deals/{deal_id}/contacts/{contact_id}`
|
|
1870
|
+
- operationId: `set_deal_contact_role_deals__deal_id__contacts__contact_id__put` (also callable as `g8.api.call("set_deal_contact_role_deals__deal_id__contacts__contact_id__put", input)`)
|
|
1871
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
1872
|
+
- API-key scope: `deals:write`
|
|
1873
|
+
|
|
1874
|
+
Set (or clear) a contact's buying-committee role on a deal.
|
|
1875
|
+
|
|
1876
|
+
The role lives on the deal-contact LINK (`cb_deal_contacts.role`), not on
|
|
1877
|
+
the contact: the same person can be a champion on one deal and an end user
|
|
1878
|
+
on another. This endpoint only re-roles an EXISTING link — it never
|
|
1879
|
+
creates one, so attaching and roling stay separately auditable. Use
|
|
1880
|
+
``PATCH /deals/{deal_id}`` with ``add_contact_ids`` (optionally alongside
|
|
1881
|
+
``contact_roles``) to link a contact first.
|
|
1882
|
+
|
|
1883
|
+
``{contact_id}`` is the ``mashup_contact_id``, the same integer id this API
|
|
1884
|
+
uses for a contact everywhere else (``GET /contacts/{id}``, the ``id`` on
|
|
1885
|
+
every ``ContactBrief``). The internal app route calls the identical value
|
|
1886
|
+
``{person_id}``; that name is a historical misnomer and is not repeated
|
|
1887
|
+
here.
|
|
1888
|
+
|
|
1889
|
+
Body is ``{"role": "champion"}``; an explicit ``{"role": null}`` clears the
|
|
1890
|
+
role. ``role`` is required — an empty body is a 422, because a PUT that
|
|
1891
|
+
names no new state for the sub-resource is a caller bug, and reading
|
|
1892
|
+
omission as "clear" would destroy data on a typo.
|
|
1893
|
+
|
|
1894
|
+
Returns the updated contact. 404 when the deal does not exist in this org
|
|
1895
|
+
or the contact is not linked to it; 422 on a role outside the vocabulary.
|
|
1896
|
+
|
|
1897
|
+
**Input**
|
|
1898
|
+
|
|
1899
|
+
| Field | Type | Required | Description |
|
|
1900
|
+
|---|---|---|---|
|
|
1901
|
+
| `path.deal_id` | `string` | yes | Deal ID (UUID) |
|
|
1902
|
+
| `path.contact_id` | `integer` | yes | mashup_contact_id (BigInt) of a contact already linked to this deal |
|
|
1903
|
+
| `body` | `DealContactRoleUpdateRequest` | yes | Request body; fields below. |
|
|
1904
|
+
|
|
1905
|
+
Body fields (`DealContactRoleUpdateRequest`):
|
|
1906
|
+
|
|
1907
|
+
| Field | Type | Required | Description |
|
|
1908
|
+
|---|---|---|---|
|
|
1909
|
+
| `body.role` | `string \| null` | yes | Buying-committee role for this contact on this deal. One of: champion, decision_maker, influencer, blocker, coach, end_user. Pass null to clear the role. |
|
|
1910
|
+
|
|
1911
|
+
**Returns** `ApiResponse_ContactBrief_`: the envelope `{ data: ContactBrief, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1912
|
+
|
|
1913
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1914
|
+
|
|
1915
|
+
`ContactBrief` fields:
|
|
1916
|
+
|
|
1917
|
+
| Field | Type | Required | Description |
|
|
1918
|
+
|---|---|---|---|
|
|
1919
|
+
| `id` | `integer` | yes | |
|
|
1920
|
+
| `email` | `string \| null` | no | |
|
|
1921
|
+
| `name` | `string \| null` | no | |
|
|
1922
|
+
| `role` | `string \| null` | no | |
|
|
1923
|
+
| `title` | `string \| null` | no | |
|
|
1924
|
+
|
|
1925
|
+
**Example**
|
|
1926
|
+
|
|
1927
|
+
```ts
|
|
1928
|
+
const result = await g8.api.deals.setDealContactRole({
|
|
1929
|
+
path: { deal_id: "id", contact_id: 123 },
|
|
1930
|
+
body: { role: "example" },
|
|
1931
|
+
});
|
|
1932
|
+
```
|
|
1933
|
+
|
|
1934
|
+
---
|
|
1935
|
+
|
|
1936
|
+
<a id="op-setprimarydealcontact"></a>
|
|
1937
|
+
|
|
1938
|
+
### `g8.api.deals.setPrimaryDealContact(input)`
|
|
1939
|
+
|
|
1940
|
+
**Set Primary Deal Contact**
|
|
1941
|
+
|
|
1942
|
+
- HTTP: `PUT /api/v1/deals/{deal_id}/contacts/{person_id}/primary`
|
|
1943
|
+
- operationId: `set_primary_deal_contact_deals__deal_id__contacts__person_id__primary_put` (also callable as `g8.api.call("set_primary_deal_contact_deals__deal_id__contacts__person_id__primary_put", input)`)
|
|
1944
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
1945
|
+
- API-key scope: `deals:write`
|
|
1946
|
+
|
|
1947
|
+
Make this person the deal's primary contact.
|
|
1948
|
+
|
|
1949
|
+
A deal has ONE primary, so this demotes whoever held it - there is no
|
|
1950
|
+
separate call to unset the previous one.
|
|
1951
|
+
|
|
1952
|
+
**Input**
|
|
1953
|
+
|
|
1954
|
+
| Field | Type | Required | Description |
|
|
1955
|
+
|---|---|---|---|
|
|
1956
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
1957
|
+
| `path.person_id` | `string` | yes | Contact id to make primary. |
|
|
1958
|
+
|
|
1959
|
+
**Returns** `ApiResponse_DealContact_`: the envelope `{ data: DealContact, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1960
|
+
|
|
1961
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1962
|
+
|
|
1963
|
+
`DealContact` fields:
|
|
1964
|
+
|
|
1965
|
+
| Field | Type | Required | Description |
|
|
1966
|
+
|---|---|---|---|
|
|
1967
|
+
| `buying_role` | `string \| null` | no | General buying role from the contact record. |
|
|
1968
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
1969
|
+
| `email` | `string \| null` | no | |
|
|
1970
|
+
| `id` | `string \| null` | no | Link id, not the person id. |
|
|
1971
|
+
| `is_primary` | `boolean \| null` | no | |
|
|
1972
|
+
| `name` | `string \| null` | no | |
|
|
1973
|
+
| `person_id` | `string \| null` | no | |
|
|
1974
|
+
| `role` | `string \| null` | no | Role on THIS deal. |
|
|
1975
|
+
| `title` | `string \| null` | no | |
|
|
1976
|
+
|
|
1977
|
+
**Example**
|
|
1978
|
+
|
|
1979
|
+
```ts
|
|
1980
|
+
const result = await g8.api.deals.setPrimaryDealContact({ path: { deal_id: "id", person_id: "id" } });
|
|
1981
|
+
```
|
|
1982
|
+
|
|
1983
|
+
---
|
|
1984
|
+
|
|
1985
|
+
<a id="op-setrivalattach"></a>
|
|
1986
|
+
|
|
1987
|
+
### `g8.api.deals.setRivalAttach(input)`
|
|
1988
|
+
|
|
1989
|
+
**Set Rival Attach**
|
|
1990
|
+
|
|
1991
|
+
- HTTP: `POST /api/v1/deals/{deal_id}/rival-attach`
|
|
1992
|
+
- operationId: `set_rival_attach_deals__deal_id__rival_attach_post` (also callable as `g8.api.call("set_rival_attach_deals__deal_id__rival_attach_post", input)`)
|
|
1993
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
1994
|
+
- API-key scope: `deals:write`
|
|
1995
|
+
|
|
1996
|
+
Record which competitor is on this deal, and how it is going.
|
|
1997
|
+
|
|
1998
|
+
A null `competitor_id` DETACHES the current one - the same route both
|
|
1999
|
+
attaches and clears.
|
|
2000
|
+
|
|
2001
|
+
**Input**
|
|
2002
|
+
|
|
2003
|
+
| Field | Type | Required | Description |
|
|
2004
|
+
|---|---|---|---|
|
|
2005
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
2006
|
+
| `body` | `RivalAttachRequest` | yes | Request body; fields below. |
|
|
2007
|
+
|
|
2008
|
+
Body fields (`RivalAttachRequest`):
|
|
2009
|
+
|
|
2010
|
+
| Field | Type | Required | Description |
|
|
2011
|
+
|---|---|---|---|
|
|
2012
|
+
| `body.status` | `string` | yes | Where the deal stands against them. |
|
|
2013
|
+
| `body.competitor_id` | `string \| null` | no | The competitor. Null detaches the current one. |
|
|
2014
|
+
|
|
2015
|
+
**Returns** `ApiResponse_DealPayload_`: the envelope `{ data: DealPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
2016
|
+
|
|
2017
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
2018
|
+
|
|
2019
|
+
**Example**
|
|
2020
|
+
|
|
2021
|
+
```ts
|
|
2022
|
+
const result = await g8.api.deals.setRivalAttach({ path: { deal_id: "id" }, body: { status: "example" } });
|
|
2023
|
+
```
|
|
2024
|
+
|
|
2025
|
+
---
|
|
2026
|
+
|
|
2027
|
+
<a id="op-updatedeal"></a>
|
|
2028
|
+
|
|
2029
|
+
### `g8.api.deals.updateDeal(input)`
|
|
2030
|
+
|
|
2031
|
+
**Update Deal**
|
|
2032
|
+
|
|
2033
|
+
- HTTP: `PATCH /api/v1/deals/{deal_id}`
|
|
2034
|
+
- operationId: `update_deal_deals__deal_id__patch` (also callable as `g8.api.call("update_deal_deals__deal_id__patch", input)`)
|
|
2035
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
2036
|
+
- API-key scope: `deals:write`
|
|
2037
|
+
- ★ Hand-written: [`g8.deals.update()`](../sdk-clients.md#g8-deals-update)
|
|
2038
|
+
|
|
2039
|
+
Update a deal (partial update).
|
|
2040
|
+
|
|
2041
|
+
Contact operations run in a fixed order within the single transaction:
|
|
2042
|
+
``remove_contact_ids`` -> ``add_contact_ids`` -> ``contact_roles``. That
|
|
2043
|
+
order is what makes the useful combinations work:
|
|
2044
|
+
|
|
2045
|
+
* a contact linked by ``add_contact_ids`` in THIS request can be given a
|
|
2046
|
+
role by ``contact_roles`` in the same call (roles run last);
|
|
2047
|
+
* an id in both ``remove_contact_ids`` and ``add_contact_ids`` ends up
|
|
2048
|
+
linked (add runs after remove), so a role for it still applies;
|
|
2049
|
+
* an id in ``remove_contact_ids`` and ``contact_roles`` but NOT in
|
|
2050
|
+
``add_contact_ids`` is unlinked by the time roles run, so it is a 422
|
|
2051
|
+
naming that id rather than a role written to a row that no longer
|
|
2052
|
+
exists.
|
|
2053
|
+
|
|
2054
|
+
A ``contact_roles`` entry for a contact that is neither already linked nor
|
|
2055
|
+
being added is a 422; the whole transaction rolls back, so a partially
|
|
2056
|
+
applied batch is not a state this endpoint can produce.
|
|
2057
|
+
|
|
2058
|
+
``background_tasks`` carries the ``deal.stage_changed`` fan-out only. It is
|
|
2059
|
+
injected, not a body field, so it does not appear in the OpenAPI schema and
|
|
2060
|
+
the request contract is unchanged (pinned by
|
|
2061
|
+
``developer_api/tests/test_deal_stage_events.py``). Publishing there rather
|
|
2062
|
+
than inline keeps the Redis round trip off the caller's latency budget and
|
|
2063
|
+
makes "strictly after the commit" structural: the task is queued only after
|
|
2064
|
+
the session context has exited, and FastAPI attaches background tasks to the
|
|
2065
|
+
SUCCESS response, so a raise anywhere above publishes nothing.
|
|
2066
|
+
|
|
2067
|
+
**Input**
|
|
2068
|
+
|
|
2069
|
+
| Field | Type | Required | Description |
|
|
2070
|
+
|---|---|---|---|
|
|
2071
|
+
| `path.deal_id` | `string` | yes | Deal ID (UUID) |
|
|
2072
|
+
| `body` | `DealUpdateRequest` | yes | Request body; fields below. |
|
|
2073
|
+
|
|
2074
|
+
Body fields (`DealUpdateRequest`):
|
|
2075
|
+
|
|
2076
|
+
| Field | Type | Required | Description |
|
|
2077
|
+
|---|---|---|---|
|
|
2078
|
+
| `body.add_contact_ids` | `Array<integer>` | no | mashup_contact_ids to add to the deal (must match the deal's company; idempotent) |
|
|
2079
|
+
| `body.amount` | `number \| null` | no | Deal monetary value |
|
|
2080
|
+
| `body.close_date` | `string \| null` | no | Expected close date (ISO 8601) |
|
|
2081
|
+
| `body.contact_roles` | `Record<string, string \| null> \| null` | no | Buying-committee roles keyed by mashup_contact_id, e.g. {"5500429": "champion", "5500914": null}. Valid roles: champion, decision_maker, influencer, blocker, coach, end_user. null clears a role. Each id must already be linked to the deal or be present in add_contact_ids in the same request (422 otherwise). |
|
|
2082
|
+
| `body.currency` | `string \| null` | no | Currency code |
|
|
2083
|
+
| `body.description` | `string \| null` | no | Deal description |
|
|
2084
|
+
| `body.expected_revision` | `integer \| null` | no | Apply only if the canonical CRM revision still matches; otherwise return 409. Omit for existing PATCH behavior. min 1 |
|
|
2085
|
+
| `body.name` | `string \| null` | no | Deal name |
|
|
2086
|
+
| `body.owner_id` | `string \| null` | no | Reassign deal owner (member id, email, or PropelAuth uid). Cannot be cleared. |
|
|
2087
|
+
| `body.remove_contact_ids` | `Array<integer>` | no | mashup_contact_ids to remove from the deal (idempotent — unlinked skipped) |
|
|
2088
|
+
| `body.stage_id` | `string \| null` | no | Stage ID |
|
|
2089
|
+
|
|
2090
|
+
**Returns** `ApiResponse_DealResponse_`: the envelope `{ data: DealResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
2091
|
+
|
|
2092
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
2093
|
+
|
|
2094
|
+
`DealResponse` fields:
|
|
2095
|
+
|
|
2096
|
+
| Field | Type | Required | Description |
|
|
2097
|
+
|---|---|---|---|
|
|
2098
|
+
| `amount` | `number \| null` | no | |
|
|
2099
|
+
| `close_date` | `string \| null` | no | |
|
|
2100
|
+
| `closed_lost_reason` | `string \| null` | no | |
|
|
2101
|
+
| `company_id` | `unknown \| null` | no | |
|
|
2102
|
+
| `contact_count` | `integer` | no | default `0` |
|
|
2103
|
+
| `contacts` | `Array<ContactBrief> \| null` | no | |
|
|
2104
|
+
| `created_at` | `string \| null` | no | |
|
|
2105
|
+
| `currency` | `string \| null` | no | |
|
|
2106
|
+
| `description` | `string \| null` | no | |
|
|
2107
|
+
| `id` | `string \| null` | no | |
|
|
2108
|
+
| `last_activity_at` | `string \| null` | no | |
|
|
2109
|
+
| `name` | `string \| null` | no | |
|
|
2110
|
+
| `owner_email` | `string \| null` | no | |
|
|
2111
|
+
| `owner_id` | `string \| null` | no | |
|
|
2112
|
+
| `owner_name` | `string \| null` | no | |
|
|
2113
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
2114
|
+
| `pipeline_name` | `string \| null` | no | |
|
|
2115
|
+
| `primary_contact` | `ContactBrief \| null` | no | |
|
|
2116
|
+
| `revision` | `integer \| null` | no | CRM revision after a conditional update |
|
|
2117
|
+
| `stage_id` | `string \| null` | no | |
|
|
2118
|
+
| `stage_name` | `string \| null` | no | |
|
|
2119
|
+
| `updated_at` | `string \| null` | no | |
|
|
2120
|
+
|
|
2121
|
+
**Example**
|
|
2122
|
+
|
|
2123
|
+
```ts
|
|
2124
|
+
const result = await g8.api.deals.updateDeal({ path: { deal_id: "id" }, body: {} });
|
|
2125
|
+
```
|
|
2126
|
+
|
|
2127
|
+
---
|
|
2128
|
+
|
|
2129
|
+
<a id="op-updatedealdocument"></a>
|
|
2130
|
+
|
|
2131
|
+
### `g8.api.deals.updateDealDocument(input)`
|
|
2132
|
+
|
|
2133
|
+
**Update Deal Document**
|
|
2134
|
+
|
|
2135
|
+
- HTTP: `PUT /api/v1/deals/{deal_id}/documents/{document_id}`
|
|
2136
|
+
- operationId: `update_deal_document_deals__deal_id__documents__document_id__put` (also callable as `g8.api.call("update_deal_document_deals__deal_id__documents__document_id__put", input)`)
|
|
2137
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
2138
|
+
- API-key scope: `deals:write`
|
|
2139
|
+
|
|
2140
|
+
Edit a generated document by hand.
|
|
2141
|
+
|
|
2142
|
+
Keyed by document ID, not by type - this is the one place the two
|
|
2143
|
+
identifier spaces differ, and it is why the type-keyed routes live under
|
|
2144
|
+
`/documents/types/`.
|
|
2145
|
+
|
|
2146
|
+
An omitted field is left alone; `structured_data` REPLACES the stored
|
|
2147
|
+
object rather than merging into it. A later regeneration OVERWRITES the
|
|
2148
|
+
edit, so edit last.
|
|
2149
|
+
|
|
2150
|
+
**Input**
|
|
2151
|
+
|
|
2152
|
+
| Field | Type | Required | Description |
|
|
2153
|
+
|---|---|---|---|
|
|
2154
|
+
| `path.deal_id` | `string` | yes | Deal id (UUID). |
|
|
2155
|
+
| `path.document_id` | `string` | yes | Document id, from the list read. |
|
|
2156
|
+
| `body` | `DealDocumentUpdateRequest` | yes | Request body; fields below. |
|
|
2157
|
+
|
|
2158
|
+
Body fields (`DealDocumentUpdateRequest`):
|
|
2159
|
+
|
|
2160
|
+
| Field | Type | Required | Description |
|
|
2161
|
+
|---|---|---|---|
|
|
2162
|
+
| `body.content` | `string \| null` | no | The document body. |
|
|
2163
|
+
| `body.structured_data` | `Record<string, unknown> \| null` | no | The machine-readable half. Replaces, does not merge. |
|
|
2164
|
+
|
|
2165
|
+
**Returns** `ApiResponse_DocumentPayload_`: the envelope `{ data: DocumentPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
2166
|
+
|
|
2167
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
2168
|
+
|
|
2169
|
+
**Example**
|
|
2170
|
+
|
|
2171
|
+
```ts
|
|
2172
|
+
const result = await g8.api.deals.updateDealDocument({ path: { deal_id: "id", document_id: "id" }, body: {} });
|
|
2173
|
+
```
|
|
2174
|
+
|
|
2175
|
+
---
|
|
2176
|
+
|
|
2177
|
+
<a id="op-updatedealnote"></a>
|
|
2178
|
+
|
|
2179
|
+
### `g8.api.deals.updateDealNote(input)`
|
|
2180
|
+
|
|
2181
|
+
**Update Deal Note**
|
|
2182
|
+
|
|
2183
|
+
- HTTP: `PUT /api/v1/deals/{deal_id}/notes/{note_id}`
|
|
2184
|
+
- operationId: `update_deal_note_deals__deal_id__notes__note_id__put` (also callable as `g8.api.call("update_deal_note_deals__deal_id__notes__note_id__put", input)`)
|
|
2185
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
2186
|
+
- API-key scope: `deals:write`
|
|
2187
|
+
|
|
2188
|
+
Rewrite a note.
|
|
2189
|
+
|
|
2190
|
+
`content` is a full REPLACEMENT, not a patch, and `mentioned_users` is who
|
|
2191
|
+
is mentioned AFTER the edit - omitting someone removes their mention. Send
|
|
2192
|
+
the whole state you want, not the delta.
|
|
2193
|
+
|
|
2194
|
+
**Input**
|
|
2195
|
+
|
|
2196
|
+
| Field | Type | Required | Description |
|
|
2197
|
+
|---|---|---|---|
|
|
2198
|
+
| `path.deal_id` | `string` | yes | Deal id. |
|
|
2199
|
+
| `path.note_id` | `string` | yes | Note id. |
|
|
2200
|
+
| `body` | `DealNoteUpdateRequest` | yes | Request body; fields below. |
|
|
2201
|
+
|
|
2202
|
+
Body fields (`DealNoteUpdateRequest`):
|
|
2203
|
+
|
|
2204
|
+
| Field | Type | Required | Description |
|
|
2205
|
+
|---|---|---|---|
|
|
2206
|
+
| `body.content` | `string` | yes | Full replacement body - this is not a patch. |
|
|
2207
|
+
| `body.mentioned_users` | `Array<DealNoteMention>` | no | Who is mentioned AFTER the edit. Omitting someone removes their mention, because the list replaces rather than adds. |
|
|
2208
|
+
|
|
2209
|
+
**Returns** `ApiResponse_DealOpResponse_`: the envelope `{ data: DealOpResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
2210
|
+
|
|
2211
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
2212
|
+
|
|
2213
|
+
**Example**
|
|
2214
|
+
|
|
2215
|
+
```ts
|
|
2216
|
+
const result = await g8.api.deals.updateDealNote({
|
|
2217
|
+
path: { deal_id: "id", note_id: "id" },
|
|
2218
|
+
body: { content: "example" },
|
|
2219
|
+
});
|
|
2220
|
+
```
|
|
2221
|
+
|
|
2222
|
+
---
|
|
2223
|
+
|
|
2224
|
+
<a id="op-upsertdealcustomfielddiconfig"></a>
|
|
2225
|
+
|
|
2226
|
+
### `g8.api.deals.upsertDealCustomFieldDiConfig(input)`
|
|
2227
|
+
|
|
2228
|
+
**Upsert Deal Custom Field Di Config**
|
|
2229
|
+
|
|
2230
|
+
- HTTP: `POST /api/v1/deals/custom-fields/di-config`
|
|
2231
|
+
- operationId: `upsert_deal_custom_field_di_config_deals_custom_fields_di_config_post` (also callable as `g8.api.call("upsert_deal_custom_field_di_config_deals_custom_fields_di_config_post", input)`)
|
|
2232
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
2233
|
+
- API-key scope: `deals:write`
|
|
2234
|
+
|
|
2235
|
+
Replace the deal custom-field mappings.
|
|
2236
|
+
|
|
2237
|
+
ENTRY GATE: manager tier (DEALS_WRITE_TEAM / DEALS_WRITE_ALL /
|
|
2238
|
+
DEALS_MANAGE), the SAME route dependency the app declares - the values here
|
|
2239
|
+
are interpolated into the Deal Intelligence LLM prompt, so an own-scope rep
|
|
2240
|
+
must not be able to poison org-wide DI. The coarse `deals:write` scope does
|
|
2241
|
+
not distinguish own/team/all/manage, so this RBAC gate is what stops a
|
|
2242
|
+
rep-minted key reaching a manager-only surface.
|
|
2243
|
+
|
|
2244
|
+
`items` is the FULL desired set for the providers it names, not a delta -
|
|
2245
|
+
the app upserts exactly what is sent. The READ half of this pair shipped in
|
|
2246
|
+
#20744; this completes it.
|
|
2247
|
+
|
|
2248
|
+
**Input**
|
|
2249
|
+
|
|
2250
|
+
| Field | Type | Required | Description |
|
|
2251
|
+
|---|---|---|---|
|
|
2252
|
+
| `body` | `CustomFieldDiConfigUpsertRequest` | yes | Request body; fields below. |
|
|
2253
|
+
|
|
2254
|
+
Body fields (`CustomFieldDiConfigUpsertRequest`):
|
|
2255
|
+
|
|
2256
|
+
| Field | Type | Required | Description |
|
|
2257
|
+
|---|---|---|---|
|
|
2258
|
+
| `body.items` | `Array<CustomFieldDiConfigItem>` | yes | min items 1, max items 100 |
|
|
2259
|
+
|
|
2260
|
+
**Returns** `ApiResponse_DealOpResponse_`: the envelope `{ data: DealOpResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
2261
|
+
|
|
2262
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
2263
|
+
|
|
2264
|
+
**Example**
|
|
2265
|
+
|
|
2266
|
+
```ts
|
|
2267
|
+
const result = await g8.api.deals.upsertDealCustomFieldDiConfig({ body: { items: [{ crm_provider: "example", field_id: "id" }] } });
|
|
2268
|
+
```
|
|
2269
|
+
|
|
2270
|
+
---
|
|
2271
|
+
|
|
2272
|
+
## Referenced types
|
|
2273
|
+
|
|
2274
|
+
Named types that appear in the tables above. Full TypeScript definitions: `G8Contract.<Name>` (`import type { G8Contract } from "@graph8/sdk"`).
|
|
2275
|
+
|
|
2276
|
+
<a id="type-bulkdealchange"></a>
|
|
2277
|
+
|
|
2278
|
+
### `BulkDealChange`
|
|
2279
|
+
|
|
2280
|
+
The change applied to EVERY deal in the batch. PUT semantics, and the distinction matters: `null` leaves a value alone, an EMPTY STRING clears it. So omitting a field and sending `""` are different instructions, and the second one is destructive.
|
|
2281
|
+
|
|
2282
|
+
| Field | Type | Required | Description |
|
|
2283
|
+
|---|---|---|---|
|
|
2284
|
+
| `amount` | `number \| null` | no | |
|
|
2285
|
+
| `close_date` | `string (date-time) \| null` | no | |
|
|
2286
|
+
| `currency` | `string \| null` | no | |
|
|
2287
|
+
| `custom_fields` | `Record<string, unknown> \| null` | no | |
|
|
2288
|
+
| `description` | `string \| null` | no | |
|
|
2289
|
+
| `next_step` | `string \| null` | no | |
|
|
2290
|
+
| `owner_id` | `string \| null` | no | |
|
|
2291
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
2292
|
+
| `stage` | `string \| null` | no | |
|
|
2293
|
+
| `stage_id` | `string \| null` | no | |
|
|
2294
|
+
|
|
2295
|
+
<a id="type-customfielddiconfigitem"></a>
|
|
2296
|
+
|
|
2297
|
+
### `CustomFieldDiConfigItem`
|
|
2298
|
+
|
|
2299
|
+
One custom-field mapping. Typed rather than left an open dict: `crm_provider` and `field_id` are REQUIRED upstream, and an open list let a missing one reach the app's model as a raw ValidationError from inside the proxy - a 500 for a plain client error. The 255 caps are the underlying VARCHAR widths, and `display_name` additionally feeds the Deal Intelligence LLM prompt, so its bound is a token-budget and prompt-injection concern rather than cosmetic.
|
|
2300
|
+
|
|
2301
|
+
| Field | Type | Required | Description |
|
|
2302
|
+
|---|---|---|---|
|
|
2303
|
+
| `crm_provider` | `string` | yes | salesforce, hubspot or pipedrive. |
|
|
2304
|
+
| `field_id` | `string` | yes | The CRM's own field id. max length 255 |
|
|
2305
|
+
| `display_name` | `string \| null` | no | max length 255 |
|
|
2306
|
+
| `id` | `string \| null` | no | |
|
|
2307
|
+
| `include_in_di_summary` | `boolean` | no | default `false` |
|
|
2308
|
+
| `include_in_forecast_probability` | `boolean` | no | default `false` |
|
|
2309
|
+
|
|
2310
|
+
<a id="type-dealfieldoverride"></a>
|
|
2311
|
+
|
|
2312
|
+
### `DealFieldOverride`
|
|
2313
|
+
|
|
2314
|
+
Which side of the merge wins one field. Without an override the app picks per its own rules. Name a field here to decide it yourself - the only way to keep a value from the deal that is being merged AWAY.
|
|
2315
|
+
|
|
2316
|
+
| Field | Type | Required | Description |
|
|
2317
|
+
|---|---|---|---|
|
|
2318
|
+
| `field` | `string` | yes | |
|
|
2319
|
+
| `winner` | `"primary" \| "secondary"` | yes | |
|
|
2320
|
+
|
|
2321
|
+
<a id="type-deallineitemrecord"></a>
|
|
2322
|
+
|
|
2323
|
+
### `DealLineItemRecord`
|
|
2324
|
+
|
|
2325
|
+
A deal line item. Money fields are in cents.
|
|
2326
|
+
|
|
2327
|
+
| Field | Type | Required | Description |
|
|
2328
|
+
|---|---|---|---|
|
|
2329
|
+
| `discount_pct` | `number` | yes | |
|
|
2330
|
+
| `id` | `string` | yes | |
|
|
2331
|
+
| `line_total` | `integer` | yes | |
|
|
2332
|
+
| `product_name` | `string` | yes | |
|
|
2333
|
+
| `quantity` | `integer` | yes | |
|
|
2334
|
+
| `sort_order` | `integer` | yes | |
|
|
2335
|
+
| `unit_amount` | `integer` | yes | |
|
|
2336
|
+
| `billing_frequency` | `string \| null` | no | |
|
|
2337
|
+
| `description` | `string \| null` | no | |
|
|
2338
|
+
| `manual_product_id` | `string \| null` | no | |
|
|
2339
|
+
| `stripe_price_id` | `string \| null` | no | |
|
|
2340
|
+
| `stripe_product_id` | `string \| null` | no | |
|
|
2341
|
+
|
|
2342
|
+
<a id="type-deallineitemwrite"></a>
|
|
2343
|
+
|
|
2344
|
+
### `DealLineItemWrite`
|
|
2345
|
+
|
|
2346
|
+
One line item in a replace request. Money is in CENTS. `line_total` is not accepted: the server recomputes it from `unit_amount`, `quantity` and `discount_pct`.
|
|
2347
|
+
|
|
2348
|
+
| Field | Type | Required | Description |
|
|
2349
|
+
|---|---|---|---|
|
|
2350
|
+
| `product_name` | `string` | yes | min length 1, max length 500 |
|
|
2351
|
+
| `unit_amount` | `integer` | yes | Unit price in cents. min 0, max 1000000000 |
|
|
2352
|
+
| `billing_frequency` | `string \| null` | no | max length 50 |
|
|
2353
|
+
| `description` | `string \| null` | no | max length 2000 |
|
|
2354
|
+
| `discount_pct` | `number` | no | default `0`, min 0, max 100 |
|
|
2355
|
+
| `manual_product_id` | `string \| null` | no | Id of a manually-defined product. |
|
|
2356
|
+
| `quantity` | `integer` | no | default `1`, min 1, max 10000 |
|
|
2357
|
+
| `sort_order` | `integer` | no | default `0` |
|
|
2358
|
+
| `stripe_price_id` | `string \| null` | no | Catalog price id, when catalog-backed. |
|
|
2359
|
+
| `stripe_product_id` | `string \| null` | no | Catalog product id, when catalog-backed. |
|
|
2360
|
+
|
|
2361
|
+
<a id="type-dealnotemention"></a>
|
|
2362
|
+
|
|
2363
|
+
### `DealNoteMention`
|
|
2364
|
+
|
|
2365
|
+
| Field | Type | Required | Description |
|
|
2366
|
+
|---|---|---|---|
|
|
2367
|
+
| `id` | `string` | yes | |
|
|
2368
|
+
| `email` | `string \| null` | no | |
|
|
2369
|
+
| `name` | `string \| null` | no | |
|
|
2370
|
+
|
|
2371
|
+
<a id="type-dealstagevelocitybucket"></a>
|
|
2372
|
+
|
|
2373
|
+
### `DealStageVelocityBucket`
|
|
2374
|
+
|
|
2375
|
+
Movement through one stage. `avg_days_in_stage` and `conversion_rate` are null (not 0) when there is no sample: an average over zero completed dwells is undefined.
|
|
2376
|
+
|
|
2377
|
+
| Field | Type | Required | Description |
|
|
2378
|
+
|---|---|---|---|
|
|
2379
|
+
| `completed_dwells` | `integer` | yes | |
|
|
2380
|
+
| `entered_count` | `integer` | yes | |
|
|
2381
|
+
| `fell_back_count` | `integer` | yes | |
|
|
2382
|
+
| `position` | `integer` | yes | |
|
|
2383
|
+
| `progressed_count` | `integer` | yes | |
|
|
2384
|
+
| `stage_id` | `string` | yes | |
|
|
2385
|
+
| `stage_name` | `string` | yes | |
|
|
2386
|
+
| `still_in_stage_count` | `integer` | yes | |
|
|
2387
|
+
| `avg_days_in_stage` | `number \| null` | no | |
|
|
2388
|
+
| `conversion_rate` | `number \| null` | no | |
|
|
2389
|
+
|
|
2390
|
+
<a id="type-dealstagevelocitystucksummary"></a>
|
|
2391
|
+
|
|
2392
|
+
### `DealStageVelocityStuckSummary`
|
|
2393
|
+
|
|
2394
|
+
`total_count` is exact; `deals` is capped at 100 (`truncated` says so).
|
|
2395
|
+
|
|
2396
|
+
| Field | Type | Required | Description |
|
|
2397
|
+
|---|---|---|---|
|
|
2398
|
+
| `threshold_days` | `integer` | yes | |
|
|
2399
|
+
| `total_count` | `integer` | yes | |
|
|
2400
|
+
| `truncated` | `boolean` | yes | |
|
|
2401
|
+
| `deals` | `Array<DealStageVelocityStuckDeal>` | no | |
|
|
2402
|
+
|
|
2403
|
+
<a id="type-dealsummary"></a>
|
|
2404
|
+
|
|
2405
|
+
### `DealSummary`
|
|
2406
|
+
|
|
2407
|
+
One deal as it appears in a list.
|
|
2408
|
+
|
|
2409
|
+
| Field | Type | Required | Description |
|
|
2410
|
+
|---|---|---|---|
|
|
2411
|
+
| `amount` | `number \| null` | no | |
|
|
2412
|
+
| `close_date` | `string (date-time) \| null` | no | |
|
|
2413
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
2414
|
+
| `currency` | `string \| null` | no | |
|
|
2415
|
+
| `id` | `string \| null` | no | |
|
|
2416
|
+
| `name` | `string \| null` | no | |
|
|
2417
|
+
| `owner_id` | `string \| null` | no | |
|
|
2418
|
+
| `pipeline_id` | `string \| null` | no | |
|
|
2419
|
+
| `stage` | `string \| null` | no | |
|
|
2420
|
+
| `status` | `string \| null` | no | |
|
|
2421
|
+
|
|
2422
|
+
<a id="type-pipelinestageresponse"></a>
|
|
2423
|
+
|
|
2424
|
+
### `PipelineStageResponse`
|
|
2425
|
+
|
|
2426
|
+
| Field | Type | Required | Description |
|
|
2427
|
+
|---|---|---|---|
|
|
2428
|
+
| `id` | `string` | yes | |
|
|
2429
|
+
| `name` | `string` | yes | |
|
|
2430
|
+
| `channel_scripts` | `Record<string, string>` | no | |
|
|
2431
|
+
| `color` | `string \| null` | no | |
|
|
2432
|
+
| `position` | `integer \| null` | no | |
|
|
2433
|
+
| `probability` | `integer \| null` | no | |
|
|
2434
|
+
| `recommended_elements` | `Array<string>` | no | |
|
|
2435
|
+
| `required_elements` | `Array<string>` | no | |
|
|
2436
|
+
| `stage_type` | `string \| null` | no | |
|