@graph8/sdk 0.251.0 → 0.260.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/cli.js +216 -0
- package/dist/index.d.mts +104 -7
- package/dist/index.d.ts +104 -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 +102 -7
- package/dist/react.d.ts +102 -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 +1696 -0
- package/docs/api/deals.md +2432 -0
- package/docs/api/deliverability.d.ts +418 -0
- package/docs/api/deliverability.md +677 -0
- package/docs/api/desk.d.ts +1765 -0
- package/docs/api/desk.md +3007 -0
- package/docs/api/dialer.d.ts +1185 -0
- package/docs/api/dialer.md +2166 -0
- package/docs/api/dialerAnalytics.d.ts +187 -0
- package/docs/api/dialerAnalytics.md +257 -0
- package/docs/api/documents.d.ts +895 -0
- package/docs/api/documents.md +1440 -0
- package/docs/api/duplicates.d.ts +195 -0
- package/docs/api/duplicates.md +315 -0
- package/docs/api/eSign.d.ts +38 -0
- package/docs/api/eSign.md +54 -0
- package/docs/api/eSignature.d.ts +242 -0
- package/docs/api/eSignature.md +341 -0
- package/docs/api/enrichment.d.ts +3207 -0
- package/docs/api/enrichment.md +5225 -0
- package/docs/api/events.d.ts +115 -0
- package/docs/api/events.md +105 -0
- package/docs/api/fields.d.ts +482 -0
- package/docs/api/fields.md +566 -0
- package/docs/api/forms.d.ts +1012 -0
- package/docs/api/forms.md +1542 -0
- package/docs/api/gtmCampaigns.d.ts +662 -0
- package/docs/api/gtmCampaigns.md +1044 -0
- package/docs/api/gtmContext.d.ts +1187 -0
- package/docs/api/gtmContext.md +2112 -0
- package/docs/api/gtmDeliverability.d.ts +60 -0
- package/docs/api/gtmDeliverability.md +63 -0
- package/docs/api/gtmKnowledgeBase.d.ts +76 -0
- package/docs/api/gtmKnowledgeBase.md +91 -0
- package/docs/api/gtmLaunchHelpers.d.ts +123 -0
- package/docs/api/gtmLaunchHelpers.md +148 -0
- package/docs/api/gtmLibrary.d.ts +448 -0
- package/docs/api/gtmLibrary.md +780 -0
- package/docs/api/health.d.ts +39 -0
- package/docs/api/health.md +58 -0
- package/docs/api/imageLibrary.d.ts +341 -0
- package/docs/api/imageLibrary.md +569 -0
- package/docs/api/imports.d.ts +157 -0
- package/docs/api/imports.md +174 -0
- package/docs/api/inbox.d.ts +709 -0
- package/docs/api/inbox.md +1067 -0
- package/docs/api/install.d.ts +213 -0
- package/docs/api/install.md +317 -0
- package/docs/api/installedApps.d.ts +131 -0
- package/docs/api/installedApps.md +241 -0
- package/docs/api/integrationStatus.d.ts +142 -0
- package/docs/api/integrationStatus.md +205 -0
- package/docs/api/integrations.d.ts +2327 -0
- package/docs/api/integrations.md +3791 -0
- package/docs/api/intent.d.ts +482 -0
- package/docs/api/intent.md +858 -0
- package/docs/api/knowledge.d.ts +501 -0
- package/docs/api/knowledge.md +843 -0
- package/docs/api/knowledgeBase.d.ts +84 -0
- package/docs/api/knowledgeBase.md +96 -0
- package/docs/api/landingPages.d.ts +1411 -0
- package/docs/api/landingPages.md +2488 -0
- package/docs/api/leads.d.ts +133 -0
- package/docs/api/leads.md +180 -0
- package/docs/api/library.d.ts +217 -0
- package/docs/api/library.md +338 -0
- package/docs/api/linkedIn.d.ts +227 -0
- package/docs/api/linkedIn.md +289 -0
- package/docs/api/linkedInOutreach.d.ts +727 -0
- package/docs/api/linkedInOutreach.md +990 -0
- package/docs/api/lists.d.ts +1106 -0
- package/docs/api/lists.md +1609 -0
- package/docs/api/logs.d.ts +71 -0
- package/docs/api/logs.md +70 -0
- package/docs/api/mailboxes.d.ts +1050 -0
- package/docs/api/mailboxes.md +1690 -0
- package/docs/api/marketingIntelligence.d.ts +256 -0
- package/docs/api/marketingIntelligence.md +454 -0
- package/docs/api/marketplace.d.ts +3173 -0
- package/docs/api/marketplace.md +5953 -0
- package/docs/api/mcp.d.ts +69 -0
- package/docs/api/mcp.md +69 -0
- package/docs/api/me.d.ts +54 -0
- package/docs/api/me.md +56 -0
- package/docs/api/meetings.d.ts +539 -0
- package/docs/api/meetings.md +747 -0
- package/docs/api/newsletter.d.ts +1613 -0
- package/docs/api/newsletter.md +2746 -0
- package/docs/api/notes.d.ts +517 -0
- package/docs/api/notes.md +888 -0
- package/docs/api/notifications.d.ts +94 -0
- package/docs/api/notifications.md +105 -0
- package/docs/api/objects.d.ts +621 -0
- package/docs/api/objects.md +1098 -0
- package/docs/api/openSearch.d.ts +234 -0
- package/docs/api/openSearch.md +297 -0
- package/docs/api/ops.d.ts +299 -0
- package/docs/api/ops.md +339 -0
- package/docs/api/orgGovernance.d.ts +393 -0
- package/docs/api/orgGovernance.md +623 -0
- package/docs/api/orgVideos.d.ts +184 -0
- package/docs/api/orgVideos.md +252 -0
- package/docs/api/organizationSettings.d.ts +626 -0
- package/docs/api/organizationSettings.md +911 -0
- package/docs/api/phoneNumbers.d.ts +484 -0
- package/docs/api/phoneNumbers.md +777 -0
- package/docs/api/profile.d.ts +329 -0
- package/docs/api/profile.md +540 -0
- package/docs/api/programmaticPages.d.ts +400 -0
- package/docs/api/programmaticPages.md +626 -0
- package/docs/api/providerDomains.d.ts +866 -0
- package/docs/api/providerDomains.md +1446 -0
- package/docs/api/providerUsage.d.ts +129 -0
- package/docs/api/providerUsage.md +186 -0
- package/docs/api/public.d.ts +69 -0
- package/docs/api/public.md +78 -0
- package/docs/api/publicCopilot.d.ts +67 -0
- package/docs/api/publicCopilot.md +80 -0
- package/docs/api/publicSignals.d.ts +66 -0
- package/docs/api/publicSignals.md +71 -0
- package/docs/api/publicVisitors.d.ts +97 -0
- package/docs/api/publicVisitors.md +118 -0
- package/docs/api/quotes.d.ts +1564 -0
- package/docs/api/quotes.md +2553 -0
- package/docs/api/radar.d.ts +808 -0
- package/docs/api/radar.md +1431 -0
- package/docs/api/radarReports.d.ts +208 -0
- package/docs/api/radarReports.md +306 -0
- package/docs/api/recordRoles.d.ts +143 -0
- package/docs/api/recordRoles.md +175 -0
- package/docs/api/repos.d.ts +146 -0
- package/docs/api/repos.md +211 -0
- package/docs/api/research.d.ts +295 -0
- package/docs/api/research.md +534 -0
- package/docs/api/revenue.d.ts +402 -0
- package/docs/api/revenue.md +608 -0
- package/docs/api/revenueAnalytics.d.ts +147 -0
- package/docs/api/revenueAnalytics.md +212 -0
- package/docs/api/revenueLifecycle.d.ts +207 -0
- package/docs/api/revenueLifecycle.md +274 -0
- package/docs/api/revenueRecords.d.ts +372 -0
- package/docs/api/revenueRecords.md +563 -0
- package/docs/api/roles.d.ts +431 -0
- package/docs/api/roles.md +812 -0
- package/docs/api/salesCoach.d.ts +877 -0
- package/docs/api/salesCoach.md +1540 -0
- package/docs/api/sandbox.d.ts +210 -0
- package/docs/api/sandbox.md +380 -0
- package/docs/api/scans.d.ts +104 -0
- package/docs/api/scans.md +136 -0
- package/docs/api/scheduleBuy.d.ts +293 -0
- package/docs/api/scheduleBuy.md +431 -0
- package/docs/api/scraping.d.ts +266 -0
- package/docs/api/scraping.md +383 -0
- package/docs/api/sdrAnalytics.d.ts +138 -0
- package/docs/api/sdrAnalytics.md +246 -0
- package/docs/api/search.d.ts +598 -0
- package/docs/api/search.md +866 -0
- package/docs/api/seo.d.ts +447 -0
- package/docs/api/seo.md +660 -0
- package/docs/api/sequenceLifecycle.d.ts +439 -0
- package/docs/api/sequenceLifecycle.md +513 -0
- package/docs/api/sequences.d.ts +1936 -0
- package/docs/api/sequences.md +3232 -0
- package/docs/api/settings.d.ts +448 -0
- package/docs/api/settings.md +731 -0
- package/docs/api/signals.d.ts +1441 -0
- package/docs/api/signals.md +2526 -0
- package/docs/api/signatures.d.ts +719 -0
- package/docs/api/signatures.md +1247 -0
- package/docs/api/skills.d.ts +230 -0
- package/docs/api/skills.md +466 -0
- package/docs/api/snippet.d.ts +85 -0
- package/docs/api/snippet.md +106 -0
- package/docs/api/socialPublishing.d.ts +824 -0
- package/docs/api/socialPublishing.md +1245 -0
- package/docs/api/studioDocuments.d.ts +244 -0
- package/docs/api/studioDocuments.md +348 -0
- package/docs/api/support.d.ts +90 -0
- package/docs/api/support.md +76 -0
- package/docs/api/suppressions.d.ts +241 -0
- package/docs/api/suppressions.md +343 -0
- package/docs/api/surveys.d.ts +847 -0
- package/docs/api/surveys.md +1223 -0
- package/docs/api/tasks.d.ts +813 -0
- package/docs/api/tasks.md +1344 -0
- package/docs/api/teamMembers.d.ts +668 -0
- package/docs/api/teamMembers.md +1040 -0
- package/docs/api/teams.d.ts +784 -0
- package/docs/api/teams.md +1395 -0
- package/docs/api/usage.d.ts +277 -0
- package/docs/api/usage.md +389 -0
- package/docs/api/visitors.d.ts +690 -0
- package/docs/api/visitors.md +1075 -0
- package/docs/api/voice.d.ts +4661 -0
- package/docs/api/voice.md +7905 -0
- package/docs/api/webAnalytics.d.ts +964 -0
- package/docs/api/webAnalytics.md +1452 -0
- package/docs/api/webChat.d.ts +1704 -0
- package/docs/api/webChat.md +2048 -0
- package/docs/api/webhooks.d.ts +251 -0
- package/docs/api/webhooks.md +386 -0
- package/docs/api/websiteEditor.d.ts +324 -0
- package/docs/api/websiteEditor.md +517 -0
- package/docs/api/work.d.ts +2298 -0
- package/docs/api/work.md +3096 -0
- package/docs/api/workbench.d.ts +2962 -0
- package/docs/api/workbench.md +4884 -0
- package/docs/api/workflows.d.ts +1218 -0
- package/docs/api/workflows.md +2302 -0
- package/docs/sdk-clients.md +4339 -0
- package/package.json +10 -3
|
@@ -0,0 +1,777 @@
|
|
|
1
|
+
<!-- Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. -->
|
|
2
|
+
|
|
3
|
+
# `g8.api.phoneNumbers`: Phone Numbers
|
|
4
|
+
|
|
5
|
+
16 operations (3 read, 8 write, 3 destructive, 1 billable, 1 external).
|
|
6
|
+
|
|
7
|
+
No hand-written client covers this area. Call it through `g8.api.phoneNumbers.*` as shown below, or by operationId with `g8.api.call(operationId, input)`.
|
|
8
|
+
|
|
9
|
+
Every example below assumes this setup (server-side, API key):
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { g8 } from "@graph8/sdk";
|
|
13
|
+
|
|
14
|
+
g8.init({ apiKey: process.env.G8_API_KEY! });
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Example values are placeholders that match each field's type. Only required fields are shown. Every example is type-checked against the SDK in CI.
|
|
18
|
+
|
|
19
|
+
Exact TypeScript types for every operation on this page, and every schema they use: [phoneNumbers.d.ts](phoneNumbers.d.ts).
|
|
20
|
+
|
|
21
|
+
## Operations
|
|
22
|
+
|
|
23
|
+
| Call | HTTP | Tier | Scope | Summary |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| [`deleteVoiceNumber`](#op-deletevoicenumber) | `DELETE /api/v1/voice/numbers` | destructive | `voice:delete` | Deregister a number from the voice platform |
|
|
26
|
+
| [`getPhoneA2pStatus`](#op-getphonea2pstatus) | `GET /api/v1/phone-numbers/a2p/status` | read | `voice:read` | Get Phone A2P Status |
|
|
27
|
+
| [`getVoiceAnsweringAgent`](#op-getvoiceansweringagent) | `GET /api/v1/voice/numbers/answering-agent` | read | `voice:read` | Which agent answers a number |
|
|
28
|
+
| [`provisionVoiceNumber`](#op-provisionvoicenumber) | `POST /api/v1/voice/numbers/provision` | write | `voice:write` | Register a number with the voice platform |
|
|
29
|
+
| [`purchasePhoneNumber`](#op-purchasephonenumber) | `POST /api/v1/phone-numbers/purchase` | billable | `voice:run` | Buy a phone number |
|
|
30
|
+
| [`reconcileA2pRegistration`](#op-reconcilea2pregistration) | `POST /api/v1/phone-numbers/a2p/reconcile` | write | `voice:write` | Re-run A2P registration for stuck numbers |
|
|
31
|
+
| [`releasePhoneNumber`](#op-releasephonenumber) | `POST /api/v1/phone-numbers/release` | destructive | `voice:delete` | Release a phone number |
|
|
32
|
+
| [`resetVoiceDailyCounts`](#op-resetvoicedailycounts) | `DELETE /api/v1/voice/numbers/daily-counts` | destructive | `voice:delete` | Reset today's per-number dialing counters |
|
|
33
|
+
| [`saveA2pInputs`](#op-savea2pinputs) | `POST /api/v1/phone-numbers/a2p/inputs` | write | `voice:write` | Save A2P brand and campaign details |
|
|
34
|
+
| [`searchAvailablePhoneNumbers`](#op-searchavailablephonenumbers) | `POST /api/v1/phone-numbers/search` | read | `voice:read` | Search Available Phone Numbers |
|
|
35
|
+
| [`startA2pRegistration`](#op-starta2pregistration) | `POST /api/v1/phone-numbers/a2p/register` | external | `voice:run` | Submit A2P 10DLC registration |
|
|
36
|
+
| [`updatePhoneAssignee`](#op-updatephoneassignee) | `PATCH /api/v1/phone-numbers/update-assignee` | write | `voice:write` | Reassign a phone number |
|
|
37
|
+
| [`updatePhoneCapabilities`](#op-updatephonecapabilities) | `PATCH /api/v1/phone-numbers/update-capabilities` | write | `voice:write` | Switch a number between dialer and voice AI |
|
|
38
|
+
| [`updateVoiceAssignee`](#op-updatevoiceassignee) | `PATCH /api/v1/voice/numbers/assignee` | write | `voice:write` | Set a number's voice-side assignee |
|
|
39
|
+
| [`updateVoiceInboundType`](#op-updatevoiceinboundtype) | `PATCH /api/v1/voice/numbers/inbound-type` | write | `voice:write` | Change what answers a number's inbound calls |
|
|
40
|
+
| [`verifyVoiceCallerId`](#op-verifyvoicecallerid) | `POST /api/v1/voice/numbers/verify-caller-id/{phone_number}` | write | `voice:write` | Verify a Telnyx number as a caller ID |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
<a id="op-deletevoicenumber"></a>
|
|
45
|
+
|
|
46
|
+
### `g8.api.phoneNumbers.deleteVoiceNumber(input)`
|
|
47
|
+
|
|
48
|
+
**Deregister a number from the voice platform**
|
|
49
|
+
|
|
50
|
+
- HTTP: `DELETE /api/v1/voice/numbers`
|
|
51
|
+
- operationId: `delete_voice_number_voice_numbers_delete` (also callable as `g8.api.call("delete_voice_number_voice_numbers_delete", input)`)
|
|
52
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
53
|
+
- API-key scope: `voice:delete`
|
|
54
|
+
|
|
55
|
+
Tear down a number's SIP trunks, dispatch rules and carrier routing.
|
|
56
|
+
|
|
57
|
+
DOES NOT RELEASE THE NUMBER. The organisation still owns it and is still
|
|
58
|
+
billed for it by the carrier - it simply stops being answerable. To give it
|
|
59
|
+
back, use `POST /phone-numbers/release`, which does this and the carrier
|
|
60
|
+
release and the local record.
|
|
61
|
+
|
|
62
|
+
Voice's own handler identifies the number by value with no tenant check, so
|
|
63
|
+
this route first asserts the caller's organisation owns it. A number that
|
|
64
|
+
exists in voice but was never recorded against this organisation is a 404.
|
|
65
|
+
|
|
66
|
+
**Input**
|
|
67
|
+
|
|
68
|
+
| Field | Type | Required | Description |
|
|
69
|
+
|---|---|---|---|
|
|
70
|
+
| `body` | `VoiceNumberDeleteRequest` | yes | Request body; fields below. |
|
|
71
|
+
|
|
72
|
+
Body fields (`VoiceNumberDeleteRequest`):
|
|
73
|
+
|
|
74
|
+
| Field | Type | Required | Description |
|
|
75
|
+
|---|---|---|---|
|
|
76
|
+
| `body.number` | `string` | yes | The number to deregister, E.164. |
|
|
77
|
+
| `body.provider` | `"twilio" \| "telnyx"` | no | The carrier to deregister from. Must match how the number was registered, or the provider-side cleanup silently does nothing while the local record still disappears. default `"twilio"` |
|
|
78
|
+
|
|
79
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
80
|
+
|
|
81
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
82
|
+
|
|
83
|
+
**Example**
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
87
|
+
const result = await g8.api.phoneNumbers.deleteVoiceNumber({ body: { number: "example" } });
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
<a id="op-getphonea2pstatus"></a>
|
|
93
|
+
|
|
94
|
+
### `g8.api.phoneNumbers.getPhoneA2pStatus(input?)`
|
|
95
|
+
|
|
96
|
+
**Get Phone A2P Status**
|
|
97
|
+
|
|
98
|
+
- HTTP: `GET /api/v1/phone-numbers/a2p/status`
|
|
99
|
+
- operationId: `get_phone_a2p_status_phone_numbers_a2p_status_get` (also callable as `g8.api.call("get_phone_a2p_status_phone_numbers_a2p_status_get", input)`)
|
|
100
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
101
|
+
- API-key scope: `voice:read`
|
|
102
|
+
|
|
103
|
+
Where the org's A2P 10DLC registration stands, and whether its inputs are complete.
|
|
104
|
+
|
|
105
|
+
**Input**: none.
|
|
106
|
+
|
|
107
|
+
**Returns** `ApiResponse_PhoneA2pStatusPayload_`: the envelope `{ data: PhoneA2pStatusPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
108
|
+
|
|
109
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
110
|
+
|
|
111
|
+
**Example**
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
const result = await g8.api.phoneNumbers.getPhoneA2pStatus();
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
<a id="op-getvoiceansweringagent"></a>
|
|
120
|
+
|
|
121
|
+
### `g8.api.phoneNumbers.getVoiceAnsweringAgent(input?)`
|
|
122
|
+
|
|
123
|
+
**Which agent answers a number**
|
|
124
|
+
|
|
125
|
+
- HTTP: `GET /api/v1/voice/numbers/answering-agent`
|
|
126
|
+
- operationId: `get_voice_answering_agent_voice_numbers_answering_agent_get` (also callable as `g8.api.call("get_voice_answering_agent_voice_numbers_answering_agent_get", input)`)
|
|
127
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
128
|
+
- API-key scope: `voice:read`
|
|
129
|
+
|
|
130
|
+
Who picks up when this number is called.
|
|
131
|
+
|
|
132
|
+
A number lives on the company profile as free text while the agent that
|
|
133
|
+
answers it is bound on that agent's identity, so the link is not readable
|
|
134
|
+
from either side alone. This resolves it.
|
|
135
|
+
|
|
136
|
+
READ-ONLY by design, and the design is load-bearing: resolving a route for
|
|
137
|
+
real marks directory members as engaged, so this deliberately does not.
|
|
138
|
+
|
|
139
|
+
**Input**
|
|
140
|
+
|
|
141
|
+
| Field | Type | Required | Description |
|
|
142
|
+
|---|---|---|---|
|
|
143
|
+
| `query.number` | `string` | no | The number to resolve, E.164. OPTIONAL: with no main line set yet, omitting it returns the organisation's receptionists, which is exactly the list to choose one from. default `""` |
|
|
144
|
+
|
|
145
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
146
|
+
|
|
147
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
148
|
+
|
|
149
|
+
**Example**
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
const result = await g8.api.phoneNumbers.getVoiceAnsweringAgent();
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
<a id="op-provisionvoicenumber"></a>
|
|
158
|
+
|
|
159
|
+
### `g8.api.phoneNumbers.provisionVoiceNumber(input)`
|
|
160
|
+
|
|
161
|
+
**Register a number with the voice platform**
|
|
162
|
+
|
|
163
|
+
- HTTP: `POST /api/v1/voice/numbers/provision`
|
|
164
|
+
- operationId: `provision_voice_number_voice_numbers_provision_post` (also callable as `g8.api.call("provision_voice_number_voice_numbers_provision_post", input)`)
|
|
165
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
166
|
+
- API-key scope: `voice:write`
|
|
167
|
+
|
|
168
|
+
Wire an already-owned number into the voice platform.
|
|
169
|
+
|
|
170
|
+
BUYS NOTHING. Voice calls this operation `purchase` and it is published
|
|
171
|
+
here as `provision` deliberately: it creates SIP trunks and dispatch rules
|
|
172
|
+
for a number you already hold, while `POST /phone-numbers/purchase` is the
|
|
173
|
+
one that spends credits and buys a DID. Two operations both called
|
|
174
|
+
"purchase", one of which takes money and one of which does not, is not a
|
|
175
|
+
distinction to leave to a docstring.
|
|
176
|
+
|
|
177
|
+
IDEMPOTENT: a number already registered comes back as success rather than
|
|
178
|
+
an error, and an unverified Telnyx number has its caller-ID verification
|
|
179
|
+
re-queued on the way through.
|
|
180
|
+
|
|
181
|
+
Reach for this to repair a purchase whose voice half failed, or to adopt a
|
|
182
|
+
number bought outside graph8. `org_id` is taken from the API key.
|
|
183
|
+
|
|
184
|
+
**Input**
|
|
185
|
+
|
|
186
|
+
| Field | Type | Required | Description |
|
|
187
|
+
|---|---|---|---|
|
|
188
|
+
| `body` | `VoiceNumberProvisionRequest` | yes | Request body; fields below. |
|
|
189
|
+
|
|
190
|
+
Body fields (`VoiceNumberProvisionRequest`):
|
|
191
|
+
|
|
192
|
+
| Field | Type | Required | Description |
|
|
193
|
+
|---|---|---|---|
|
|
194
|
+
| `body.number` | `string` | yes | The number to register, E.164. You must already own it. |
|
|
195
|
+
| `body.assigned_to` | `string \| null` | no | Email of the person this number rings for. REQUIRED in practice for a `work` number: without it no phone-directory row is created, so the receptionist can never route to them by name. |
|
|
196
|
+
| `body.dialer` | `boolean` | no | Provision as a dialer number (no LiveKit). default `false` |
|
|
197
|
+
| `body.inbound_type` | `"ai" \| "sdr" \| "dialer" \| "work" \| null` | no | How inbound calls are answered. Ignored when `dialer` or `work` is set - those paths provision no LiveKit trunks at all and the type is forced to `dialer` / `work` respectively. default `"ai"` |
|
|
198
|
+
| `body.provider` | `"twilio" \| "telnyx"` | no | Which carrier holds the number. default `"twilio"` |
|
|
199
|
+
| `body.work` | `boolean` | no | Provision as someone's personal work phone. Implies `dialer`. default `false` |
|
|
200
|
+
|
|
201
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
202
|
+
|
|
203
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
204
|
+
|
|
205
|
+
**Example**
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
const result = await g8.api.phoneNumbers.provisionVoiceNumber({ body: { number: "example" } });
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
<a id="op-purchasephonenumber"></a>
|
|
214
|
+
|
|
215
|
+
### `g8.api.phoneNumbers.purchasePhoneNumber(input)`
|
|
216
|
+
|
|
217
|
+
**Buy a phone number**
|
|
218
|
+
|
|
219
|
+
- HTTP: `POST /api/v1/phone-numbers/purchase`
|
|
220
|
+
- operationId: `purchase_phone_number_phone_numbers_purchase_post` (also callable as `g8.api.call("purchase_phone_number_phone_numbers_purchase_post", input)`)
|
|
221
|
+
- Tier: `billable`: spends credits; the SDK never blindly retries it; confirm cost before bulk use
|
|
222
|
+
- API-key scope: `voice:run`
|
|
223
|
+
|
|
224
|
+
Buy a number from Twilio or Telnyx. THIS SPENDS CREDITS AND REAL MONEY.
|
|
225
|
+
|
|
226
|
+
Charged on PURCHASE, not on first use: the handler holds credits, buys the
|
|
227
|
+
number from the carrier, stores it, registers it with the voice platform
|
|
228
|
+
and only then converts the hold to a charge. A number bought and never
|
|
229
|
+
dialled has still cost.
|
|
230
|
+
|
|
231
|
+
Not idempotent by number - buy the same number twice and the second call
|
|
232
|
+
is a 409 rather than a second charge, but a retry after a timeout you
|
|
233
|
+
cannot see the outcome of may have already succeeded. Send an
|
|
234
|
+
`Idempotency-Key` header; every POST on this API honours it.
|
|
235
|
+
|
|
236
|
+
`402` means insufficient credits and is the one failure worth handling
|
|
237
|
+
distinctly - the number was not bought and nothing was charged.
|
|
238
|
+
|
|
239
|
+
**Input**
|
|
240
|
+
|
|
241
|
+
| Field | Type | Required | Description |
|
|
242
|
+
|---|---|---|---|
|
|
243
|
+
| `body` | `PurchasePhoneRequest` | yes | Request body; fields below. |
|
|
244
|
+
|
|
245
|
+
Body fields (`PurchasePhoneRequest`):
|
|
246
|
+
|
|
247
|
+
| Field | Type | Required | Description |
|
|
248
|
+
|---|---|---|---|
|
|
249
|
+
| `body.phone_number` | `string` | yes | The number to buy, E.164 (e.g. `+14155550123`). Search for one first. |
|
|
250
|
+
| `body.provider` | `"twilio" \| "telnyx"` | yes | Which carrier to buy it from. |
|
|
251
|
+
| `body.assignee` | `string \| null` | no | Who the number belongs to. Defaults to the identity behind the API key, matching the app - it is never taken from the body's organisation, because there is no organisation in the body. |
|
|
252
|
+
| `body.dialer` | `boolean` | no | True provisions a dialer number; false provisions a voice-AI number. default `true` |
|
|
253
|
+
| `body.work` | `boolean` | no | True makes this someone's personal work phone - provisioned like a dialer number but tagged `work`, and never part of the outbound caller-ID rotation pool. default `false` |
|
|
254
|
+
|
|
255
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
256
|
+
|
|
257
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
258
|
+
|
|
259
|
+
**Example**
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
// billable: spends credits; the SDK never blindly retries it; confirm cost before bulk use.
|
|
263
|
+
const result = await g8.api.phoneNumbers.purchasePhoneNumber({ body: { phone_number: "+15555550100", provider: "twilio" } });
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
<a id="op-reconcilea2pregistration"></a>
|
|
269
|
+
|
|
270
|
+
### `g8.api.phoneNumbers.reconcileA2pRegistration(input?)`
|
|
271
|
+
|
|
272
|
+
**Re-run A2P registration for stuck numbers**
|
|
273
|
+
|
|
274
|
+
- HTTP: `POST /api/v1/phone-numbers/a2p/reconcile`
|
|
275
|
+
- operationId: `reconcile_a2p_registration_phone_numbers_a2p_reconcile_post` (also callable as `g8.api.call("reconcile_a2p_registration_phone_numbers_a2p_reconcile_post", input)`)
|
|
276
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
277
|
+
- API-key scope: `voice:write`
|
|
278
|
+
|
|
279
|
+
Re-attach this organisation's pending or failed numbers to its A2P
|
|
280
|
+
messaging service.
|
|
281
|
+
|
|
282
|
+
The repair step, not the registration step. A worker already does this
|
|
283
|
+
every six hours; this is how to stop waiting for it after fixing whatever
|
|
284
|
+
made a number fail. It re-runs against numbers whose status is pending or
|
|
285
|
+
failed and leaves registered ones alone, so it is safe to call repeatedly.
|
|
286
|
+
|
|
287
|
+
Tiered as an ordinary write rather than a spend: it reconciles state the
|
|
288
|
+
`/a2p/register` submission already paid for and starts no new registration.
|
|
289
|
+
|
|
290
|
+
`503` means the messaging service is not configured for this environment,
|
|
291
|
+
which is a deployment fact rather than anything the caller did wrong.
|
|
292
|
+
|
|
293
|
+
**Input**: none.
|
|
294
|
+
|
|
295
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
296
|
+
|
|
297
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
298
|
+
|
|
299
|
+
**Example**
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
const result = await g8.api.phoneNumbers.reconcileA2pRegistration();
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
<a id="op-releasephonenumber"></a>
|
|
308
|
+
|
|
309
|
+
### `g8.api.phoneNumbers.releasePhoneNumber(input)`
|
|
310
|
+
|
|
311
|
+
**Release a phone number**
|
|
312
|
+
|
|
313
|
+
- HTTP: `POST /api/v1/phone-numbers/release`
|
|
314
|
+
- operationId: `release_phone_number_phone_numbers_release_post` (also callable as `g8.api.call("release_phone_number_phone_numbers_release_post", input)`)
|
|
315
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
316
|
+
- API-key scope: `voice:delete`
|
|
317
|
+
|
|
318
|
+
Give a number back to the carrier. IRREVERSIBLE.
|
|
319
|
+
|
|
320
|
+
The number returns to the provider's pool and can be bought by anyone,
|
|
321
|
+
including a competitor. Inbound calls and messages to it stop reaching
|
|
322
|
+
this organisation immediately; there is no grace period and no undo.
|
|
323
|
+
|
|
324
|
+
Order matters and is not transactional: the carrier release happens first,
|
|
325
|
+
then voice deregistration (best-effort), then the local record. A failure
|
|
326
|
+
after the carrier release leaves the number gone but the record behind -
|
|
327
|
+
which is why this returns the outcome rather than a bare 204.
|
|
328
|
+
|
|
329
|
+
**Input**
|
|
330
|
+
|
|
331
|
+
| Field | Type | Required | Description |
|
|
332
|
+
|---|---|---|---|
|
|
333
|
+
| `body` | `ReleasePhoneRequest` | yes | Request body; fields below. |
|
|
334
|
+
|
|
335
|
+
Body fields (`ReleasePhoneRequest`):
|
|
336
|
+
|
|
337
|
+
| Field | Type | Required | Description |
|
|
338
|
+
|---|---|---|---|
|
|
339
|
+
| `body.phone_number` | `string` | yes | The number to release, E.164. |
|
|
340
|
+
| `body.provider` | `"twilio" \| "telnyx"` | yes | The carrier that holds it. It must match what the number was bought from - releasing a Telnyx number as `twilio` reaches the wrong provider. |
|
|
341
|
+
|
|
342
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
343
|
+
|
|
344
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
345
|
+
|
|
346
|
+
**Example**
|
|
347
|
+
|
|
348
|
+
```ts
|
|
349
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
350
|
+
const result = await g8.api.phoneNumbers.releasePhoneNumber({ body: { phone_number: "+15555550100", provider: "twilio" } });
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
<a id="op-resetvoicedailycounts"></a>
|
|
356
|
+
|
|
357
|
+
### `g8.api.phoneNumbers.resetVoiceDailyCounts(input?)`
|
|
358
|
+
|
|
359
|
+
**Reset today's per-number dialing counters**
|
|
360
|
+
|
|
361
|
+
- HTTP: `DELETE /api/v1/voice/numbers/daily-counts`
|
|
362
|
+
- operationId: `reset_voice_daily_counts_voice_numbers_daily_counts_delete` (also callable as `g8.api.call("reset_voice_daily_counts_voice_numbers_daily_counts_delete", input)`)
|
|
363
|
+
- Tier: `destructive`: deletes or archives data; confirm with a human before calling
|
|
364
|
+
- API-key scope: `voice:delete`
|
|
365
|
+
|
|
366
|
+
Clear today's outbound call counters for every number in this
|
|
367
|
+
organisation.
|
|
368
|
+
|
|
369
|
+
THIS REMOVES A CAP, it does not report on one. Each caller ID has a daily
|
|
370
|
+
outbound limit (40 for US numbers, 60 international) that exists to keep
|
|
371
|
+
carriers from flagging the number; resetting the counter lets those numbers
|
|
372
|
+
dial past the limit they have already reached today.
|
|
373
|
+
|
|
374
|
+
ADMIN-ONLY, and deliberately stricter than voice, which leaves this route
|
|
375
|
+
ungated as an internal operations endpoint with no end-user caller. A
|
|
376
|
+
customer-facing key that can quietly lift a carrier-reputation control is
|
|
377
|
+
not something to publish on the same grant as renaming a number. Machine
|
|
378
|
+
keys are refused outright.
|
|
379
|
+
|
|
380
|
+
Counters reset on their own at midnight US Eastern. `deleted` is how many
|
|
381
|
+
counter keys were actually cleared - zero is a normal answer for an
|
|
382
|
+
organisation that has not dialled today.
|
|
383
|
+
|
|
384
|
+
**Input**: none.
|
|
385
|
+
|
|
386
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
387
|
+
|
|
388
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
389
|
+
|
|
390
|
+
**Example**
|
|
391
|
+
|
|
392
|
+
```ts
|
|
393
|
+
// destructive: deletes or archives data; confirm with a human before calling.
|
|
394
|
+
const result = await g8.api.phoneNumbers.resetVoiceDailyCounts();
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
<a id="op-savea2pinputs"></a>
|
|
400
|
+
|
|
401
|
+
### `g8.api.phoneNumbers.saveA2pInputs(input)`
|
|
402
|
+
|
|
403
|
+
**Save A2P brand and campaign details**
|
|
404
|
+
|
|
405
|
+
- HTTP: `POST /api/v1/phone-numbers/a2p/inputs`
|
|
406
|
+
- operationId: `save_a2p_inputs_phone_numbers_a2p_inputs_post` (also callable as `g8.api.call("save_a2p_inputs_phone_numbers_a2p_inputs_post", input)`)
|
|
407
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
408
|
+
- API-key scope: `voice:write`
|
|
409
|
+
|
|
410
|
+
Save the brand and campaign details WITHOUT submitting them.
|
|
411
|
+
|
|
412
|
+
Nothing reaches a carrier and nothing is charged. This is the draft step -
|
|
413
|
+
call it as often as you like, then submit once with `/a2p/register`.
|
|
414
|
+
|
|
415
|
+
The save REPLACES what was there rather than merging, so send the whole
|
|
416
|
+
object each time.
|
|
417
|
+
|
|
418
|
+
**Input**
|
|
419
|
+
|
|
420
|
+
| Field | Type | Required | Description |
|
|
421
|
+
|---|---|---|---|
|
|
422
|
+
| `body` | `A2pRegisterRequest` | yes | Request body; fields below. |
|
|
423
|
+
|
|
424
|
+
Body fields (`A2pRegisterRequest`):
|
|
425
|
+
|
|
426
|
+
| Field | Type | Required | Description |
|
|
427
|
+
|---|---|---|---|
|
|
428
|
+
| `body.brand_inputs` | `Record<string, unknown>` | no | The legal business behind the messages: `legal_business_name` (required before registration can start), plus `ein`, `address`, `website`, `business_type`, `vertical` and whatever else the carrier registry asks for. |
|
|
429
|
+
| `body.campaign_inputs` | `Record<string, unknown>` | no | What the messages are: `use_case`, `message_samples` and `opt_in_method` are the three the platform checks for before it considers the inputs complete. |
|
|
430
|
+
|
|
431
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `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.phoneNumbers.saveA2pInputs({ body: {} });
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
<a id="op-searchavailablephonenumbers"></a>
|
|
444
|
+
|
|
445
|
+
### `g8.api.phoneNumbers.searchAvailablePhoneNumbers(input)`
|
|
446
|
+
|
|
447
|
+
**Search Available Phone Numbers**
|
|
448
|
+
|
|
449
|
+
- HTTP: `POST /api/v1/phone-numbers/search`
|
|
450
|
+
- operationId: `search_available_phone_numbers_phone_numbers_search_post` (also callable as `g8.api.call("search_available_phone_numbers_phone_numbers_search_post", input)`)
|
|
451
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
452
|
+
- API-key scope: `voice:read`
|
|
453
|
+
|
|
454
|
+
Numbers a carrier has available to buy. Buy one with `POST /phone-numbers/purchase`.
|
|
455
|
+
|
|
456
|
+
**Input**
|
|
457
|
+
|
|
458
|
+
| Field | Type | Required | Description |
|
|
459
|
+
|---|---|---|---|
|
|
460
|
+
| `body` | `PhoneNumberSearchRequest` | yes | Request body; fields below. |
|
|
461
|
+
|
|
462
|
+
Body fields (`PhoneNumberSearchRequest`):
|
|
463
|
+
|
|
464
|
+
| Field | Type | Required | Description |
|
|
465
|
+
|---|---|---|---|
|
|
466
|
+
| `body.provider` | `string` | yes | The carrier to search - the same values `POST /phone-numbers/purchase` takes. |
|
|
467
|
+
| `body.area_code` | `string \| null` | no | |
|
|
468
|
+
| `body.country` | `string` | no | ISO country code. default `"US"` |
|
|
469
|
+
| `body.locality` | `string \| null` | no | City. Use this or `pattern`, not both. |
|
|
470
|
+
| `body.match` | `string` | no | Where `pattern` must appear: `first`, `anywhere` or `last`. default `"first"` |
|
|
471
|
+
| `body.number_type` | `string` | no | `local` or `toll_free`. default `"local"` |
|
|
472
|
+
| `body.pattern` | `string \| null` | no | Digits or a phrase the number must contain. |
|
|
473
|
+
|
|
474
|
+
**Returns** `ApiResponse_PhoneNumberSearchPayload_`: the envelope `{ data: PhoneNumberSearchPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
475
|
+
|
|
476
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
477
|
+
|
|
478
|
+
`PhoneNumberSearchPayload` fields:
|
|
479
|
+
|
|
480
|
+
| Field | Type | Required | Description |
|
|
481
|
+
|---|---|---|---|
|
|
482
|
+
| `items` | `Array<unknown>` | no | |
|
|
483
|
+
|
|
484
|
+
**Example**
|
|
485
|
+
|
|
486
|
+
```ts
|
|
487
|
+
const result = await g8.api.phoneNumbers.searchAvailablePhoneNumbers({ body: { provider: "example" } });
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
<a id="op-starta2pregistration"></a>
|
|
493
|
+
|
|
494
|
+
### `g8.api.phoneNumbers.startA2pRegistration(input)`
|
|
495
|
+
|
|
496
|
+
**Submit A2P 10DLC registration**
|
|
497
|
+
|
|
498
|
+
- HTTP: `POST /api/v1/phone-numbers/a2p/register`
|
|
499
|
+
- operationId: `start_a2p_registration_phone_numbers_a2p_register_post` (also callable as `g8.api.call("start_a2p_registration_phone_numbers_a2p_register_post", input)`)
|
|
500
|
+
- Tier: `external`: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first
|
|
501
|
+
- API-key scope: `voice:run`
|
|
502
|
+
|
|
503
|
+
Submit the organisation to the US carrier registry. THIS REACHES A
|
|
504
|
+
THIRD PARTY AND CARRIES CARRIER FEES.
|
|
505
|
+
|
|
506
|
+
Saves the inputs, then starts a durable registration saga and returns its
|
|
507
|
+
`workflow_id` immediately - registration takes days, not seconds, and the
|
|
508
|
+
carriers can reject it. Without an approved registration, US carriers
|
|
509
|
+
filter application-to-person SMS from these numbers, so this is not
|
|
510
|
+
optional for messaging.
|
|
511
|
+
|
|
512
|
+
IDEMPOTENT PER ORGANISATION: the workflow id is derived from the org, so a
|
|
513
|
+
second call while one is running is a no-op rather than a second
|
|
514
|
+
submission. Call `/a2p/inputs` first if you only want to save a draft.
|
|
515
|
+
|
|
516
|
+
**Input**
|
|
517
|
+
|
|
518
|
+
| Field | Type | Required | Description |
|
|
519
|
+
|---|---|---|---|
|
|
520
|
+
| `body` | `A2pRegisterRequest` | yes | Request body; fields below. |
|
|
521
|
+
|
|
522
|
+
Body fields (`A2pRegisterRequest`):
|
|
523
|
+
|
|
524
|
+
| Field | Type | Required | Description |
|
|
525
|
+
|---|---|---|---|
|
|
526
|
+
| `body.brand_inputs` | `Record<string, unknown>` | no | The legal business behind the messages: `legal_business_name` (required before registration can start), plus `ein`, `address`, `website`, `business_type`, `vertical` and whatever else the carrier registry asks for. |
|
|
527
|
+
| `body.campaign_inputs` | `Record<string, unknown>` | no | What the messages are: `use_case`, `message_samples` and `opt_in_method` are the three the platform checks for before it considers the inputs complete. |
|
|
528
|
+
|
|
529
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
530
|
+
|
|
531
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
532
|
+
|
|
533
|
+
**Example**
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
// external: reaches real people (sends email/SMS, places a call, launches a send); the SDK never blindly retries it; confirm with a human first.
|
|
537
|
+
const result = await g8.api.phoneNumbers.startA2pRegistration({ body: {} });
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
<a id="op-updatephoneassignee"></a>
|
|
543
|
+
|
|
544
|
+
### `g8.api.phoneNumbers.updatePhoneAssignee(input)`
|
|
545
|
+
|
|
546
|
+
**Reassign a phone number**
|
|
547
|
+
|
|
548
|
+
- HTTP: `PATCH /api/v1/phone-numbers/update-assignee`
|
|
549
|
+
- operationId: `update_phone_assignee_phone_numbers_update_assignee_patch` (also callable as `g8.api.call("update_phone_assignee_phone_numbers_update_assignee_patch", input)`)
|
|
550
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
551
|
+
- API-key scope: `voice:write`
|
|
552
|
+
|
|
553
|
+
Move a number to a different person, and tell voice about it.
|
|
554
|
+
|
|
555
|
+
Not a label: the assignee drives inbound ring targeting, missed-call
|
|
556
|
+
notification and which numbers appear in that person's outbound caller-ID
|
|
557
|
+
rotation pool.
|
|
558
|
+
|
|
559
|
+
ADMIN-ONLY through this API. The app also accepts the number's current
|
|
560
|
+
assignee or its creator, but an API key is an ORGANISATION credential with
|
|
561
|
+
no `user_id`, so it can never be either - leaving it to fall through to the
|
|
562
|
+
role check is what made this route 403 for every key before the role was
|
|
563
|
+
supplied.
|
|
564
|
+
|
|
565
|
+
**Input**
|
|
566
|
+
|
|
567
|
+
| Field | Type | Required | Description |
|
|
568
|
+
|---|---|---|---|
|
|
569
|
+
| `body` | `UpdateAssigneeRequest` | yes | Request body; fields below. |
|
|
570
|
+
|
|
571
|
+
Body fields (`UpdateAssigneeRequest`):
|
|
572
|
+
|
|
573
|
+
| Field | Type | Required | Description |
|
|
574
|
+
|---|---|---|---|
|
|
575
|
+
| `body.assignee` | `string` | yes | Who owns it now. This drives inbound ring targeting, missed-call notification and the outbound caller-ID pool - it is not a label. |
|
|
576
|
+
| `body.phone_number` | `string` | yes | The number to reassign, E.164. |
|
|
577
|
+
|
|
578
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
579
|
+
|
|
580
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
581
|
+
|
|
582
|
+
**Example**
|
|
583
|
+
|
|
584
|
+
```ts
|
|
585
|
+
const result = await g8.api.phoneNumbers.updatePhoneAssignee({ body: { assignee: "example", phone_number: "+15555550100" } });
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
<a id="op-updatephonecapabilities"></a>
|
|
591
|
+
|
|
592
|
+
### `g8.api.phoneNumbers.updatePhoneCapabilities(input)`
|
|
593
|
+
|
|
594
|
+
**Switch a number between dialer and voice AI**
|
|
595
|
+
|
|
596
|
+
- HTTP: `PATCH /api/v1/phone-numbers/update-capabilities`
|
|
597
|
+
- operationId: `update_phone_capabilities_phone_numbers_update_capabilities_patch` (also callable as `g8.api.call("update_phone_capabilities_phone_numbers_update_capabilities_patch", input)`)
|
|
598
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
599
|
+
- API-key scope: `voice:write`
|
|
600
|
+
|
|
601
|
+
Change what a number is for, and re-provision it to match.
|
|
602
|
+
|
|
603
|
+
This reaches the voice platform: the LiveKit trunks and the carrier
|
|
604
|
+
`voice_url` are re-pointed so inbound calls arrive where the new capability
|
|
605
|
+
says they should. A number is briefly answering neither while that happens.
|
|
606
|
+
|
|
607
|
+
The two flags are not independent. `dialer` set with `voice` unset means
|
|
608
|
+
dialer; every other combination means voice AI - which is the app's own
|
|
609
|
+
derivation, mirrored rather than reinvented.
|
|
610
|
+
|
|
611
|
+
Admin-only for the same reason as `update-assignee`.
|
|
612
|
+
|
|
613
|
+
**Input**
|
|
614
|
+
|
|
615
|
+
| Field | Type | Required | Description |
|
|
616
|
+
|---|---|---|---|
|
|
617
|
+
| `body` | `UpdateCapabilitiesRequest` | yes | Request body; fields below. |
|
|
618
|
+
|
|
619
|
+
Body fields (`UpdateCapabilitiesRequest`):
|
|
620
|
+
|
|
621
|
+
| Field | Type | Required | Description |
|
|
622
|
+
|---|---|---|---|
|
|
623
|
+
| `body.phone_number` | `string` | yes | The number to reconfigure, E.164. |
|
|
624
|
+
| `body.dialer` | `boolean` | no | Use the number for outbound dialing. default `false` |
|
|
625
|
+
| `body.voice` | `boolean` | no | Answer inbound calls with a voice AI agent. default `false` |
|
|
626
|
+
|
|
627
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
628
|
+
|
|
629
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
630
|
+
|
|
631
|
+
**Example**
|
|
632
|
+
|
|
633
|
+
```ts
|
|
634
|
+
const result = await g8.api.phoneNumbers.updatePhoneCapabilities({ body: { phone_number: "+15555550100" } });
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
<a id="op-updatevoiceassignee"></a>
|
|
640
|
+
|
|
641
|
+
### `g8.api.phoneNumbers.updateVoiceAssignee(input)`
|
|
642
|
+
|
|
643
|
+
**Set a number's voice-side assignee**
|
|
644
|
+
|
|
645
|
+
- HTTP: `PATCH /api/v1/voice/numbers/assignee`
|
|
646
|
+
- operationId: `update_voice_assignee_voice_numbers_assignee_patch` (also callable as `g8.api.call("update_voice_assignee_voice_numbers_assignee_patch", input)`)
|
|
647
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
648
|
+
- API-key scope: `voice:write`
|
|
649
|
+
|
|
650
|
+
Point a number's voice-side assignment at someone else.
|
|
651
|
+
|
|
652
|
+
The VOICE half of `PATCH /phone-numbers/update-assignee`, which does this
|
|
653
|
+
and updates the CDP record. Published separately because the app's
|
|
654
|
+
propagation to voice is best-effort and only logs a warning when it fails -
|
|
655
|
+
so the two records can disagree, and this is the way to reconcile them
|
|
656
|
+
without re-running the whole reassignment.
|
|
657
|
+
|
|
658
|
+
Sending `assigned_to: ""` clears the assignment. Assigning a WORK number
|
|
659
|
+
also creates the person's phone-directory row, which is what makes them
|
|
660
|
+
findable by name to the receptionist.
|
|
661
|
+
|
|
662
|
+
**Input**
|
|
663
|
+
|
|
664
|
+
| Field | Type | Required | Description |
|
|
665
|
+
|---|---|---|---|
|
|
666
|
+
| `body` | `VoiceAssigneeRequest` | yes | Request body; fields below. |
|
|
667
|
+
|
|
668
|
+
Body fields (`VoiceAssigneeRequest`):
|
|
669
|
+
|
|
670
|
+
| Field | Type | Required | Description |
|
|
671
|
+
|---|---|---|---|
|
|
672
|
+
| `body.assigned_to` | `string` | yes | Email of the new assignee, or `""` to clear it. Normalised by voice before storage so inbound ring targeting, the dialer assignee filter and per-rep stat redaction all compare equal. |
|
|
673
|
+
| `body.number` | `string` | yes | The number to reassign, E.164. |
|
|
674
|
+
|
|
675
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
676
|
+
|
|
677
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
678
|
+
|
|
679
|
+
**Example**
|
|
680
|
+
|
|
681
|
+
```ts
|
|
682
|
+
const result = await g8.api.phoneNumbers.updateVoiceAssignee({ body: { assigned_to: "+15555550100", number: "example" } });
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
<a id="op-updatevoiceinboundtype"></a>
|
|
688
|
+
|
|
689
|
+
### `g8.api.phoneNumbers.updateVoiceInboundType(input)`
|
|
690
|
+
|
|
691
|
+
**Change what answers a number's inbound calls**
|
|
692
|
+
|
|
693
|
+
- HTTP: `PATCH /api/v1/voice/numbers/inbound-type`
|
|
694
|
+
- operationId: `update_voice_inbound_type_voice_numbers_inbound_type_patch` (also callable as `g8.api.call("update_voice_inbound_type_voice_numbers_inbound_type_patch", input)`)
|
|
695
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
696
|
+
- API-key scope: `voice:write`
|
|
697
|
+
|
|
698
|
+
Retype a number between AI answering, SDR answering and the dialer.
|
|
699
|
+
|
|
700
|
+
NOT a label change, and not free. Moving to `dialer` DESTROYS the LiveKit
|
|
701
|
+
dispatch rule and both SIP trunks and repoints the carrier webhook; moving
|
|
702
|
+
away from it builds them again. The number answers nothing in between, and
|
|
703
|
+
the teardown is best-effort - a failed trunk delete is logged and the
|
|
704
|
+
retype continues.
|
|
705
|
+
|
|
706
|
+
Retyping to the mode it is already in is a no-op, so this is safe to retry.
|
|
707
|
+
|
|
708
|
+
Voice compares the number's own `org_id` against the one sent, and this
|
|
709
|
+
route sends the API key's - so another organisation's number is a 404
|
|
710
|
+
rather than a silent retype.
|
|
711
|
+
|
|
712
|
+
**Input**
|
|
713
|
+
|
|
714
|
+
| Field | Type | Required | Description |
|
|
715
|
+
|---|---|---|---|
|
|
716
|
+
| `body` | `VoiceInboundTypeRequest` | yes | Request body; fields below. |
|
|
717
|
+
|
|
718
|
+
Body fields (`VoiceInboundTypeRequest`):
|
|
719
|
+
|
|
720
|
+
| Field | Type | Required | Description |
|
|
721
|
+
|---|---|---|---|
|
|
722
|
+
| `body.inbound_type` | `"ai" \| "sdr" \| "dialer" \| "work"` | yes | The answering mode to switch to. |
|
|
723
|
+
| `body.number` | `string` | yes | The number to retype, E.164. |
|
|
724
|
+
|
|
725
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
726
|
+
|
|
727
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
728
|
+
|
|
729
|
+
**Example**
|
|
730
|
+
|
|
731
|
+
```ts
|
|
732
|
+
const result = await g8.api.phoneNumbers.updateVoiceInboundType({ body: { inbound_type: "ai", number: "example" } });
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
---
|
|
736
|
+
|
|
737
|
+
<a id="op-verifyvoicecallerid"></a>
|
|
738
|
+
|
|
739
|
+
### `g8.api.phoneNumbers.verifyVoiceCallerId(input)`
|
|
740
|
+
|
|
741
|
+
**Verify a Telnyx number as a caller ID**
|
|
742
|
+
|
|
743
|
+
- HTTP: `POST /api/v1/voice/numbers/verify-caller-id/{phone_number}`
|
|
744
|
+
- operationId: `verify_voice_caller_id_voice_numbers_verify_caller_id__phone_number__post` (also callable as `g8.api.call("verify_voice_caller_id_voice_numbers_verify_caller_id__phone_number__post", input)`)
|
|
745
|
+
- Tier: `write`: creates or changes records; the SDK sends an Idempotency-Key and retries transient failures
|
|
746
|
+
- API-key scope: `voice:write`
|
|
747
|
+
|
|
748
|
+
Start caller-ID verification for a Telnyx number.
|
|
749
|
+
|
|
750
|
+
ONLY Telnyx numbers need this, and asking for a Twilio one is a 400 rather
|
|
751
|
+
than a silent success - Twilio DIDs are valid callers by construction and
|
|
752
|
+
have no verification record at all.
|
|
753
|
+
|
|
754
|
+
Verification takes minutes, so this returns immediately with either
|
|
755
|
+
`already_verified` or `verification_started`; poll
|
|
756
|
+
`GET /voice/dialer/numbers` and read `caller_id_verified`. An unverified
|
|
757
|
+
Telnyx number is a real number that simply cannot be dialled FROM, which is
|
|
758
|
+
why it is kept out of the rotation pool rather than failing mid-session.
|
|
759
|
+
|
|
760
|
+
Same ownership check as the delete above, for the same reason: voice looks
|
|
761
|
+
the number up by bare value.
|
|
762
|
+
|
|
763
|
+
**Input**
|
|
764
|
+
|
|
765
|
+
| Field | Type | Required | Description |
|
|
766
|
+
|---|---|---|---|
|
|
767
|
+
| `path.phone_number` | `string` | yes | The number to verify, E.164. |
|
|
768
|
+
|
|
769
|
+
**Returns** `ApiResponse_PhoneNumberPayload_`: the envelope `{ data: PhoneNumberPayload, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
770
|
+
|
|
771
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
772
|
+
|
|
773
|
+
**Example**
|
|
774
|
+
|
|
775
|
+
```ts
|
|
776
|
+
const result = await g8.api.phoneNumbers.verifyVoiceCallerId({ path: { phone_number: "+15555550100" } });
|
|
777
|
+
```
|