@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,1098 @@
|
|
|
1
|
+
<!-- Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. -->
|
|
2
|
+
|
|
3
|
+
# `g8.api.objects`: Objects
|
|
4
|
+
|
|
5
|
+
18 operations (7 read, 8 write, 3 destructive).
|
|
6
|
+
|
|
7
|
+
18 of these also have a hand-written method (`g8.objects`), 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: [objects.d.ts](objects.d.ts).
|
|
20
|
+
|
|
21
|
+
## Operations
|
|
22
|
+
|
|
23
|
+
| Call | HTTP | Tier | Scope | Summary |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| [`archiveAttribute`](#op-archiveattribute) ★ | `DELETE /api/v1/objects/{object_slug}/attributes/{attr_slug}` | destructive | `objects:manage` | Archive Attribute |
|
|
26
|
+
| [`archiveObject`](#op-archiveobject) ★ | `DELETE /api/v1/objects/{object_slug}` | destructive | `objects:manage` | Archive Object |
|
|
27
|
+
| [`archiveObjectRecord`](#op-archiveobjectrecord) ★ | `DELETE /api/v1/objects/{object_slug}/records/{record_id}` | destructive | `objects:delete` | Archive Object Record |
|
|
28
|
+
| [`createAttribute`](#op-createattribute) ★ | `POST /api/v1/objects/{object_slug}/attributes` | write | `objects:manage` | Create Attribute |
|
|
29
|
+
| [`createObject`](#op-createobject) ★ | `POST /api/v1/objects` | write | `objects:manage` | Create Object |
|
|
30
|
+
| [`createObjectRecord`](#op-createobjectrecord) ★ | `POST /api/v1/objects/{object_slug}/records` | write | `objects:write` | Create Object Record |
|
|
31
|
+
| [`getObject`](#op-getobject) ★ | `GET /api/v1/objects/{object_slug}` | read | `objects:read` | Get Object |
|
|
32
|
+
| [`getObjectRecord`](#op-getobjectrecord) ★ | `GET /api/v1/objects/{object_slug}/records/{record_id}` | read | `objects:read` | Get Object Record |
|
|
33
|
+
| [`getObjectRecordChanges`](#op-getobjectrecordchanges) ★ | `GET /api/v1/objects/{object_slug}/records/{record_id}/changes` | read | `objects:read` | Get Object Record Changes |
|
|
34
|
+
| [`getObjectRecordHistory`](#op-getobjectrecordhistory) ★ | `GET /api/v1/objects/{object_slug}/records/{record_id}/history` | read | `objects:read` | Get Object Record History |
|
|
35
|
+
| [`listObjectAttributes`](#op-listobjectattributes) ★ | `GET /api/v1/objects/{object_slug}/attributes` | read | `objects:read` | List Object Attributes |
|
|
36
|
+
| [`listObjectRecords`](#op-listobjectrecords) ★ | `GET /api/v1/objects/{object_slug}/records` | read | `objects:read` | List Object Records |
|
|
37
|
+
| [`listObjects`](#op-listobjects) ★ | `GET /api/v1/objects` | read | `objects:read` | List Objects |
|
|
38
|
+
| [`restoreObjectRecord`](#op-restoreobjectrecord) ★ | `POST /api/v1/objects/{object_slug}/records/{record_id}/restore` | write | `objects:write` | Restore Object Record |
|
|
39
|
+
| [`updateAttribute`](#op-updateattribute) ★ | `PATCH /api/v1/objects/{object_slug}/attributes/{attr_slug}` | write | `objects:manage` | Update Attribute |
|
|
40
|
+
| [`updateObject`](#op-updateobject) ★ | `PATCH /api/v1/objects/{object_slug}` | write | `objects:manage` | Update Object |
|
|
41
|
+
| [`updateObjectRecord`](#op-updateobjectrecord) ★ | `PATCH /api/v1/objects/{object_slug}/records/{record_id}` | write | `objects:write` | Update Object Record |
|
|
42
|
+
| [`upsertObjectRecord`](#op-upsertobjectrecord) ★ | `POST /api/v1/objects/{object_slug}/records/upsert` | write | `objects:write` | Upsert Object Record |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<a id="op-archiveattribute"></a>
|
|
47
|
+
|
|
48
|
+
### `g8.api.objects.archiveAttribute(input)`
|
|
49
|
+
|
|
50
|
+
**Archive Attribute**
|
|
51
|
+
|
|
52
|
+
- HTTP: `DELETE /api/v1/objects/{object_slug}/attributes/{attr_slug}`
|
|
53
|
+
- operationId: `archive_attribute_objects__object_slug__attributes__attr_slug__delete` (also callable as `g8.api.call("archive_attribute_objects__object_slug__attributes__attr_slug__delete", input)`)
|
|
54
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
55
|
+
- API-key scope: `objects:manage`
|
|
56
|
+
- ★ Hand-written: [`g8.objects.archiveAttribute()`](../sdk-clients.md#g8-objects-archiveattribute)
|
|
57
|
+
|
|
58
|
+
Archive a custom field, retaining its values. Restore with PATCH is_archived=false.
|
|
59
|
+
|
|
60
|
+
**Input**
|
|
61
|
+
|
|
62
|
+
| Field | Type | Required | Description |
|
|
63
|
+
|---|---|---|---|
|
|
64
|
+
| `path.object_slug` | `string` | yes | |
|
|
65
|
+
| `path.attr_slug` | `string` | yes | |
|
|
66
|
+
|
|
67
|
+
**Returns** `ApiResponse_AttributeDefinitionResponse_`: the envelope `{ data: AttributeDefinitionResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
68
|
+
|
|
69
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
70
|
+
|
|
71
|
+
`AttributeDefinitionResponse` fields:
|
|
72
|
+
|
|
73
|
+
| Field | Type | Required | Description |
|
|
74
|
+
|---|---|---|---|
|
|
75
|
+
| `attribute_type` | `string` | yes | One of the 16 supported attribute types (`text`, `number`, `email_address`, `timestamp`, `select`, `record_reference`, …). Determines how values are validated and canonicalized. |
|
|
76
|
+
| `slug` | `string` | yes | Stable API slug for the attribute, used as a payload key. |
|
|
77
|
+
| `title` | `string` | yes | Customer-facing field label, distinct from its stable API slug. |
|
|
78
|
+
| `config` | `Record<string, unknown>` | no | Type-specific configuration, e.g. select options. Record references require target_object and must resolve to active records in that object within the caller's organization and app. |
|
|
79
|
+
| `default_value` | `unknown` | no | Configured create default. Enabled non-null defaults pass the same validation as explicit values. |
|
|
80
|
+
| `description` | `string \| null` | no | Customer-configured description of the field. |
|
|
81
|
+
| `is_archived` | `boolean` | no | Archived fields retain their values and can be restored. default `false` |
|
|
82
|
+
| `is_default_value_enabled` | `boolean` | no | Apply the configured default when this field is omitted on create. Never applies on PATCH. default `false` |
|
|
83
|
+
| `is_multiselect` | `boolean` | no | Values are a list rather than a scalar. default `false` |
|
|
84
|
+
| `is_required` | `boolean` | no | Required on create. PATCH may omit it, but cannot clear it with null or an empty multivalue list. default `false` |
|
|
85
|
+
| `is_system` | `boolean` | no | Whether this field is protected as a system attribute. default `false` |
|
|
86
|
+
| `is_unique` | `boolean` | no | No two active records may hold the same value for this attribute. A collision is rejected with `409 duplicate_active_value`. default `false` |
|
|
87
|
+
| `sort_order` | `integer` | no | Configured display order; equal values are ordered by API slug. default `0` |
|
|
88
|
+
|
|
89
|
+
**Example**
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
93
|
+
const result = await g8.api.objects.archiveAttribute({ path: { object_slug: "example", attr_slug: "example" } });
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
<a id="op-archiveobject"></a>
|
|
99
|
+
|
|
100
|
+
### `g8.api.objects.archiveObject(input)`
|
|
101
|
+
|
|
102
|
+
**Archive Object**
|
|
103
|
+
|
|
104
|
+
- HTTP: `DELETE /api/v1/objects/{object_slug}`
|
|
105
|
+
- operationId: `archive_object_objects__object_slug__delete` (also callable as `g8.api.call("archive_object_objects__object_slug__delete", input)`)
|
|
106
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
107
|
+
- API-key scope: `objects:manage`
|
|
108
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
109
|
+
- ★ Hand-written: [`g8.objects.archive()`](../sdk-clients.md#g8-objects-archive)
|
|
110
|
+
|
|
111
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
112
|
+
|
|
113
|
+
Archive a custom object without deleting data; restore with PATCH is_archived=false.
|
|
114
|
+
|
|
115
|
+
**Input**
|
|
116
|
+
|
|
117
|
+
| Field | Type | Required | Description |
|
|
118
|
+
|---|---|---|---|
|
|
119
|
+
| `path.object_slug` | `string` | yes | |
|
|
120
|
+
|
|
121
|
+
**Returns** `ApiResponse_ObjectDefinitionResponse_`: the envelope `{ data: ObjectDefinitionResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
122
|
+
|
|
123
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
124
|
+
|
|
125
|
+
`ObjectDefinitionResponse` fields:
|
|
126
|
+
|
|
127
|
+
| Field | Type | Required | Description |
|
|
128
|
+
|---|---|---|---|
|
|
129
|
+
| `plural_noun` | `string` | yes | Display name for many records, e.g. "Invoices". |
|
|
130
|
+
| `singular_noun` | `string` | yes | Display name for one record, e.g. "Invoice". |
|
|
131
|
+
| `slug` | `string` | yes | Stable API slug for the object type, e.g. `invoices`. |
|
|
132
|
+
| `description` | `string \| null` | no | Customer-configured object description. |
|
|
133
|
+
| `display_attribute_slug` | `string \| null` | no | Active single-value field used to label records; null uses the default. |
|
|
134
|
+
| `icon` | `string \| null` | no | Configured graph8 icon name; null uses the default. |
|
|
135
|
+
| `is_archived` | `boolean` | no | Archived objects are hidden from listings. default `false` |
|
|
136
|
+
| `is_system` | `boolean` | no | True for objects graph8 ships; system objects cannot be deleted. default `false` |
|
|
137
|
+
|
|
138
|
+
**Example**
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
142
|
+
const result = await g8.api.objects.archiveObject({ path: { object_slug: "example" } });
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
<a id="op-archiveobjectrecord"></a>
|
|
148
|
+
|
|
149
|
+
### `g8.api.objects.archiveObjectRecord(input)`
|
|
150
|
+
|
|
151
|
+
**Archive Object Record**
|
|
152
|
+
|
|
153
|
+
- HTTP: `DELETE /api/v1/objects/{object_slug}/records/{record_id}`
|
|
154
|
+
- operationId: `archive_object_record_objects__object_slug__records__record_id__delete` (also callable as `g8.api.call("archive_object_record_objects__object_slug__records__record_id__delete", input)`)
|
|
155
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
156
|
+
- API-key scope: `objects:delete`
|
|
157
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
158
|
+
- ★ Hand-written: [`g8.objects.archiveRecord()`](../sdk-clients.md#g8-objects-archiverecord)
|
|
159
|
+
|
|
160
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
161
|
+
|
|
162
|
+
Archive a record.
|
|
163
|
+
|
|
164
|
+
The record is hidden from listings but stays readable by id, and its history
|
|
165
|
+
and associations are preserved. Nothing is destroyed.
|
|
166
|
+
|
|
167
|
+
**Input**
|
|
168
|
+
|
|
169
|
+
| Field | Type | Required | Description |
|
|
170
|
+
|---|---|---|---|
|
|
171
|
+
| `path.object_slug` | `string` | yes | |
|
|
172
|
+
| `path.record_id` | `string` | yes | |
|
|
173
|
+
|
|
174
|
+
**Returns** `ApiResponse_ObjectRecordResponse_`: the envelope `{ data: ObjectRecordResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
175
|
+
|
|
176
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
177
|
+
|
|
178
|
+
`ObjectRecordResponse` fields:
|
|
179
|
+
|
|
180
|
+
| Field | Type | Required | Description |
|
|
181
|
+
|---|---|---|---|
|
|
182
|
+
| `id` | `string` | yes | Opaque record identifier. |
|
|
183
|
+
| `object_slug` | `string` | yes | The object type this record belongs to. |
|
|
184
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
185
|
+
| `is_archived` | `boolean` | no | Archived records are excluded from listings. default `false` |
|
|
186
|
+
| `revision` | `integer` | no | Record revision for conditional updates. default `1`, min 1 |
|
|
187
|
+
| `updated_at` | `string (date-time) \| null` | no | |
|
|
188
|
+
| `values` | `Record<string, unknown>` | no | Currently active values, keyed by attribute slug. Shapes follow each attribute's own type; call `GET /objects/{object_slug}/attributes` for the schema. |
|
|
189
|
+
|
|
190
|
+
**Example**
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
194
|
+
const result = await g8.api.objects.archiveObjectRecord({ path: { object_slug: "example", record_id: "id" } });
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
<a id="op-createattribute"></a>
|
|
200
|
+
|
|
201
|
+
### `g8.api.objects.createAttribute(input)`
|
|
202
|
+
|
|
203
|
+
**Create Attribute**
|
|
204
|
+
|
|
205
|
+
- HTTP: `POST /api/v1/objects/{object_slug}/attributes`
|
|
206
|
+
- operationId: `create_attribute_objects__object_slug__attributes_post` (also callable as `g8.api.call("create_attribute_objects__object_slug__attributes_post", input)`)
|
|
207
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
208
|
+
- API-key scope: `objects:manage`
|
|
209
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
210
|
+
- ★ Hand-written: [`g8.objects.createAttribute()`](../sdk-clients.md#g8-objects-createattribute)
|
|
211
|
+
|
|
212
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
213
|
+
|
|
214
|
+
Create a typed CRM field. Requires objects:manage and current Admin access.
|
|
215
|
+
|
|
216
|
+
**Input**
|
|
217
|
+
|
|
218
|
+
| Field | Type | Required | Description |
|
|
219
|
+
|---|---|---|---|
|
|
220
|
+
| `path.object_slug` | `string` | yes | |
|
|
221
|
+
| `body` | `AttributeCreateRequest` | yes | Request body; fields below. |
|
|
222
|
+
|
|
223
|
+
Body fields (`AttributeCreateRequest`):
|
|
224
|
+
|
|
225
|
+
| Field | Type | Required | Description |
|
|
226
|
+
|---|---|---|---|
|
|
227
|
+
| `body.attribute_type` | `AttributeType` | yes | |
|
|
228
|
+
| `body.slug` | `string` | yes | min length 1, max length 100, pattern `^[a-z][a-z0-9_]*$` |
|
|
229
|
+
| `body.title` | `string` | yes | min length 1, max length 200 |
|
|
230
|
+
| `body.config` | `AttributeConfig \| null` | no | |
|
|
231
|
+
| `body.default_value` | `unknown \| null` | no | |
|
|
232
|
+
| `body.description` | `string \| null` | no | |
|
|
233
|
+
| `body.is_default_value_enabled` | `boolean` | no | default `false` |
|
|
234
|
+
| `body.is_multiselect` | `boolean` | no | default `false` |
|
|
235
|
+
| `body.is_required` | `boolean` | no | default `false` |
|
|
236
|
+
| `body.is_unique` | `boolean` | no | default `false` |
|
|
237
|
+
| `body.sort_order` | `integer` | no | default `0` |
|
|
238
|
+
|
|
239
|
+
**Returns** `ApiResponse_AttributeDefinitionResponse_`: the envelope `{ data: AttributeDefinitionResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
240
|
+
|
|
241
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
242
|
+
|
|
243
|
+
`AttributeDefinitionResponse` fields:
|
|
244
|
+
|
|
245
|
+
| Field | Type | Required | Description |
|
|
246
|
+
|---|---|---|---|
|
|
247
|
+
| `attribute_type` | `string` | yes | One of the 16 supported attribute types (`text`, `number`, `email_address`, `timestamp`, `select`, `record_reference`, …). Determines how values are validated and canonicalized. |
|
|
248
|
+
| `slug` | `string` | yes | Stable API slug for the attribute, used as a payload key. |
|
|
249
|
+
| `title` | `string` | yes | Customer-facing field label, distinct from its stable API slug. |
|
|
250
|
+
| `config` | `Record<string, unknown>` | no | Type-specific configuration, e.g. select options. Record references require target_object and must resolve to active records in that object within the caller's organization and app. |
|
|
251
|
+
| `default_value` | `unknown` | no | Configured create default. Enabled non-null defaults pass the same validation as explicit values. |
|
|
252
|
+
| `description` | `string \| null` | no | Customer-configured description of the field. |
|
|
253
|
+
| `is_archived` | `boolean` | no | Archived fields retain their values and can be restored. default `false` |
|
|
254
|
+
| `is_default_value_enabled` | `boolean` | no | Apply the configured default when this field is omitted on create. Never applies on PATCH. default `false` |
|
|
255
|
+
| `is_multiselect` | `boolean` | no | Values are a list rather than a scalar. default `false` |
|
|
256
|
+
| `is_required` | `boolean` | no | Required on create. PATCH may omit it, but cannot clear it with null or an empty multivalue list. default `false` |
|
|
257
|
+
| `is_system` | `boolean` | no | Whether this field is protected as a system attribute. default `false` |
|
|
258
|
+
| `is_unique` | `boolean` | no | No two active records may hold the same value for this attribute. A collision is rejected with `409 duplicate_active_value`. default `false` |
|
|
259
|
+
| `sort_order` | `integer` | no | Configured display order; equal values are ordered by API slug. default `0` |
|
|
260
|
+
|
|
261
|
+
**Example**
|
|
262
|
+
|
|
263
|
+
```ts
|
|
264
|
+
const result = await g8.api.objects.createAttribute({
|
|
265
|
+
path: { object_slug: "example" },
|
|
266
|
+
body: { attribute_type: "text", slug: "example", title: "Example" },
|
|
267
|
+
});
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
<a id="op-createobject"></a>
|
|
273
|
+
|
|
274
|
+
### `g8.api.objects.createObject(input)`
|
|
275
|
+
|
|
276
|
+
**Create Object**
|
|
277
|
+
|
|
278
|
+
- HTTP: `POST /api/v1/objects`
|
|
279
|
+
- operationId: `create_object_objects_post` (also callable as `g8.api.call("create_object_objects_post", input)`)
|
|
280
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
281
|
+
- API-key scope: `objects:manage`
|
|
282
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
283
|
+
- ★ Hand-written: [`g8.objects.create()`](../sdk-clients.md#g8-objects-create)
|
|
284
|
+
|
|
285
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
286
|
+
|
|
287
|
+
Create a native custom object. Requires objects:manage and Admin access.
|
|
288
|
+
|
|
289
|
+
**Input**
|
|
290
|
+
|
|
291
|
+
| Field | Type | Required | Description |
|
|
292
|
+
|---|---|---|---|
|
|
293
|
+
| `body` | `ObjectCreateRequest` | yes | Request body; fields below. |
|
|
294
|
+
|
|
295
|
+
Body fields (`ObjectCreateRequest`):
|
|
296
|
+
|
|
297
|
+
| Field | Type | Required | Description |
|
|
298
|
+
|---|---|---|---|
|
|
299
|
+
| `body.plural_noun` | `string` | yes | min length 1, max length 100 |
|
|
300
|
+
| `body.singular_noun` | `string` | yes | min length 1, max length 100 |
|
|
301
|
+
| `body.slug` | `string` | yes | min length 1, max length 100, pattern `^[a-z][a-z0-9_]*$` |
|
|
302
|
+
| `body.description` | `string \| null` | no | max length 2000 |
|
|
303
|
+
| `body.icon` | `"box" \| "briefcase" \| "building" \| "calendar" \| "flag" \| "folder" \| "globe" \| "heart" \| … \| null` | no | |
|
|
304
|
+
|
|
305
|
+
**Returns** `ApiResponse_ObjectDefinitionResponse_`: the envelope `{ data: ObjectDefinitionResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
306
|
+
|
|
307
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
308
|
+
|
|
309
|
+
`ObjectDefinitionResponse` fields:
|
|
310
|
+
|
|
311
|
+
| Field | Type | Required | Description |
|
|
312
|
+
|---|---|---|---|
|
|
313
|
+
| `plural_noun` | `string` | yes | Display name for many records, e.g. "Invoices". |
|
|
314
|
+
| `singular_noun` | `string` | yes | Display name for one record, e.g. "Invoice". |
|
|
315
|
+
| `slug` | `string` | yes | Stable API slug for the object type, e.g. `invoices`. |
|
|
316
|
+
| `description` | `string \| null` | no | Customer-configured object description. |
|
|
317
|
+
| `display_attribute_slug` | `string \| null` | no | Active single-value field used to label records; null uses the default. |
|
|
318
|
+
| `icon` | `string \| null` | no | Configured graph8 icon name; null uses the default. |
|
|
319
|
+
| `is_archived` | `boolean` | no | Archived objects are hidden from listings. default `false` |
|
|
320
|
+
| `is_system` | `boolean` | no | True for objects graph8 ships; system objects cannot be deleted. default `false` |
|
|
321
|
+
|
|
322
|
+
**Example**
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
const result = await g8.api.objects.createObject({
|
|
326
|
+
body: { plural_noun: "example", singular_noun: "example", slug: "example" },
|
|
327
|
+
});
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
<a id="op-createobjectrecord"></a>
|
|
333
|
+
|
|
334
|
+
### `g8.api.objects.createObjectRecord(input)`
|
|
335
|
+
|
|
336
|
+
**Create Object Record**
|
|
337
|
+
|
|
338
|
+
- HTTP: `POST /api/v1/objects/{object_slug}/records`
|
|
339
|
+
- operationId: `create_object_record_objects__object_slug__records_post` (also callable as `g8.api.call("create_object_record_objects__object_slug__records_post", input)`)
|
|
340
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
341
|
+
- API-key scope: `objects:write`
|
|
342
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
343
|
+
- ★ Hand-written: [`g8.objects.createRecord()`](../sdk-clients.md#g8-objects-createrecord)
|
|
344
|
+
|
|
345
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
346
|
+
|
|
347
|
+
Create a record.
|
|
348
|
+
|
|
349
|
+
Every field is validated against the object's attribute definitions. Unknown
|
|
350
|
+
fields are rejected with 422 — they are not dropped — and the response lists
|
|
351
|
+
every problem at once so a client fixes them in one round trip. A collision on
|
|
352
|
+
a unique attribute returns 409.
|
|
353
|
+
|
|
354
|
+
**Input**
|
|
355
|
+
|
|
356
|
+
| Field | Type | Required | Description |
|
|
357
|
+
|---|---|---|---|
|
|
358
|
+
| `path.object_slug` | `string` | yes | |
|
|
359
|
+
| `body` | `RecordWriteRequest` | yes | Request body; fields below. |
|
|
360
|
+
|
|
361
|
+
Body fields (`RecordWriteRequest`):
|
|
362
|
+
|
|
363
|
+
| Field | Type | Required | Description |
|
|
364
|
+
|---|---|---|---|
|
|
365
|
+
| `body.values` | `Record<string, unknown>` | no | Attribute values keyed by slug. Call `GET /objects/{object_slug}/attributes` for active fields. Canonical contacts and companies retain CONTACT_*, COMPANY_* and udo_* field names. Unknown keys are rejected with 422. PATCH preserves omitted fields; required fields cannot be cleared with null or an empty multivalue list. Record references must resolve to active records of their configured target ob… |
|
|
366
|
+
|
|
367
|
+
**Returns** `ApiResponse_ObjectRecordResponse_`: the envelope `{ data: ObjectRecordResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
368
|
+
|
|
369
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
370
|
+
|
|
371
|
+
`ObjectRecordResponse` fields:
|
|
372
|
+
|
|
373
|
+
| Field | Type | Required | Description |
|
|
374
|
+
|---|---|---|---|
|
|
375
|
+
| `id` | `string` | yes | Opaque record identifier. |
|
|
376
|
+
| `object_slug` | `string` | yes | The object type this record belongs to. |
|
|
377
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
378
|
+
| `is_archived` | `boolean` | no | Archived records are excluded from listings. default `false` |
|
|
379
|
+
| `revision` | `integer` | no | Record revision for conditional updates. default `1`, min 1 |
|
|
380
|
+
| `updated_at` | `string (date-time) \| null` | no | |
|
|
381
|
+
| `values` | `Record<string, unknown>` | no | Currently active values, keyed by attribute slug. Shapes follow each attribute's own type; call `GET /objects/{object_slug}/attributes` for the schema. |
|
|
382
|
+
|
|
383
|
+
**Example**
|
|
384
|
+
|
|
385
|
+
```ts
|
|
386
|
+
const result = await g8.api.objects.createObjectRecord({ path: { object_slug: "example" }, body: {} });
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
<a id="op-getobject"></a>
|
|
392
|
+
|
|
393
|
+
### `g8.api.objects.getObject(input)`
|
|
394
|
+
|
|
395
|
+
**Get Object**
|
|
396
|
+
|
|
397
|
+
- HTTP: `GET /api/v1/objects/{object_slug}`
|
|
398
|
+
- operationId: `get_object_objects__object_slug__get` (also callable as `g8.api.call("get_object_objects__object_slug__get", input)`)
|
|
399
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
400
|
+
- API-key scope: `objects:read`
|
|
401
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
402
|
+
- ★ Hand-written: [`g8.objects.get()`](../sdk-clients.md#g8-objects-get)
|
|
403
|
+
|
|
404
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
405
|
+
|
|
406
|
+
Fetch one accessible registered standard or custom object type by its slug.
|
|
407
|
+
|
|
408
|
+
**Input**
|
|
409
|
+
|
|
410
|
+
| Field | Type | Required | Description |
|
|
411
|
+
|---|---|---|---|
|
|
412
|
+
| `path.object_slug` | `string` | yes | |
|
|
413
|
+
|
|
414
|
+
**Returns** `ApiResponse_ObjectDefinitionResponse_`: the envelope `{ data: ObjectDefinitionResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
415
|
+
|
|
416
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
417
|
+
|
|
418
|
+
`ObjectDefinitionResponse` fields:
|
|
419
|
+
|
|
420
|
+
| Field | Type | Required | Description |
|
|
421
|
+
|---|---|---|---|
|
|
422
|
+
| `plural_noun` | `string` | yes | Display name for many records, e.g. "Invoices". |
|
|
423
|
+
| `singular_noun` | `string` | yes | Display name for one record, e.g. "Invoice". |
|
|
424
|
+
| `slug` | `string` | yes | Stable API slug for the object type, e.g. `invoices`. |
|
|
425
|
+
| `description` | `string \| null` | no | Customer-configured object description. |
|
|
426
|
+
| `display_attribute_slug` | `string \| null` | no | Active single-value field used to label records; null uses the default. |
|
|
427
|
+
| `icon` | `string \| null` | no | Configured graph8 icon name; null uses the default. |
|
|
428
|
+
| `is_archived` | `boolean` | no | Archived objects are hidden from listings. default `false` |
|
|
429
|
+
| `is_system` | `boolean` | no | True for objects graph8 ships; system objects cannot be deleted. default `false` |
|
|
430
|
+
|
|
431
|
+
**Example**
|
|
432
|
+
|
|
433
|
+
```ts
|
|
434
|
+
const result = await g8.api.objects.getObject({ path: { object_slug: "example" } });
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
<a id="op-getobjectrecord"></a>
|
|
440
|
+
|
|
441
|
+
### `g8.api.objects.getObjectRecord(input)`
|
|
442
|
+
|
|
443
|
+
**Get Object Record**
|
|
444
|
+
|
|
445
|
+
- HTTP: `GET /api/v1/objects/{object_slug}/records/{record_id}`
|
|
446
|
+
- operationId: `get_object_record_objects__object_slug__records__record_id__get` (also callable as `g8.api.call("get_object_record_objects__object_slug__records__record_id__get", input)`)
|
|
447
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
448
|
+
- API-key scope: `objects:read`
|
|
449
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
450
|
+
- ★ Hand-written: [`g8.objects.getRecord()`](../sdk-clients.md#g8-objects-getrecord)
|
|
451
|
+
|
|
452
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
453
|
+
|
|
454
|
+
Fetch one record with its currently active values.
|
|
455
|
+
|
|
456
|
+
Contacts and companies retain their canonical graph8 IDs; deals retain their
|
|
457
|
+
canonical UUIDs. Deal values include active typed fields and permitted
|
|
458
|
+
company, primary-contact and contact_ids references. Related-record access is checked
|
|
459
|
+
independently of deal access. Generic deal mutations are not yet supported.
|
|
460
|
+
|
|
461
|
+
**Input**
|
|
462
|
+
|
|
463
|
+
| Field | Type | Required | Description |
|
|
464
|
+
|---|---|---|---|
|
|
465
|
+
| `path.object_slug` | `string` | yes | |
|
|
466
|
+
| `path.record_id` | `string` | yes | |
|
|
467
|
+
|
|
468
|
+
**Returns** `ApiResponse_ObjectRecordResponse_`: the envelope `{ data: ObjectRecordResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
469
|
+
|
|
470
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
471
|
+
|
|
472
|
+
`ObjectRecordResponse` fields:
|
|
473
|
+
|
|
474
|
+
| Field | Type | Required | Description |
|
|
475
|
+
|---|---|---|---|
|
|
476
|
+
| `id` | `string` | yes | Opaque record identifier. |
|
|
477
|
+
| `object_slug` | `string` | yes | The object type this record belongs to. |
|
|
478
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
479
|
+
| `is_archived` | `boolean` | no | Archived records are excluded from listings. default `false` |
|
|
480
|
+
| `revision` | `integer` | no | Record revision for conditional updates. default `1`, min 1 |
|
|
481
|
+
| `updated_at` | `string (date-time) \| null` | no | |
|
|
482
|
+
| `values` | `Record<string, unknown>` | no | Currently active values, keyed by attribute slug. Shapes follow each attribute's own type; call `GET /objects/{object_slug}/attributes` for the schema. |
|
|
483
|
+
|
|
484
|
+
**Example**
|
|
485
|
+
|
|
486
|
+
```ts
|
|
487
|
+
const result = await g8.api.objects.getObjectRecord({ path: { object_slug: "example", record_id: "id" } });
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
<a id="op-getobjectrecordchanges"></a>
|
|
493
|
+
|
|
494
|
+
### `g8.api.objects.getObjectRecordChanges(input)`
|
|
495
|
+
|
|
496
|
+
**Get Object Record Changes**
|
|
497
|
+
|
|
498
|
+
- HTTP: `GET /api/v1/objects/{object_slug}/records/{record_id}/changes`
|
|
499
|
+
- operationId: `get_object_record_changes_objects__object_slug__records__record_id__changes_get` (also callable as `g8.api.call("get_object_record_changes_objects__object_slug__records__record_id__changes_get", input)`)
|
|
500
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
501
|
+
- API-key scope: `objects:read`
|
|
502
|
+
- ★ Hand-written: [`g8.objects.changes()`](../sdk-clients.md#g8-objects-changes)
|
|
503
|
+
|
|
504
|
+
Read recorded mutation authorship and before/after changes with stable cursor pagination.
|
|
505
|
+
|
|
506
|
+
Custom records include clear and lifecycle actions. Canonical contacts and companies use
|
|
507
|
+
their existing IDs and audit facts, bounded by current record access and
|
|
508
|
+
field privacy; archived records are unavailable through this reader.
|
|
509
|
+
Older writes without recorded mutation facts are not reconstructed here.
|
|
510
|
+
An unavailable audit store returns 503, never an empty success response.
|
|
511
|
+
|
|
512
|
+
**Input**
|
|
513
|
+
|
|
514
|
+
| Field | Type | Required | Description |
|
|
515
|
+
|---|---|---|---|
|
|
516
|
+
| `path.object_slug` | `string` | yes | |
|
|
517
|
+
| `path.record_id` | `string` | yes | |
|
|
518
|
+
| `query.limit` | `integer` | no | default `100` |
|
|
519
|
+
| `query.cursor` | `string \| null` | no | |
|
|
520
|
+
|
|
521
|
+
**Returns** `ApiResponse_RecordMutationsResponse_`: the envelope `{ data: RecordMutationsResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
522
|
+
|
|
523
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
524
|
+
|
|
525
|
+
`RecordMutationsResponse` fields:
|
|
526
|
+
|
|
527
|
+
| Field | Type | Required | Description |
|
|
528
|
+
|---|---|---|---|
|
|
529
|
+
| `entries` | `Array<RecordMutationEntry>` | yes | |
|
|
530
|
+
| `record_id` | `string` | yes | |
|
|
531
|
+
| `next_cursor` | `string \| null` | no | |
|
|
532
|
+
|
|
533
|
+
**Example**
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
const result = await g8.api.objects.getObjectRecordChanges({ path: { object_slug: "example", record_id: "id" } });
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
<a id="op-getobjectrecordhistory"></a>
|
|
542
|
+
|
|
543
|
+
### `g8.api.objects.getObjectRecordHistory(input)`
|
|
544
|
+
|
|
545
|
+
**Get Object Record History**
|
|
546
|
+
|
|
547
|
+
- HTTP: `GET /api/v1/objects/{object_slug}/records/{record_id}/history`
|
|
548
|
+
- operationId: `get_object_record_history_objects__object_slug__records__record_id__history_get` (also callable as `g8.api.call("get_object_record_history_objects__object_slug__records__record_id__history_get", input)`)
|
|
549
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
550
|
+
- API-key scope: `objects:read`
|
|
551
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
552
|
+
- ★ Hand-written: [`g8.objects.history()`](../sdk-clients.md#g8-objects-history)
|
|
553
|
+
|
|
554
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
555
|
+
|
|
556
|
+
A record's value timeline, newest first.
|
|
557
|
+
|
|
558
|
+
Each entry is one generation of one attribute. An entry whose `active_until`
|
|
559
|
+
is null is the value currently in force.
|
|
560
|
+
|
|
561
|
+
**Input**
|
|
562
|
+
|
|
563
|
+
| Field | Type | Required | Description |
|
|
564
|
+
|---|---|---|---|
|
|
565
|
+
| `path.object_slug` | `string` | yes | |
|
|
566
|
+
| `path.record_id` | `string` | yes | |
|
|
567
|
+
| `query.limit` | `integer` | no | Maximum generations to return default `100` |
|
|
568
|
+
|
|
569
|
+
**Returns** `ApiResponse_RecordHistoryResponse_`: the envelope `{ data: RecordHistoryResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
570
|
+
|
|
571
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
572
|
+
|
|
573
|
+
`RecordHistoryResponse` fields:
|
|
574
|
+
|
|
575
|
+
| Field | Type | Required | Description |
|
|
576
|
+
|---|---|---|---|
|
|
577
|
+
| `record_id` | `string` | yes | |
|
|
578
|
+
| `entries` | `Array<RecordHistoryEntry>` | no | |
|
|
579
|
+
|
|
580
|
+
**Example**
|
|
581
|
+
|
|
582
|
+
```ts
|
|
583
|
+
const result = await g8.api.objects.getObjectRecordHistory({ path: { object_slug: "example", record_id: "id" } });
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
---
|
|
587
|
+
|
|
588
|
+
<a id="op-listobjectattributes"></a>
|
|
589
|
+
|
|
590
|
+
### `g8.api.objects.listObjectAttributes(input)`
|
|
591
|
+
|
|
592
|
+
**List Object Attributes**
|
|
593
|
+
|
|
594
|
+
- HTTP: `GET /api/v1/objects/{object_slug}/attributes`
|
|
595
|
+
- operationId: `list_object_attributes_objects__object_slug__attributes_get` (also callable as `g8.api.call("list_object_attributes_objects__object_slug__attributes_get", input)`)
|
|
596
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
597
|
+
- API-key scope: `objects:read`
|
|
598
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
599
|
+
- ★ Hand-written: [`g8.objects.listAttributes()`](../sdk-clients.md#g8-objects-listattributes)
|
|
600
|
+
|
|
601
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
602
|
+
|
|
603
|
+
List active fields. Archived-field discovery currently applies to custom objects.
|
|
604
|
+
|
|
605
|
+
**Input**
|
|
606
|
+
|
|
607
|
+
| Field | Type | Required | Description |
|
|
608
|
+
|---|---|---|---|
|
|
609
|
+
| `path.object_slug` | `string` | yes | |
|
|
610
|
+
| `query.include_archived` | `boolean` | no | default `false` |
|
|
611
|
+
|
|
612
|
+
**Returns** `ApiResponse_list_AttributeDefinitionResponse__`: the envelope `{ data: Array<AttributeDefinitionResponse>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
613
|
+
|
|
614
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
615
|
+
|
|
616
|
+
`AttributeDefinitionResponse` fields:
|
|
617
|
+
|
|
618
|
+
| Field | Type | Required | Description |
|
|
619
|
+
|---|---|---|---|
|
|
620
|
+
| `attribute_type` | `string` | yes | One of the 16 supported attribute types (`text`, `number`, `email_address`, `timestamp`, `select`, `record_reference`, …). Determines how values are validated and canonicalized. |
|
|
621
|
+
| `slug` | `string` | yes | Stable API slug for the attribute, used as a payload key. |
|
|
622
|
+
| `title` | `string` | yes | Customer-facing field label, distinct from its stable API slug. |
|
|
623
|
+
| `config` | `Record<string, unknown>` | no | Type-specific configuration, e.g. select options. Record references require target_object and must resolve to active records in that object within the caller's organization and app. |
|
|
624
|
+
| `default_value` | `unknown` | no | Configured create default. Enabled non-null defaults pass the same validation as explicit values. |
|
|
625
|
+
| `description` | `string \| null` | no | Customer-configured description of the field. |
|
|
626
|
+
| `is_archived` | `boolean` | no | Archived fields retain their values and can be restored. default `false` |
|
|
627
|
+
| `is_default_value_enabled` | `boolean` | no | Apply the configured default when this field is omitted on create. Never applies on PATCH. default `false` |
|
|
628
|
+
| `is_multiselect` | `boolean` | no | Values are a list rather than a scalar. default `false` |
|
|
629
|
+
| `is_required` | `boolean` | no | Required on create. PATCH may omit it, but cannot clear it with null or an empty multivalue list. default `false` |
|
|
630
|
+
| `is_system` | `boolean` | no | Whether this field is protected as a system attribute. default `false` |
|
|
631
|
+
| `is_unique` | `boolean` | no | No two active records may hold the same value for this attribute. A collision is rejected with `409 duplicate_active_value`. default `false` |
|
|
632
|
+
| `sort_order` | `integer` | no | Configured display order; equal values are ordered by API slug. default `0` |
|
|
633
|
+
|
|
634
|
+
**Example**
|
|
635
|
+
|
|
636
|
+
```ts
|
|
637
|
+
const result = await g8.api.objects.listObjectAttributes({ path: { object_slug: "example" } });
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
---
|
|
641
|
+
|
|
642
|
+
<a id="op-listobjectrecords"></a>
|
|
643
|
+
|
|
644
|
+
### `g8.api.objects.listObjectRecords(input)`
|
|
645
|
+
|
|
646
|
+
**List Object Records**
|
|
647
|
+
|
|
648
|
+
- HTTP: `GET /api/v1/objects/{object_slug}/records`
|
|
649
|
+
- operationId: `list_object_records_objects__object_slug__records_get` (also callable as `g8.api.call("list_object_records_objects__object_slug__records_get", input)`)
|
|
650
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
651
|
+
- API-key scope: `objects:read`
|
|
652
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
653
|
+
- ★ Hand-written: [`g8.objects.listRecords()`](../sdk-clients.md#g8-objects-listrecords)
|
|
654
|
+
|
|
655
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
656
|
+
|
|
657
|
+
List an object's records, newest last, with their active values.
|
|
658
|
+
|
|
659
|
+
Archived records are excluded. Supports page-number and opaque cursor
|
|
660
|
+
pagination; when `cursor` is supplied it wins. Deals use canonical UUIDs,
|
|
661
|
+
current ownership scope, typed values and independently permitted references.
|
|
662
|
+
|
|
663
|
+
**Input**
|
|
664
|
+
|
|
665
|
+
| Field | Type | Required | Description |
|
|
666
|
+
|---|---|---|---|
|
|
667
|
+
| `path.object_slug` | `string` | yes | |
|
|
668
|
+
| `query.page` | `integer` | no | Page number (ignored when `cursor` is supplied) default `1` |
|
|
669
|
+
| `query.limit` | `integer` | no | Items per page default `50` |
|
|
670
|
+
| `query.cursor` | `string \| null` | no | Opaque pagination cursor from a prior response's `next_cursor`. When supplied it takes precedence over `page`. |
|
|
671
|
+
|
|
672
|
+
**Returns** `ApiResponse_list_ObjectRecordResponse__`: the envelope `{ data: Array<ObjectRecordResponse>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
673
|
+
|
|
674
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
675
|
+
|
|
676
|
+
`ObjectRecordResponse` fields:
|
|
677
|
+
|
|
678
|
+
| Field | Type | Required | Description |
|
|
679
|
+
|---|---|---|---|
|
|
680
|
+
| `id` | `string` | yes | Opaque record identifier. |
|
|
681
|
+
| `object_slug` | `string` | yes | The object type this record belongs to. |
|
|
682
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
683
|
+
| `is_archived` | `boolean` | no | Archived records are excluded from listings. default `false` |
|
|
684
|
+
| `revision` | `integer` | no | Record revision for conditional updates. default `1`, min 1 |
|
|
685
|
+
| `updated_at` | `string (date-time) \| null` | no | |
|
|
686
|
+
| `values` | `Record<string, unknown>` | no | Currently active values, keyed by attribute slug. Shapes follow each attribute's own type; call `GET /objects/{object_slug}/attributes` for the schema. |
|
|
687
|
+
|
|
688
|
+
**Example**
|
|
689
|
+
|
|
690
|
+
```ts
|
|
691
|
+
const result = await g8.api.objects.listObjectRecords({ path: { object_slug: "example" } });
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
---
|
|
695
|
+
|
|
696
|
+
<a id="op-listobjects"></a>
|
|
697
|
+
|
|
698
|
+
### `g8.api.objects.listObjects(input?)`
|
|
699
|
+
|
|
700
|
+
**List Objects**
|
|
701
|
+
|
|
702
|
+
- HTTP: `GET /api/v1/objects`
|
|
703
|
+
- operationId: `list_objects_objects_get` (also callable as `g8.api.call("list_objects_objects_get", input)`)
|
|
704
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
705
|
+
- API-key scope: `objects:read`
|
|
706
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
707
|
+
- ★ Hand-written: [`g8.objects.list()`](../sdk-clients.md#g8-objects-list)
|
|
708
|
+
|
|
709
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
710
|
+
|
|
711
|
+
List accessible registered standard and custom objects; optionally include archived custom definitions.
|
|
712
|
+
|
|
713
|
+
**Input**
|
|
714
|
+
|
|
715
|
+
| Field | Type | Required | Description |
|
|
716
|
+
|---|---|---|---|
|
|
717
|
+
| `query.include_archived` | `boolean` | no | default `false` |
|
|
718
|
+
|
|
719
|
+
**Returns** `ApiResponse_list_ObjectDefinitionResponse__`: the envelope `{ data: Array<ObjectDefinitionResponse>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
720
|
+
|
|
721
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
722
|
+
|
|
723
|
+
`ObjectDefinitionResponse` fields:
|
|
724
|
+
|
|
725
|
+
| Field | Type | Required | Description |
|
|
726
|
+
|---|---|---|---|
|
|
727
|
+
| `plural_noun` | `string` | yes | Display name for many records, e.g. "Invoices". |
|
|
728
|
+
| `singular_noun` | `string` | yes | Display name for one record, e.g. "Invoice". |
|
|
729
|
+
| `slug` | `string` | yes | Stable API slug for the object type, e.g. `invoices`. |
|
|
730
|
+
| `description` | `string \| null` | no | Customer-configured object description. |
|
|
731
|
+
| `display_attribute_slug` | `string \| null` | no | Active single-value field used to label records; null uses the default. |
|
|
732
|
+
| `icon` | `string \| null` | no | Configured graph8 icon name; null uses the default. |
|
|
733
|
+
| `is_archived` | `boolean` | no | Archived objects are hidden from listings. default `false` |
|
|
734
|
+
| `is_system` | `boolean` | no | True for objects graph8 ships; system objects cannot be deleted. default `false` |
|
|
735
|
+
|
|
736
|
+
**Example**
|
|
737
|
+
|
|
738
|
+
```ts
|
|
739
|
+
const result = await g8.api.objects.listObjects();
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
---
|
|
743
|
+
|
|
744
|
+
<a id="op-restoreobjectrecord"></a>
|
|
745
|
+
|
|
746
|
+
### `g8.api.objects.restoreObjectRecord(input)`
|
|
747
|
+
|
|
748
|
+
**Restore Object Record**
|
|
749
|
+
|
|
750
|
+
- HTTP: `POST /api/v1/objects/{object_slug}/records/{record_id}/restore`
|
|
751
|
+
- operationId: `restore_object_record_objects__object_slug__records__record_id__restore_post` (also callable as `g8.api.call("restore_object_record_objects__object_slug__records__record_id__restore_post", input)`)
|
|
752
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
753
|
+
- API-key scope: `objects:write`
|
|
754
|
+
- ★ Hand-written: [`g8.objects.restoreRecord()`](../sdk-clients.md#g8-objects-restorerecord)
|
|
755
|
+
|
|
756
|
+
Restore the archived values under current constraints, preserving identity and history.
|
|
757
|
+
|
|
758
|
+
Unique-value conflicts return 409. Invalid schema/references or an ambiguous
|
|
759
|
+
legacy archive snapshot return 422. Retrying an already restored record is a
|
|
760
|
+
read with no additional revision or history generation.
|
|
761
|
+
|
|
762
|
+
**Input**
|
|
763
|
+
|
|
764
|
+
| Field | Type | Required | Description |
|
|
765
|
+
|---|---|---|---|
|
|
766
|
+
| `path.object_slug` | `string` | yes | |
|
|
767
|
+
| `path.record_id` | `string` | yes | |
|
|
768
|
+
|
|
769
|
+
**Returns** `ApiResponse_ObjectRecordResponse_`: the envelope `{ data: ObjectRecordResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
770
|
+
|
|
771
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
772
|
+
|
|
773
|
+
`ObjectRecordResponse` fields:
|
|
774
|
+
|
|
775
|
+
| Field | Type | Required | Description |
|
|
776
|
+
|---|---|---|---|
|
|
777
|
+
| `id` | `string` | yes | Opaque record identifier. |
|
|
778
|
+
| `object_slug` | `string` | yes | The object type this record belongs to. |
|
|
779
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
780
|
+
| `is_archived` | `boolean` | no | Archived records are excluded from listings. default `false` |
|
|
781
|
+
| `revision` | `integer` | no | Record revision for conditional updates. default `1`, min 1 |
|
|
782
|
+
| `updated_at` | `string (date-time) \| null` | no | |
|
|
783
|
+
| `values` | `Record<string, unknown>` | no | Currently active values, keyed by attribute slug. Shapes follow each attribute's own type; call `GET /objects/{object_slug}/attributes` for the schema. |
|
|
784
|
+
|
|
785
|
+
**Example**
|
|
786
|
+
|
|
787
|
+
```ts
|
|
788
|
+
const result = await g8.api.objects.restoreObjectRecord({ path: { object_slug: "example", record_id: "id" } });
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
---
|
|
792
|
+
|
|
793
|
+
<a id="op-updateattribute"></a>
|
|
794
|
+
|
|
795
|
+
### `g8.api.objects.updateAttribute(input)`
|
|
796
|
+
|
|
797
|
+
**Update Attribute**
|
|
798
|
+
|
|
799
|
+
- HTTP: `PATCH /api/v1/objects/{object_slug}/attributes/{attr_slug}`
|
|
800
|
+
- operationId: `update_attribute_objects__object_slug__attributes__attr_slug__patch` (also callable as `g8.api.call("update_attribute_objects__object_slug__attributes__attr_slug__patch", input)`)
|
|
801
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
802
|
+
- API-key scope: `objects:manage`
|
|
803
|
+
- ★ Hand-written: [`g8.objects.updateAttribute()`](../sdk-clients.md#g8-objects-updateattribute)
|
|
804
|
+
|
|
805
|
+
Edit or restore a field; omitted values remain unchanged. Type and slug are immutable.
|
|
806
|
+
|
|
807
|
+
**Input**
|
|
808
|
+
|
|
809
|
+
| Field | Type | Required | Description |
|
|
810
|
+
|---|---|---|---|
|
|
811
|
+
| `path.object_slug` | `string` | yes | |
|
|
812
|
+
| `path.attr_slug` | `string` | yes | |
|
|
813
|
+
| `body` | `AttributeUpdateRequest` | yes | Request body; fields below. |
|
|
814
|
+
|
|
815
|
+
Body fields (`AttributeUpdateRequest`):
|
|
816
|
+
|
|
817
|
+
| Field | Type | Required | Description |
|
|
818
|
+
|---|---|---|---|
|
|
819
|
+
| `body.config` | `AttributeConfig \| null` | no | |
|
|
820
|
+
| `body.default_value` | `unknown \| null` | no | |
|
|
821
|
+
| `body.description` | `string \| null` | no | |
|
|
822
|
+
| `body.is_archived` | `boolean \| null` | no | |
|
|
823
|
+
| `body.is_default_value_enabled` | `boolean \| null` | no | |
|
|
824
|
+
| `body.is_multiselect` | `boolean \| null` | no | |
|
|
825
|
+
| `body.is_required` | `boolean \| null` | no | |
|
|
826
|
+
| `body.is_unique` | `boolean \| null` | no | |
|
|
827
|
+
| `body.sort_order` | `integer \| null` | no | |
|
|
828
|
+
| `body.title` | `string \| null` | no | min length 1, max length 200 |
|
|
829
|
+
|
|
830
|
+
**Returns** `ApiResponse_AttributeDefinitionResponse_`: the envelope `{ data: AttributeDefinitionResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
831
|
+
|
|
832
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
833
|
+
|
|
834
|
+
`AttributeDefinitionResponse` fields:
|
|
835
|
+
|
|
836
|
+
| Field | Type | Required | Description |
|
|
837
|
+
|---|---|---|---|
|
|
838
|
+
| `attribute_type` | `string` | yes | One of the 16 supported attribute types (`text`, `number`, `email_address`, `timestamp`, `select`, `record_reference`, …). Determines how values are validated and canonicalized. |
|
|
839
|
+
| `slug` | `string` | yes | Stable API slug for the attribute, used as a payload key. |
|
|
840
|
+
| `title` | `string` | yes | Customer-facing field label, distinct from its stable API slug. |
|
|
841
|
+
| `config` | `Record<string, unknown>` | no | Type-specific configuration, e.g. select options. Record references require target_object and must resolve to active records in that object within the caller's organization and app. |
|
|
842
|
+
| `default_value` | `unknown` | no | Configured create default. Enabled non-null defaults pass the same validation as explicit values. |
|
|
843
|
+
| `description` | `string \| null` | no | Customer-configured description of the field. |
|
|
844
|
+
| `is_archived` | `boolean` | no | Archived fields retain their values and can be restored. default `false` |
|
|
845
|
+
| `is_default_value_enabled` | `boolean` | no | Apply the configured default when this field is omitted on create. Never applies on PATCH. default `false` |
|
|
846
|
+
| `is_multiselect` | `boolean` | no | Values are a list rather than a scalar. default `false` |
|
|
847
|
+
| `is_required` | `boolean` | no | Required on create. PATCH may omit it, but cannot clear it with null or an empty multivalue list. default `false` |
|
|
848
|
+
| `is_system` | `boolean` | no | Whether this field is protected as a system attribute. default `false` |
|
|
849
|
+
| `is_unique` | `boolean` | no | No two active records may hold the same value for this attribute. A collision is rejected with `409 duplicate_active_value`. default `false` |
|
|
850
|
+
| `sort_order` | `integer` | no | Configured display order; equal values are ordered by API slug. default `0` |
|
|
851
|
+
|
|
852
|
+
**Example**
|
|
853
|
+
|
|
854
|
+
```ts
|
|
855
|
+
const result = await g8.api.objects.updateAttribute({ path: { object_slug: "example", attr_slug: "example" }, body: {} });
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
---
|
|
859
|
+
|
|
860
|
+
<a id="op-updateobject"></a>
|
|
861
|
+
|
|
862
|
+
### `g8.api.objects.updateObject(input)`
|
|
863
|
+
|
|
864
|
+
**Update Object**
|
|
865
|
+
|
|
866
|
+
- HTTP: `PATCH /api/v1/objects/{object_slug}`
|
|
867
|
+
- operationId: `update_object_objects__object_slug__patch` (also callable as `g8.api.call("update_object_objects__object_slug__patch", input)`)
|
|
868
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
869
|
+
- API-key scope: `objects:manage`
|
|
870
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
871
|
+
- ★ Hand-written: [`g8.objects.update()`](../sdk-clients.md#g8-objects-update)
|
|
872
|
+
|
|
873
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
874
|
+
|
|
875
|
+
Rename, archive or restore a custom object while retaining its slug and data.
|
|
876
|
+
|
|
877
|
+
**Input**
|
|
878
|
+
|
|
879
|
+
| Field | Type | Required | Description |
|
|
880
|
+
|---|---|---|---|
|
|
881
|
+
| `path.object_slug` | `string` | yes | |
|
|
882
|
+
| `body` | `ObjectUpdateRequest` | yes | Request body; fields below. |
|
|
883
|
+
|
|
884
|
+
Body fields (`ObjectUpdateRequest`):
|
|
885
|
+
|
|
886
|
+
| Field | Type | Required | Description |
|
|
887
|
+
|---|---|---|---|
|
|
888
|
+
| `body.description` | `string \| null` | no | max length 2000 |
|
|
889
|
+
| `body.display_attribute_slug` | `string \| null` | no | min length 1, max length 100, pattern `^[a-z][a-z0-9_]*$` |
|
|
890
|
+
| `body.icon` | `"box" \| "briefcase" \| "building" \| "calendar" \| "flag" \| "folder" \| "globe" \| "heart" \| … \| null` | no | |
|
|
891
|
+
| `body.is_archived` | `boolean \| null` | no | |
|
|
892
|
+
| `body.plural_noun` | `string \| null` | no | min length 1, max length 100 |
|
|
893
|
+
| `body.singular_noun` | `string \| null` | no | min length 1, max length 100 |
|
|
894
|
+
|
|
895
|
+
**Returns** `ApiResponse_ObjectDefinitionResponse_`: the envelope `{ data: ObjectDefinitionResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
896
|
+
|
|
897
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
898
|
+
|
|
899
|
+
`ObjectDefinitionResponse` fields:
|
|
900
|
+
|
|
901
|
+
| Field | Type | Required | Description |
|
|
902
|
+
|---|---|---|---|
|
|
903
|
+
| `plural_noun` | `string` | yes | Display name for many records, e.g. "Invoices". |
|
|
904
|
+
| `singular_noun` | `string` | yes | Display name for one record, e.g. "Invoice". |
|
|
905
|
+
| `slug` | `string` | yes | Stable API slug for the object type, e.g. `invoices`. |
|
|
906
|
+
| `description` | `string \| null` | no | Customer-configured object description. |
|
|
907
|
+
| `display_attribute_slug` | `string \| null` | no | Active single-value field used to label records; null uses the default. |
|
|
908
|
+
| `icon` | `string \| null` | no | Configured graph8 icon name; null uses the default. |
|
|
909
|
+
| `is_archived` | `boolean` | no | Archived objects are hidden from listings. default `false` |
|
|
910
|
+
| `is_system` | `boolean` | no | True for objects graph8 ships; system objects cannot be deleted. default `false` |
|
|
911
|
+
|
|
912
|
+
**Example**
|
|
913
|
+
|
|
914
|
+
```ts
|
|
915
|
+
const result = await g8.api.objects.updateObject({ path: { object_slug: "example" }, body: {} });
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
---
|
|
919
|
+
|
|
920
|
+
<a id="op-updateobjectrecord"></a>
|
|
921
|
+
|
|
922
|
+
### `g8.api.objects.updateObjectRecord(input)`
|
|
923
|
+
|
|
924
|
+
**Update Object Record**
|
|
925
|
+
|
|
926
|
+
- HTTP: `PATCH /api/v1/objects/{object_slug}/records/{record_id}`
|
|
927
|
+
- operationId: `update_object_record_objects__object_slug__records__record_id__patch` (also callable as `g8.api.call("update_object_record_objects__object_slug__records__record_id__patch", input)`)
|
|
928
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
929
|
+
- API-key scope: `objects:write`
|
|
930
|
+
- Lifecycle: `preview` (may not be enabled for every org yet)
|
|
931
|
+
- ★ Hand-written: [`g8.objects.updateRecord()`](../sdk-clients.md#g8-objects-updaterecord)
|
|
932
|
+
|
|
933
|
+
PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.
|
|
934
|
+
|
|
935
|
+
Update a record's values. Only the supplied attributes are touched.
|
|
936
|
+
|
|
937
|
+
A partial update, so required attributes you do not send are left alone rather
|
|
938
|
+
than reported missing. Sending an explicit `null` CLEARS that attribute.
|
|
939
|
+
Values are versioned rather than overwritten, so the previous value stays
|
|
940
|
+
readable through the history endpoint.
|
|
941
|
+
|
|
942
|
+
**Input**
|
|
943
|
+
|
|
944
|
+
| Field | Type | Required | Description |
|
|
945
|
+
|---|---|---|---|
|
|
946
|
+
| `path.object_slug` | `string` | yes | |
|
|
947
|
+
| `path.record_id` | `string` | yes | |
|
|
948
|
+
| `body` | `RecordUpdateRequest` | yes | Request body; fields below. |
|
|
949
|
+
|
|
950
|
+
Body fields (`RecordUpdateRequest`):
|
|
951
|
+
|
|
952
|
+
| Field | Type | Required | Description |
|
|
953
|
+
|---|---|---|---|
|
|
954
|
+
| `body.append_values` | `Record<string, Array<unknown>>` | no | Append canonical non-duplicate values to multivalue fields. Fields must not overlap values or remove_values. |
|
|
955
|
+
| `body.expected_revision` | `integer \| null` | no | Required for canonical contact or company PATCH. Apply only if the record still has this revision; otherwise return 409. min 1 |
|
|
956
|
+
| `body.remove_values` | `Record<string, Array<unknown>>` | no | Remove all canonical matches from multivalue fields. Fields must not overlap values or append_values. |
|
|
957
|
+
| `body.values` | `Record<string, unknown>` | no | Attribute values keyed by slug. Call `GET /objects/{object_slug}/attributes` for active fields. Canonical contacts and companies retain CONTACT_*, COMPANY_* and udo_* field names. Unknown keys are rejected with 422. PATCH preserves omitted fields; required fields cannot be cleared with null or an empty multivalue list. Record references must resolve to active records of their configured target ob… |
|
|
958
|
+
|
|
959
|
+
**Returns** `ApiResponse_ObjectRecordResponse_`: the envelope `{ data: ObjectRecordResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
960
|
+
|
|
961
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
962
|
+
|
|
963
|
+
`ObjectRecordResponse` fields:
|
|
964
|
+
|
|
965
|
+
| Field | Type | Required | Description |
|
|
966
|
+
|---|---|---|---|
|
|
967
|
+
| `id` | `string` | yes | Opaque record identifier. |
|
|
968
|
+
| `object_slug` | `string` | yes | The object type this record belongs to. |
|
|
969
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
970
|
+
| `is_archived` | `boolean` | no | Archived records are excluded from listings. default `false` |
|
|
971
|
+
| `revision` | `integer` | no | Record revision for conditional updates. default `1`, min 1 |
|
|
972
|
+
| `updated_at` | `string (date-time) \| null` | no | |
|
|
973
|
+
| `values` | `Record<string, unknown>` | no | Currently active values, keyed by attribute slug. Shapes follow each attribute's own type; call `GET /objects/{object_slug}/attributes` for the schema. |
|
|
974
|
+
|
|
975
|
+
**Example**
|
|
976
|
+
|
|
977
|
+
```ts
|
|
978
|
+
const result = await g8.api.objects.updateObjectRecord({ path: { object_slug: "example", record_id: "id" }, body: {} });
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
---
|
|
982
|
+
|
|
983
|
+
<a id="op-upsertobjectrecord"></a>
|
|
984
|
+
|
|
985
|
+
### `g8.api.objects.upsertObjectRecord(input)`
|
|
986
|
+
|
|
987
|
+
**Upsert Object Record**
|
|
988
|
+
|
|
989
|
+
- HTTP: `POST /api/v1/objects/{object_slug}/records/upsert`
|
|
990
|
+
- operationId: `upsert_object_record_objects__object_slug__records_upsert_post` (also callable as `g8.api.call("upsert_object_record_objects__object_slug__records_upsert_post", input)`)
|
|
991
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
992
|
+
- API-key scope: `objects:write`
|
|
993
|
+
- ★ Hand-written: [`g8.objects.upsertRecord()`](../sdk-clients.md#g8-objects-upsertrecord)
|
|
994
|
+
|
|
995
|
+
Create (201) or update (200) by a unique key, preserving omitted fields.
|
|
996
|
+
|
|
997
|
+
A revision requires an existing matching record; a stale or absent match
|
|
998
|
+
returns 409. Validation, matching, and mutation share one transaction.
|
|
999
|
+
|
|
1000
|
+
**Input**
|
|
1001
|
+
|
|
1002
|
+
| Field | Type | Required | Description |
|
|
1003
|
+
|---|---|---|---|
|
|
1004
|
+
| `path.object_slug` | `string` | yes | |
|
|
1005
|
+
| `body` | `RecordUpsertRequest` | yes | Request body; fields below. |
|
|
1006
|
+
|
|
1007
|
+
Body fields (`RecordUpsertRequest`):
|
|
1008
|
+
|
|
1009
|
+
| Field | Type | Required | Description |
|
|
1010
|
+
|---|---|---|---|
|
|
1011
|
+
| `body.matching_attribute` | `string` | yes | Active single-value unique attribute. Its nonempty value must be supplied in values. min length 1, max length 100, pattern `^[a-z][a-z0-9_]*$` |
|
|
1012
|
+
| `body.expected_revision` | `integer \| null` | no | min 1 |
|
|
1013
|
+
| `body.values` | `Record<string, unknown>` | no | Attribute values keyed by slug. Call `GET /objects/{object_slug}/attributes` for active fields. Canonical contacts and companies retain CONTACT_*, COMPANY_* and udo_* field names. Unknown keys are rejected with 422. PATCH preserves omitted fields; required fields cannot be cleared with null or an empty multivalue list. Record references must resolve to active records of their configured target ob… |
|
|
1014
|
+
|
|
1015
|
+
**Returns** `ApiResponse_ObjectRecordResponse_`: the envelope `{ data: ObjectRecordResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
1016
|
+
|
|
1017
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
1018
|
+
|
|
1019
|
+
`ObjectRecordResponse` fields:
|
|
1020
|
+
|
|
1021
|
+
| Field | Type | Required | Description |
|
|
1022
|
+
|---|---|---|---|
|
|
1023
|
+
| `id` | `string` | yes | Opaque record identifier. |
|
|
1024
|
+
| `object_slug` | `string` | yes | The object type this record belongs to. |
|
|
1025
|
+
| `created_at` | `string (date-time) \| null` | no | |
|
|
1026
|
+
| `is_archived` | `boolean` | no | Archived records are excluded from listings. default `false` |
|
|
1027
|
+
| `revision` | `integer` | no | Record revision for conditional updates. default `1`, min 1 |
|
|
1028
|
+
| `updated_at` | `string (date-time) \| null` | no | |
|
|
1029
|
+
| `values` | `Record<string, unknown>` | no | Currently active values, keyed by attribute slug. Shapes follow each attribute's own type; call `GET /objects/{object_slug}/attributes` for the schema. |
|
|
1030
|
+
|
|
1031
|
+
**Example**
|
|
1032
|
+
|
|
1033
|
+
```ts
|
|
1034
|
+
const result = await g8.api.objects.upsertObjectRecord({
|
|
1035
|
+
path: { object_slug: "example" },
|
|
1036
|
+
body: { matching_attribute: "example" },
|
|
1037
|
+
});
|
|
1038
|
+
```
|
|
1039
|
+
|
|
1040
|
+
---
|
|
1041
|
+
|
|
1042
|
+
## Referenced types
|
|
1043
|
+
|
|
1044
|
+
Named types that appear in the tables above. Full TypeScript definitions: `G8Contract.<Name>` (`import type { G8Contract } from "@graph8/sdk"`).
|
|
1045
|
+
|
|
1046
|
+
<a id="type-attributeconfig"></a>
|
|
1047
|
+
|
|
1048
|
+
### `AttributeConfig`
|
|
1049
|
+
|
|
1050
|
+
Configuration for specific attribute types.
|
|
1051
|
+
|
|
1052
|
+
| Field | Type | Required | Description |
|
|
1053
|
+
|---|---|---|---|
|
|
1054
|
+
| `currency_code` | `string \| null` | no | |
|
|
1055
|
+
| `max_value` | `integer \| null` | no | |
|
|
1056
|
+
| `options` | `Array<Record<string, unknown>> \| null` | no | |
|
|
1057
|
+
| `referenced_object` | `string \| null` | no | |
|
|
1058
|
+
| `target_object` | `string \| null` | no | |
|
|
1059
|
+
|
|
1060
|
+
<a id="type-attributetype"></a>
|
|
1061
|
+
|
|
1062
|
+
### `AttributeType`
|
|
1063
|
+
|
|
1064
|
+
Valid attribute types for the Custom Objects type system.
|
|
1065
|
+
|
|
1066
|
+
Type: `"text" | "number" | "currency" | "date" | "timestamp" | "checkbox" | "select" | "status" | …`.
|
|
1067
|
+
|
|
1068
|
+
<a id="type-recordhistoryentry"></a>
|
|
1069
|
+
|
|
1070
|
+
### `RecordHistoryEntry`
|
|
1071
|
+
|
|
1072
|
+
One generation of one attribute's value. Values are TEMPORAL rather than mutable: setting a new value closes the previous generation and opens a new one, so history is the natural reading of the store rather than a separate log that could drift from it. An entry with a null `active_until` is the value currently in force.
|
|
1073
|
+
|
|
1074
|
+
| Field | Type | Required | Description |
|
|
1075
|
+
|---|---|---|---|
|
|
1076
|
+
| `attribute` | `string` | yes | Attribute slug this generation belongs to. |
|
|
1077
|
+
| `active_from` | `string (date-time) \| null` | no | When this value took effect. |
|
|
1078
|
+
| `active_until` | `string (date-time) \| null` | no | When it was superseded. Null means it is still in force. |
|
|
1079
|
+
| `actor_id` | `string \| null` | no | Opaque id of whoever set it. |
|
|
1080
|
+
| `value` | `unknown` | no | The value held during this generation. |
|
|
1081
|
+
|
|
1082
|
+
<a id="type-recordmutationentry"></a>
|
|
1083
|
+
|
|
1084
|
+
### `RecordMutationEntry`
|
|
1085
|
+
|
|
1086
|
+
| Field | Type | Required | Description |
|
|
1087
|
+
|---|---|---|---|
|
|
1088
|
+
| `action` | `"created" \| "updated" \| "archived" \| "restored"` | yes | |
|
|
1089
|
+
| `actor_id` | `string \| null` | yes | |
|
|
1090
|
+
| `actor_type` | `"user" \| "api" \| "app" \| "integration" \| "system"` | yes | |
|
|
1091
|
+
| `changes` | `Record<string, RecordMutationValueChange>` | yes | |
|
|
1092
|
+
| `id` | `string` | yes | |
|
|
1093
|
+
| `is_archived` | `boolean` | yes | |
|
|
1094
|
+
| `occurred_at` | `string (date-time)` | yes | |
|
|
1095
|
+
| `revision` | `integer` | yes | min 1 |
|
|
1096
|
+
| `source` | `string` | yes | |
|
|
1097
|
+
| `was_archived` | `boolean` | yes | |
|
|
1098
|
+
| `app_id` | `string \| null` | no | |
|