@sippulse/niva-sdk 0.1.0-rc.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/LICENSE +190 -0
- package/README.md +153 -0
- package/dts/src/client.d.ts +6 -0
- package/dts/src/entry/index.bun.d.ts +3 -0
- package/dts/src/entry/index.default.d.ts +3 -0
- package/dts/src/entry/index.deno.d.ts +3 -0
- package/dts/src/entry/index.node.d.ts +3 -0
- package/dts/src/errors.d.ts +98 -0
- package/dts/src/generated/client-impl.d.ts +8 -0
- package/dts/src/generated/client.d.ts +1011 -0
- package/dts/src/generated/meta.d.ts +19 -0
- package/dts/src/generated/operations.d.ts +11394 -0
- package/dts/src/generated/webhooks.d.ts +425 -0
- package/dts/src/handshake.d.ts +21 -0
- package/dts/src/index.d.ts +20 -0
- package/dts/src/sse.d.ts +7 -0
- package/dts/src/transport.d.ts +56 -0
- package/dts/src/types.d.ts +40 -0
- package/dts/src/webhook/handler.d.ts +20 -0
- package/dts/src/webhook/serve-bun.d.ts +10 -0
- package/dts/src/webhook/serve-default.d.ts +6 -0
- package/dts/src/webhook/serve-deno.d.ts +10 -0
- package/dts/src/webhook/serve-node.d.ts +6 -0
- package/dts/src/webhook/server.d.ts +61 -0
- package/dts/src/webhook/verify.d.ts +17 -0
- package/index.bun.js +2829 -0
- package/index.d.ts +3 -0
- package/index.default.js +2756 -0
- package/index.deno.js +2831 -0
- package/index.node.js +2892 -0
- package/package.json +43 -0
|
@@ -0,0 +1,1011 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE - do not edit. Run `bun run generate` in packages/sdk
|
|
3
|
+
* (NIVA-258). Source: GET /api/v1/spec.json via generateOpenApiSpec().
|
|
4
|
+
*/
|
|
5
|
+
import type { NivaRequestOptions, NivaStream } from "../types.js";
|
|
6
|
+
import type { AiGetCallAnalysesInput, AiGetTranscriptionInput, AiListStructuredAnalysesInput, AiRunAnalysisInput, AiRunConfiguredAnalysesInput, AiRunSpeechAnalyticsInput, AiSearchTranscriptionsInput, AiTranscribeNowInput, ApiKeysCreateInput, ApiKeysFinishRotationInput, ApiKeysGetInput, ApiKeysListInput, ApiKeysRevokeInput, ApiKeysRotateInput, ApiKeysUpdateInput, ApiKeysUsageInput, ArchiveListDeletedInput, ArchivePurgeInput, ArchiveRestoreInput, AudioFilesContentInput, AudioFilesDeleteInput, AudioFilesGenerateTtsInput, AudioFilesGetByIdInput, AudioFilesListInput, AudioFilesPreviewUrlInput, AudioFilesRegenerateTtsInput, AudioFilesUpdateInput, AudioFilesUploadInput, AuditCountInput, AuditExportCsvInput, AuditListInput, CallRecordsCountInput, CallRecordsExportCsvInput, CallRecordsGetByIdInput, CallRecordsGetEventsInput, CallRecordsGetRecordingUrlInput, CallRecordsListInput, CallRecordsPurgeVoiceContentInput, CallRecordsRecordingContentInput, CallRecordsRetryRecordingInput, CallsHangupCallInput, CallsOriginateInput, ChannelsCreateInput, ChannelsDeleteInput, ChannelsGetByIdInput, ChannelsListInput, ChannelsTestConnectionInput, ChannelsToggleInput, ChannelsUpdateInput, ContactsGetByIdInput, ContactsListInput, ContactsUpdateInput, DestinationsCreateInput, DestinationsDeleteInput, DestinationsGetByIdInput, DestinationsListInput, DestinationsUpdateInput, DialerAttemptsListInput, DialerCampaignsControlInput, DialerCampaignsCreateInput, DialerCampaignsDeleteInput, DialerCampaignsGetInput, DialerCampaignsListInput, DialerCampaignsLiveStatsInput, DialerCampaignsStatsInput, DialerCampaignsUpdateInput, DialerContactsAddInput, DialerContactsBulkCancelInput, DialerContactsBulkRequeueInput, DialerContactsCancelInput, DialerContactsExportCsvInput, DialerContactsGetInput, DialerContactsListInput, DialerContactsRemoveInput, DialerContactsRequeueInput, DialerContactsRequeueAllInput, DialerContactsUpdateInput, DialerDncAddInput, DialerDncBulkImportInput, DialerDncBulkRemoveInput, DialerDncListInput, DialerDncRemoveInput, DialerImportsCreateInput, DialerImportsGetInput, DialerImportsInvalidRowsInput, DialerImportsProgressInput, HolidaysCreateInput, HolidaysDeleteInput, HolidaysGroupsCreateInput, HolidaysGroupsDeleteInput, HolidaysGroupsGetByIdInput, HolidaysGroupsListInput, HolidaysGroupsUpdateInput, HolidaysImportInput, HolidaysListInput, HolidaysPreviewImportInput, HolidaysUpdateInput, OauthGrantsListInput, OauthGrantsRevokeInput, OauthGrantsUsageInput, OrgSettingsUpsertDialerInput, SchedulesCreateInput, SchedulesDeleteInput, SchedulesGetByIdInput, SchedulesListInput, SchedulesUpdateInput, SecretsListInput, TtsListVoicesInput, TtsPreviewInput, UsersActivateMemberInput, UsersCreateMemberInput, UsersListMembersInput, UsersRemoveMemberInput, UsersSuspendMemberInput, UsersUpdateRoleInput, VisualPlansCloneInput, VisualPlansCreateInput, VisualPlansDeleteInput, VisualPlansGetByIdInput, VisualPlansImportDraftInput, VisualPlansListInput, VisualPlansListVersionsInput, VisualPlansPublishInput, VisualPlansUpdateInput, VisualPlansValidateInput, WebhooksDeliveriesAggregatesGetInput, WebhooksDeliveriesAggregatesListInput, WebhooksDeliveriesCountInput, WebhooksDeliveriesGetByIdInput, WebhooksDeliveriesListInput, WebhooksDeliveriesRetryInput, WebhooksEndpointsCreateInput, WebhooksEndpointsDeleteInput, WebhooksEndpointsGetByIdInput, WebhooksEndpointsListInput, WebhooksEndpointsRotateSecretInput, WebhooksEndpointsUpdateInput, AiGetBudgetOutput, AiGetBudgetOverviewOutput, AiGetCallAnalysesOutput, AiGetTranscriptionOutput, AiGetUsageOutput, AiListAgentsOutput, AiListStructuredAnalysesOutput, AiRunAnalysisOutput, AiRunConfiguredAnalysesOutput, AiRunSpeechAnalyticsOutput, AiSearchTranscriptionsOutput, AiTranscribeNowOutput, ApiKeysCreateOutput, ApiKeysFinishRotationOutput, ApiKeysGetOutput, ApiKeysListOutput, ApiKeysRevokeOutput, ApiKeysRotateOutput, ApiKeysUpdateOutput, ApiKeysUsageOutput, ArchiveListDeletedOutput, ArchivePurgeOutput, ArchiveRestoreOutput, ArchiveSummaryOutput, AudioFilesDeleteOutput, AudioFilesGenerateTtsOutput, AudioFilesGetByIdOutput, AudioFilesListOutput, AudioFilesRegenerateTtsOutput, AudioFilesUpdateOutput, AudioFilesUploadOutput, AuditCountOutput, AuditListOutput, CallRecordsCountOutput, CallRecordsGetByIdOutput, CallRecordsGetEventsOutput, CallRecordsGetRecordingUrlOutput, CallRecordsListOutput, CallRecordsPurgeVoiceContentOutput, CallRecordsRetryRecordingOutput, CallsHangupCallOutput, CallsOriginateOutput, CapabilitiesGetOutput, ChannelsCreateOutput, ChannelsDeleteOutput, ChannelsGetByIdOutput, ChannelsListOutput, ChannelsTestConnectionOutput, ChannelsToggleOutput, ChannelsUpdateOutput, ContactsGetByIdOutput, ContactsListOutput, ContactsUpdateOutput, DashboardCapacityStatusOutput, DestinationsCreateOutput, DestinationsDeleteOutput, DestinationsGetByIdOutput, DestinationsListOutput, DestinationsUpdateOutput, DialerAttemptsListOutput, DialerCampaignsControlOutput, DialerCampaignsCreateOutput, DialerCampaignsDeleteOutput, DialerCampaignsGetOutput, DialerCampaignsListOutput, DialerCampaignsStatsOutput, DialerCampaignsSummaryOutput, DialerCampaignsUpdateOutput, DialerContactsAddOutput, DialerContactsBulkCancelOutput, DialerContactsBulkRequeueOutput, DialerContactsCancelOutput, DialerContactsGetOutput, DialerContactsListOutput, DialerContactsRemoveOutput, DialerContactsRequeueOutput, DialerContactsRequeueAllOutput, DialerContactsUpdateOutput, DialerDncAddOutput, DialerDncBulkImportOutput, DialerDncBulkRemoveOutput, DialerDncListOutput, DialerDncRemoveOutput, DialerImportsCreateOutput, DialerImportsGetOutput, DialerImportsInvalidRowsOutput, HolidaysCountriesOutput, HolidaysCreateOutput, HolidaysDeleteOutput, HolidaysGroupsCreateOutput, HolidaysGroupsDeleteOutput, HolidaysGroupsGetByIdOutput, HolidaysGroupsListOutput, HolidaysGroupsUpdateOutput, HolidaysImportOutput, HolidaysListOutput, HolidaysPreviewImportOutput, HolidaysUpdateOutput, LicenseStatusOutput, OauthGrantsListOutput, OauthGrantsRevokeOutput, OauthGrantsUsageOutput, OrgSettingsGetDialerOutput, OrgSettingsUpsertDialerOutput, SchedulesCreateOutput, SchedulesDeleteOutput, SchedulesGetByIdOutput, SchedulesListOutput, SchedulesUpdateOutput, SecretsListOutput, SecretsListNamesOutput, TtsListModelsOutput, TtsListVoicesOutput, UsersActivateMemberOutput, UsersCreateMemberOutput, UsersListMembersOutput, UsersMeOutput, UsersRemoveMemberOutput, UsersSuspendMemberOutput, UsersUpdateRoleOutput, VisualPlansCloneOutput, VisualPlansCreateOutput, VisualPlansDeleteOutput, VisualPlansGetByIdOutput, VisualPlansImportDraftOutput, VisualPlansListOutput, VisualPlansListVersionsOutput, VisualPlansPublishOutput, VisualPlansUpdateOutput, VisualPlansValidateOutput, WebhooksDeliveriesAggregatesGetOutput, WebhooksDeliveriesAggregatesListOutput, WebhooksDeliveriesCountOutput, WebhooksDeliveriesGetByIdOutput, WebhooksDeliveriesListOutput, WebhooksDeliveriesRetentionOutput, WebhooksDeliveriesRetryOutput, WebhooksEndpointsCreateOutput, WebhooksEndpointsDeleteOutput, WebhooksEndpointsGetByIdOutput, WebhooksEndpointsListOutput, WebhooksEndpointsRotateSecretOutput, WebhooksEndpointsUpdateOutput, WebhooksEventsListOutput, AuditExportCsvEvent, CallRecordsExportCsvEvent, DashboardWatchDashboardMetricsEvent, DialerCampaignsLiveStatsEvent, DialerCampaignsOrgLiveStatsEvent, DialerContactsExportCsvEvent, DialerImportsProgressEvent } from "./operations.js";
|
|
7
|
+
/** Typed client of the frozen REST contract /api/v1. */
|
|
8
|
+
export interface NivaClient {
|
|
9
|
+
ai: {
|
|
10
|
+
/**
|
|
11
|
+
* ai.getBudget operation.
|
|
12
|
+
*
|
|
13
|
+
* Returns the org's current SipPulse AI project budget status (limits and consumption). Requires the ai module and the ai:read scope.
|
|
14
|
+
*/
|
|
15
|
+
getBudget(options?: NivaRequestOptions): Promise<AiGetBudgetOutput>;
|
|
16
|
+
/**
|
|
17
|
+
* ai.getBudgetOverview operation.
|
|
18
|
+
*
|
|
19
|
+
* Returns the current SipPulse AI budget status and percentage-only composition for both budget windows. Breakdown failures are returned as null so the status remains usable. Requires the ai module and the ai:read scope.
|
|
20
|
+
*/
|
|
21
|
+
getBudgetOverview(options?: NivaRequestOptions): Promise<AiGetBudgetOverviewOutput>;
|
|
22
|
+
/**
|
|
23
|
+
* ai.getCallAnalyses operation.
|
|
24
|
+
*
|
|
25
|
+
* Returns the custom-analysis results already generated for a call as a plain array (empty when none). Read-only historical data — served even after the AI module is downgraded. Requires the call_record:read scope.
|
|
26
|
+
*/
|
|
27
|
+
getCallAnalyses(input: AiGetCallAnalysesInput, options?: NivaRequestOptions): Promise<AiGetCallAnalysesOutput>;
|
|
28
|
+
/**
|
|
29
|
+
* ai.getTranscription operation.
|
|
30
|
+
*
|
|
31
|
+
* Returns the stored transcription for a call (text, segments, language, sentiment, summary and more), or null when none exists. Read-only historical data — served even after the AI module is downgraded. Requires the call_record:read scope.
|
|
32
|
+
*/
|
|
33
|
+
getTranscription(input: AiGetTranscriptionInput, options?: NivaRequestOptions): Promise<AiGetTranscriptionOutput>;
|
|
34
|
+
/**
|
|
35
|
+
* ai.getUsage operation.
|
|
36
|
+
*
|
|
37
|
+
* Returns the org's usage metrics for the current billing period (calls, minutes, STT/TTS, LLM and embedding tokens, recording storage, webhook deliveries and peak concurrency). Requires the ai module and the ai:read scope.
|
|
38
|
+
*/
|
|
39
|
+
getUsage(options?: NivaRequestOptions): Promise<AiGetUsageOutput>;
|
|
40
|
+
/**
|
|
41
|
+
* ai.listAgents operation.
|
|
42
|
+
*
|
|
43
|
+
* Returns all of the org's SipPulse AI agents as a plain array. Each item carries sip_inbound_enabled, which tells whether that agent can answer a voice call — agents without it are listed but cannot be dialed yet. Errors with AI_NOT_CONFIGURED when the org has no usable SipPulse AI credentials, and with AI_UNREACHABLE when the upstream listing fails. Requires the ai module and the ai:read scope.
|
|
44
|
+
*/
|
|
45
|
+
listAgents(options?: NivaRequestOptions): Promise<AiListAgentsOutput>;
|
|
46
|
+
/**
|
|
47
|
+
* ai.listStructuredAnalyses operation.
|
|
48
|
+
*
|
|
49
|
+
* Returns the organization-scoped structured-analysis catalog from SipPulse AI. The catalog is cached briefly and a stale copy is returned when the upstream service is unavailable. Set refresh to force a manual refresh.
|
|
50
|
+
*/
|
|
51
|
+
listStructuredAnalyses(input?: AiListStructuredAnalysesInput, options?: NivaRequestOptions): Promise<AiListStructuredAnalysesOutput>;
|
|
52
|
+
/**
|
|
53
|
+
* ai.runAnalysis operation.
|
|
54
|
+
*
|
|
55
|
+
* Runs a SipPulse AI structured analysis against the call's transcription and returns the persisted result. The call.analysis_completed webhook contains one item for this manual execution. The legacy templateId input is accepted only during migration. Requires the ai module and the ai:execute scope.
|
|
56
|
+
*/
|
|
57
|
+
runAnalysis(input: AiRunAnalysisInput, options?: NivaRequestOptions): Promise<AiRunAnalysisOutput>;
|
|
58
|
+
/**
|
|
59
|
+
* ai.runConfiguredAnalyses operation.
|
|
60
|
+
*
|
|
61
|
+
* Runs every custom analysis configured by the call's visual plan or organization defaults in parallel, waits for all of them, persists each result independently, and emits one call.analysis_completed webhook containing every completed or failed item. Requires the ai module and the ai:execute scope.
|
|
62
|
+
*/
|
|
63
|
+
runConfiguredAnalyses(input: AiRunConfiguredAnalysesInput, options?: NivaRequestOptions): Promise<AiRunConfiguredAnalysesOutput>;
|
|
64
|
+
/**
|
|
65
|
+
* ai.runSpeechAnalytics operation.
|
|
66
|
+
*
|
|
67
|
+
* Runs speech analytics (sentiment, topics, intent) over an existing transcription. The resulting call.analysis_completed webhook contains one native analysis item, with status completed or failed. Requires the ai module and the ai:execute scope.
|
|
68
|
+
*/
|
|
69
|
+
runSpeechAnalytics(input: AiRunSpeechAnalyticsInput, options?: NivaRequestOptions): Promise<AiRunSpeechAnalyticsOutput>;
|
|
70
|
+
/**
|
|
71
|
+
* ai.searchTranscriptions operation.
|
|
72
|
+
*
|
|
73
|
+
* Semantic (vector) search over call transcriptions. Returns the top matches ranked by similarity (limit top-K, no pagination); results below the similarity threshold are excluded. Optionally scope by date range and visual plan. Requires the ai module and the ai:read scope.
|
|
74
|
+
*/
|
|
75
|
+
searchTranscriptions(input: AiSearchTranscriptionsInput, options?: NivaRequestOptions): Promise<AiSearchTranscriptionsOutput>;
|
|
76
|
+
/**
|
|
77
|
+
* ai.transcribeNow operation.
|
|
78
|
+
*
|
|
79
|
+
* Transcribes a recorded call on demand and returns the stored text, diarized segments and words. The response status is completed when ASR finishes within the synchronous window, or processing while the transcription continues in the background. An explicit request overrides the plan transcription setting and minimum duration. Pass from_node and/or to_node to transcribe only the stretch of the call between two nodes of the plan, identified by their slug; the response then carries a range block and the cut only ever narrows what the plan already allowed to be transcribed. There is one transcription per call, so a segment run replaces the previous transcript. Requires the ai module and the ai:execute scope.
|
|
80
|
+
*/
|
|
81
|
+
transcribeNow(input: AiTranscribeNowInput, options?: NivaRequestOptions): Promise<AiTranscribeNowOutput>;
|
|
82
|
+
};
|
|
83
|
+
apiKeys: {
|
|
84
|
+
/**
|
|
85
|
+
* apiKeys.create operation.
|
|
86
|
+
*
|
|
87
|
+
* Creates an API key with the given scopes and optional expiry. The response includes plain_key, the full secret shown only once here; store it immediately. Requires the api_key:create scope.
|
|
88
|
+
*/
|
|
89
|
+
create(input: ApiKeysCreateInput, options?: NivaRequestOptions): Promise<ApiKeysCreateOutput>;
|
|
90
|
+
/**
|
|
91
|
+
* apiKeys.finishRotation operation.
|
|
92
|
+
*
|
|
93
|
+
* Invalidates the previous API key secret immediately, before its grace period expires. Requires the api_key:revoke scope.
|
|
94
|
+
*/
|
|
95
|
+
finishRotation(input: ApiKeysFinishRotationInput, options?: NivaRequestOptions): Promise<ApiKeysFinishRotationOutput>;
|
|
96
|
+
/**
|
|
97
|
+
* apiKeys.get operation.
|
|
98
|
+
*
|
|
99
|
+
* Fetches one API key's metadata (name, prefix, scopes, timestamps) by id. An unknown or cross-org id returns 404 API_KEY_NOT_FOUND. The secret key material is never exposed. Requires the api_key:read scope.
|
|
100
|
+
*/
|
|
101
|
+
get(input: ApiKeysGetInput, options?: NivaRequestOptions): Promise<ApiKeysGetOutput>;
|
|
102
|
+
/**
|
|
103
|
+
* apiKeys.list operation.
|
|
104
|
+
*
|
|
105
|
+
* Returns the org's API keys as a paginated envelope. Only key metadata (name, prefix, scopes, timestamps) is returned; the secret key material is never exposed after creation. Requires the api_key:read scope.
|
|
106
|
+
*/
|
|
107
|
+
list(input?: ApiKeysListInput, options?: NivaRequestOptions): Promise<ApiKeysListOutput>;
|
|
108
|
+
/**
|
|
109
|
+
* apiKeys.revoke operation.
|
|
110
|
+
*
|
|
111
|
+
* Revokes an API key so it can no longer authenticate, returning { success: true }. An unknown id returns 404 API_KEY_NOT_FOUND. Requires the api_key:revoke scope.
|
|
112
|
+
*/
|
|
113
|
+
revoke(input: ApiKeysRevokeInput, options?: NivaRequestOptions): Promise<ApiKeysRevokeOutput>;
|
|
114
|
+
/**
|
|
115
|
+
* apiKeys.rotate operation.
|
|
116
|
+
*
|
|
117
|
+
* Replaces an API key secret in place, preserving its id, name and scopes. By default the previous secret stops working immediately; an optional grace period keeps it valid for up to 168 hours. Requires the api_key:create scope.
|
|
118
|
+
*/
|
|
119
|
+
rotate(input: ApiKeysRotateInput, options?: NivaRequestOptions): Promise<ApiKeysRotateOutput>;
|
|
120
|
+
/**
|
|
121
|
+
* apiKeys.update operation.
|
|
122
|
+
*
|
|
123
|
+
* Changes the key's name and/or scopes. The secret is untouched, and the new values apply to the next request the key makes; use rotate to replace the secret. An unknown or cross-org id returns 404 API_KEY_NOT_FOUND. Requires the api_key:create scope.
|
|
124
|
+
*/
|
|
125
|
+
update(input: ApiKeysUpdateInput, options?: NivaRequestOptions): Promise<ApiKeysUpdateOutput>;
|
|
126
|
+
/**
|
|
127
|
+
* apiKeys.usage operation.
|
|
128
|
+
*
|
|
129
|
+
* Returns which routes this API key called, how many times per day and when each route was last used, over the last `days` days (1 to 90, default 30). An unknown or cross-org id returns 404 API_KEY_NOT_FOUND. Requires the api_key:read scope.
|
|
130
|
+
*/
|
|
131
|
+
usage(input: ApiKeysUsageInput, options?: NivaRequestOptions): Promise<ApiKeysUsageOutput>;
|
|
132
|
+
};
|
|
133
|
+
archive: {
|
|
134
|
+
/**
|
|
135
|
+
* archive.listDeleted operation.
|
|
136
|
+
*
|
|
137
|
+
* Lists archived (soft-deleted) items of a single `entity_type` in a paginated envelope.
|
|
138
|
+
*/
|
|
139
|
+
listDeleted(input: ArchiveListDeletedInput, options?: NivaRequestOptions): Promise<ArchiveListDeletedOutput>;
|
|
140
|
+
/**
|
|
141
|
+
* archive.purge operation.
|
|
142
|
+
*
|
|
143
|
+
* Permanently purges an archived item; this is irreversible. Requires the `archive:purge` permission. Returns 404 ARCHIVE_ITEM_NOT_FOUND when the item does not exist.
|
|
144
|
+
*/
|
|
145
|
+
purge(input: ArchivePurgeInput, options?: NivaRequestOptions): Promise<ArchivePurgeOutput>;
|
|
146
|
+
/**
|
|
147
|
+
* archive.restore operation.
|
|
148
|
+
*
|
|
149
|
+
* Restores a soft-deleted item back to active use. Requires the target entity's own delete permission (e.g. `visual_plan:delete`) and, for API-key callers, the `archive:write` scope — a read-only key is rejected with 403 INSUFFICIENT_SCOPE. Returns 404 ARCHIVE_ITEM_NOT_FOUND when the item is absent and 409 ARCHIVE_RESTORE_CONFLICT when the restored channel is unavailable.
|
|
150
|
+
*/
|
|
151
|
+
restore(input: ArchiveRestoreInput, options?: NivaRequestOptions): Promise<ArchiveRestoreOutput>;
|
|
152
|
+
/**
|
|
153
|
+
* archive.summary operation.
|
|
154
|
+
*
|
|
155
|
+
* Returns per-entity-type counts of archived (soft-deleted) items for the organization.
|
|
156
|
+
*/
|
|
157
|
+
summary(options?: NivaRequestOptions): Promise<ArchiveSummaryOutput>;
|
|
158
|
+
};
|
|
159
|
+
audioFiles: {
|
|
160
|
+
/**
|
|
161
|
+
* audioFiles.content operation.
|
|
162
|
+
*
|
|
163
|
+
* Returns the raw audio bytes of the stored file (read into memory in full, not streamed — the library caps files at 10 MB), with the format's media type and the original filename. Supports HTTP Range requests (206 Partial Content) for seeking. Returns 404 AUDIO_FILE_NOT_FOUND when the file does not exist or belongs to another organization, and 404 AUDIO_FILE_CONTENT_MISSING when the record exists but its bytes are gone from storage.
|
|
164
|
+
*/
|
|
165
|
+
content(input: AudioFilesContentInput, options?: NivaRequestOptions & {
|
|
166
|
+
range?: string;
|
|
167
|
+
}): Promise<Response>;
|
|
168
|
+
/**
|
|
169
|
+
* audioFiles.delete operation.
|
|
170
|
+
*
|
|
171
|
+
* Deletes an audio file. Returns 409 AUDIO_FILE_IN_USE (with the referencing plan names) when the file is still used by one or more plans, and 404 AUDIO_FILE_NOT_FOUND when it does not exist. Returns `{ success: true }` on success.
|
|
172
|
+
*/
|
|
173
|
+
delete(input: AudioFilesDeleteInput, options?: NivaRequestOptions): Promise<AudioFilesDeleteOutput>;
|
|
174
|
+
/**
|
|
175
|
+
* audioFiles.generateTts operation.
|
|
176
|
+
*
|
|
177
|
+
* Synthesizes speech from the supplied text and stores it as a new TTS audio file. When `voice` and `model` are omitted they are resolved from the organization's language and active provider tier. Returns 422 TTS_VOICE_UNAVAILABLE when no voice is available for that language.
|
|
178
|
+
*/
|
|
179
|
+
generateTts(input: AudioFilesGenerateTtsInput, options?: NivaRequestOptions): Promise<AudioFilesGenerateTtsOutput>;
|
|
180
|
+
/**
|
|
181
|
+
* audioFiles.getById operation.
|
|
182
|
+
*
|
|
183
|
+
* Returns the audio file, or `null` (HTTP 200) when it does not exist or belongs to another organization.
|
|
184
|
+
*/
|
|
185
|
+
getById(input: AudioFilesGetByIdInput, options?: NivaRequestOptions): Promise<AudioFilesGetByIdOutput>;
|
|
186
|
+
/**
|
|
187
|
+
* audioFiles.list operation.
|
|
188
|
+
*
|
|
189
|
+
* Returns a paginated list of the organization's audio files (uploaded recordings and TTS-generated clips).
|
|
190
|
+
*/
|
|
191
|
+
list(input?: AudioFilesListInput, options?: NivaRequestOptions): Promise<AudioFilesListOutput>;
|
|
192
|
+
/**
|
|
193
|
+
* audioFiles.previewUrl operation.
|
|
194
|
+
*
|
|
195
|
+
* Fetches and normalizes a static HTTP(S) audio URL and returns the WAV bytes used for telephony playback.
|
|
196
|
+
*/
|
|
197
|
+
previewUrl(input: AudioFilesPreviewUrlInput, options?: NivaRequestOptions & {
|
|
198
|
+
range?: string;
|
|
199
|
+
}): Promise<Response>;
|
|
200
|
+
/**
|
|
201
|
+
* audioFiles.regenerateTts operation.
|
|
202
|
+
*
|
|
203
|
+
* Re-synthesizes the audio content of an existing TTS audio file, optionally with new text/voice/model. Returns 422 AUDIO_FILE_NOT_TTS when the file was not TTS-generated, 422 TTS_VOICE_UNAVAILABLE when no voice is available, and 404 AUDIO_FILE_NOT_FOUND when it does not exist.
|
|
204
|
+
*/
|
|
205
|
+
regenerateTts(input: AudioFilesRegenerateTtsInput, options?: NivaRequestOptions): Promise<AudioFilesRegenerateTtsOutput>;
|
|
206
|
+
/**
|
|
207
|
+
* audioFiles.update operation.
|
|
208
|
+
*
|
|
209
|
+
* Updates the audio file's name and/or description only; the audio content itself is not changed. Returns 404 AUDIO_FILE_NOT_FOUND when it does not exist.
|
|
210
|
+
*/
|
|
211
|
+
update(input: AudioFilesUpdateInput, options?: NivaRequestOptions): Promise<AudioFilesUpdateOutput>;
|
|
212
|
+
/**
|
|
213
|
+
* audioFiles.upload operation.
|
|
214
|
+
*
|
|
215
|
+
* Stores an uploaded audio file (multipart/form-data) in the organization's audio library. Accepts wav, mp3, ogg, flac and m4a up to 10 MB. Returns 400 AUDIO_FILE_INVALID_FORMAT for other extensions and 413 AUDIO_FILE_TOO_LARGE above the size cap.
|
|
216
|
+
*/
|
|
217
|
+
upload(input: AudioFilesUploadInput, options?: NivaRequestOptions): Promise<AudioFilesUploadOutput>;
|
|
218
|
+
};
|
|
219
|
+
audit: {
|
|
220
|
+
/**
|
|
221
|
+
* audit.count operation.
|
|
222
|
+
*
|
|
223
|
+
* Returns the exact number of audit-log entries matching the same filters GET /audit-logs accepts, without paging any of them. It exists so a cursor-paginated listing can show a total without paying for count(*) on every page. Requires the enterprise module - callers without it receive 403 MODULE_DISABLED.
|
|
224
|
+
*/
|
|
225
|
+
count(input?: AuditCountInput, options?: NivaRequestOptions): Promise<AuditCountOutput>;
|
|
226
|
+
/**
|
|
227
|
+
* audit.exportCsv operation.
|
|
228
|
+
*
|
|
229
|
+
* Streams the matching audit-log entries as Server-Sent Events (`text/event-stream`), one flat JSON object per row - NOT a text/csv file; the caller joins the cells itself. Repeat the multi-valued filters with brackets (`?actions[]=create&actions[]=delete`); a single bracket-less occurrence is read as a string and rejected. Capped at the 100000 most recent entries, and the stream terminates with a done event { emitted, truncated }. Requires the enterprise module - callers without it receive 403 MODULE_DISABLED.
|
|
230
|
+
*/
|
|
231
|
+
exportCsv(input?: AuditExportCsvInput, options?: NivaRequestOptions): NivaStream<AuditExportCsvEvent>;
|
|
232
|
+
/**
|
|
233
|
+
* audit.list operation.
|
|
234
|
+
*
|
|
235
|
+
* Lists audit-log entries in a paginated envelope, filterable by action, resource type and date range. A date-only dateFrom/dateTo bound (YYYY-MM-DD) means that calendar day in the organization's timezone, with dateTo fully included; an ISO timestamp is an absolute instant. Deep pages should use keyset pagination: feed next_cursor back as cursor, which ignores page and returns null total/total_pages - ask GET /audit-logs/count for the number. Requires the enterprise module — callers without it receive 403 MODULE_DISABLED.
|
|
236
|
+
*/
|
|
237
|
+
list(input?: AuditListInput, options?: NivaRequestOptions): Promise<AuditListOutput>;
|
|
238
|
+
};
|
|
239
|
+
callRecords: {
|
|
240
|
+
/**
|
|
241
|
+
* callRecords.count operation.
|
|
242
|
+
*
|
|
243
|
+
* Returns the exact number of call records matching the same filters GET /call-records accepts, without paging any of them. It exists so a cursor-paginated listing can show a total without paying for count(*) on every page. Requires the call_record:read scope.
|
|
244
|
+
*/
|
|
245
|
+
count(input?: CallRecordsCountInput, options?: NivaRequestOptions): Promise<CallRecordsCountOutput>;
|
|
246
|
+
/**
|
|
247
|
+
* callRecords.exportCsv operation.
|
|
248
|
+
*
|
|
249
|
+
* Streams the matching call records as Server-Sent Events (`text/event-stream`), one JSON object per row - NOT a text/csv file; the separator only tells the UI how to join the cells when it builds the file client-side. Each row carries exactly the requested `columns` keys, plus the per-node event columns when `includeEvents` is true (one row per node visited). Repeat `columns` with brackets to select more than one (`?columns[]=started_at&columns[]=status`); omitting it yields the basic column set. `date_from` and `date_to` are always required and at most 90 days apart, and the scan stops at the 100000 most recent matching calls. The stream terminates with a done event { emitted, truncated }. Metadata filters use exact JSON containment and REST clients send them as `metadata[key]=value`; all supplied pairs must match. Setting `apply_table_filters=false` ignores every other filter and keeps only that window. The SIP transport fields (`sip_call_id`, `remote_addr`, `user_agent`) are not selectable here, matching the omission on `GET /call-records/{call_record_id}`. Requires the call_record:export permission (call_record:read API-key scope).
|
|
250
|
+
*/
|
|
251
|
+
exportCsv(input: CallRecordsExportCsvInput, options?: NivaRequestOptions): NivaStream<CallRecordsExportCsvEvent>;
|
|
252
|
+
/**
|
|
253
|
+
* callRecords.getById operation.
|
|
254
|
+
*
|
|
255
|
+
* Fetches a single call record by id, including persisted answer-recognition results. A missing or cross-org id returns 200 with a null body. Sensitive fields (SIP call id, remote address, user agent, raw recording path) are omitted from the output. Requires the call_record:read scope.
|
|
256
|
+
*/
|
|
257
|
+
getById(input: CallRecordsGetByIdInput, options?: NivaRequestOptions): Promise<CallRecordsGetByIdOutput>;
|
|
258
|
+
/**
|
|
259
|
+
* callRecords.getEvents operation.
|
|
260
|
+
*
|
|
261
|
+
* Returns the timeline of events for one call as a plain array (naturally bounded, not paginated). An unknown or cross-org call yields an empty array. Requires the call_record:read scope.
|
|
262
|
+
*/
|
|
263
|
+
getEvents(input: CallRecordsGetEventsInput, options?: NivaRequestOptions): Promise<CallRecordsGetEventsOutput>;
|
|
264
|
+
/**
|
|
265
|
+
* callRecords.getRecordingUrl operation.
|
|
266
|
+
*
|
|
267
|
+
* Returns a time-limited signed URL to download the call's recording plus the file name to save it under, or { url: null, filename: null } when the call has no recording or the id is unknown/cross-org. A recording is stored as WAV or as Ogg Opus depending on when it was made, so the extension comes from the stored file and is not always .wav. Requires the call_record:read scope.
|
|
268
|
+
*/
|
|
269
|
+
getRecordingUrl(input: CallRecordsGetRecordingUrlInput, options?: NivaRequestOptions): Promise<CallRecordsGetRecordingUrlOutput>;
|
|
270
|
+
/**
|
|
271
|
+
* callRecords.list operation.
|
|
272
|
+
*
|
|
273
|
+
* Returns the org's call records as a paginated envelope. Supports a rich filter set (exact call_record_id TypeID, exact FreeSWITCH channel uuid, exact SIP sip_call_id, date range, plan, channel, status, caller search, duration bounds, recording/transcription/error presence, channel type, dialer vs direct origin and exact metadata containment). The three call identifier filters use equality on their indexed columns and do not use substring search. A date-only date_from/date_to bound (YYYY-MM-DD) means that calendar day in the organization's timezone, with date_to fully included; an ISO timestamp is an absolute instant. Deep pages should use keyset pagination: feed next_cursor back as cursor, which ignores page and returns null total/total_pages - ask GET /call-records/count for the number. Metadata filters require every supplied key/value pair to match; REST clients send them as metadata[key]=value, for example metadata[id_correlacao]=dispatch_482913. Requires the call_record:read scope.
|
|
274
|
+
*/
|
|
275
|
+
list(input?: CallRecordsListInput, options?: NivaRequestOptions): Promise<CallRecordsListOutput>;
|
|
276
|
+
/**
|
|
277
|
+
* callRecords.purgeVoiceContent operation.
|
|
278
|
+
*
|
|
279
|
+
* Permanently erases the voice content of a single call (LGPD right to erasure): recording file, transcription and its embeddings. The operational CDR (timings, SIP result, billing, event timeline and opaque metadata) survives and existing analyses are kept but detached from the erased transcription. Do not put personal data in metadata; voice purge does not erase it. Irreversible and idempotent - a repeated purge succeeds with zero counts. Requires the call_record:purge permission and, for API keys, the call_record:write scope. Returns 404 CALL_NOT_FOUND for an unknown or cross-org call.
|
|
280
|
+
*/
|
|
281
|
+
purgeVoiceContent(input: CallRecordsPurgeVoiceContentInput, options?: NivaRequestOptions): Promise<CallRecordsPurgeVoiceContentOutput>;
|
|
282
|
+
/**
|
|
283
|
+
* callRecords.recordingContent operation.
|
|
284
|
+
*
|
|
285
|
+
* Streams the raw audio of the call's recording (uncompressed WAV, commonly hundreds of megabytes for long calls; the bytes are never buffered server-side). Supports HTTP Range requests: a satisfiable `Range` yields 206 Partial Content with `Content-Range`, an unsatisfiable one yields 416 RANGE_NOT_SATISFIABLE with `Content-Range: bytes * /<total>`, and every response advertises `Accept-Ranges: bytes`. Returns 404 CALL_NOT_FOUND when the call is unknown or belongs to another organization, 404 RECORDING_NOT_FOUND when the call was never recorded, and 404 RECORDING_CONTENT_MISSING when the call record points at bytes that are gone from storage. Requires the call_record:read scope.
|
|
286
|
+
*/
|
|
287
|
+
recordingContent(input: CallRecordsRecordingContentInput, options?: NivaRequestOptions & {
|
|
288
|
+
range?: string;
|
|
289
|
+
}): Promise<Response>;
|
|
290
|
+
/**
|
|
291
|
+
* callRecords.retryRecording operation.
|
|
292
|
+
*
|
|
293
|
+
* Requeues a failed voice-recording upload for the engine and returns { success: true }. The action is idempotent while the upload is queued or processing, and does nothing for completed, chat, purged or never-recorded calls. Requires the ai:execute permission.
|
|
294
|
+
*/
|
|
295
|
+
retryRecording(input: CallRecordsRetryRecordingInput, options?: NivaRequestOptions): Promise<CallRecordsRetryRecordingOutput>;
|
|
296
|
+
};
|
|
297
|
+
calls: {
|
|
298
|
+
/**
|
|
299
|
+
* calls.hangupCall operation.
|
|
300
|
+
*
|
|
301
|
+
* Ends an active voice or chat call owned by the authenticated organization. The path takes the call TypeID (call_...) - the same call_id returned by originate and carried by the CDRs and the call webhooks. A channel FreeSWITCH no longer knows about is dropped from the live state and reported with stale=true; a hangup the switch refuses answers 502 HANGUP_FAILED and leaves the call untouched. Requires the call:hangup permission and call:write scope.
|
|
302
|
+
*/
|
|
303
|
+
hangupCall(input: CallsHangupCallInput, options?: NivaRequestOptions): Promise<CallsHangupCallOutput>;
|
|
304
|
+
/**
|
|
305
|
+
* calls.originate operation.
|
|
306
|
+
*
|
|
307
|
+
* Places an outbound call that executes a published visual plan and returns its synchronous outcome. A 200 response does not mean the call was answered: read status. When the destination (or the carrier dialect) decides the outcome - any SIP 4xx or 6xx except 401, 403, 407 and 488 - the call answers 200 with status failed plus hangup_cause and sip_code. When the failure is ours - any SIP 5xx, the four codes above, or a failure without a SIP code - it answers 502 ORIGINATE_FAILED; with FreeSWITCH unreachable, 503. The legacy POST /originate/calls shape is deprecated, frozen, and keeps the old allowlist classification. Requires the call:originate scope.
|
|
308
|
+
*/
|
|
309
|
+
originate(input: CallsOriginateInput, options?: NivaRequestOptions): Promise<CallsOriginateOutput>;
|
|
310
|
+
};
|
|
311
|
+
capabilities: {
|
|
312
|
+
/**
|
|
313
|
+
* capabilities.get operation.
|
|
314
|
+
*
|
|
315
|
+
* Returns the compatibility snapshot SDKs handshake against: the server product and protocol versions, the sorted operationIds of the /api/v1 surface (deprecated operations and the token-authenticated public operations excluded), and per-module enablement for this deployment. Callable by any valid key regardless of its scopes, because every SDK handshakes here first; it exposes only versions, the public operation list and module enablement.
|
|
316
|
+
*/
|
|
317
|
+
get(options?: NivaRequestOptions): Promise<CapabilitiesGetOutput>;
|
|
318
|
+
};
|
|
319
|
+
channels: {
|
|
320
|
+
/**
|
|
321
|
+
* channels.create operation.
|
|
322
|
+
*
|
|
323
|
+
* Creates a channel of the given type. For WhatsApp and Telegram channels the supplied credentials are validated against the provider and webhook/SIP registration is performed as a side effect. A duplicate identifier returns 409 DUPLICATE_CHANNEL and invalid credentials return 422. Non-SIP channel types require the omnichannel module.
|
|
324
|
+
*/
|
|
325
|
+
create(input: ChannelsCreateInput, options?: NivaRequestOptions): Promise<ChannelsCreateOutput>;
|
|
326
|
+
/**
|
|
327
|
+
* channels.delete operation.
|
|
328
|
+
*
|
|
329
|
+
* Soft-deletes (archives) the channel and runs its type-specific teardown hook (e.g. removing the Telegram webhook). The record is retained so it can later be restored. Returns `{ success: true }`.
|
|
330
|
+
*/
|
|
331
|
+
delete(input: ChannelsDeleteInput, options?: NivaRequestOptions): Promise<ChannelsDeleteOutput>;
|
|
332
|
+
/**
|
|
333
|
+
* channels.getById operation.
|
|
334
|
+
*
|
|
335
|
+
* Returns the channel, or `null` (HTTP 200) when it does not exist or belongs to another organization. Accessing a non-SIP channel while the omnichannel module is disabled returns 403 MODULE_DISABLED.
|
|
336
|
+
*/
|
|
337
|
+
getById(input: ChannelsGetByIdInput, options?: NivaRequestOptions): Promise<ChannelsGetByIdOutput>;
|
|
338
|
+
/**
|
|
339
|
+
* channels.list operation.
|
|
340
|
+
*
|
|
341
|
+
* Returns a paginated list of the organization's channels, optionally filtered by `channel_type` and `is_active`. When the omnichannel module is disabled the result is restricted to SIP channels, and requesting a non-SIP `channel_type` returns 403 MODULE_DISABLED.
|
|
342
|
+
*/
|
|
343
|
+
list(input?: ChannelsListInput, options?: NivaRequestOptions): Promise<ChannelsListOutput>;
|
|
344
|
+
/**
|
|
345
|
+
* channels.testConnection operation.
|
|
346
|
+
*
|
|
347
|
+
* Validates the supplied provider credentials (Telegram bot token or WhatsApp phone number ID) against the provider without creating or modifying any channel. Requires the omnichannel module. Connectivity failures are returned as `{ ok: false, error }` rather than raised as errors.
|
|
348
|
+
*/
|
|
349
|
+
testConnection(input: ChannelsTestConnectionInput, options?: NivaRequestOptions): Promise<ChannelsTestConnectionOutput>;
|
|
350
|
+
/**
|
|
351
|
+
* channels.toggle operation.
|
|
352
|
+
*
|
|
353
|
+
* Sets the channel's `is_active` flag to the explicit value provided in `is_active` (an absolute set, not a relative flip). Returns `{ success: true }`.
|
|
354
|
+
*/
|
|
355
|
+
toggle(input: ChannelsToggleInput, options?: NivaRequestOptions): Promise<ChannelsToggleOutput>;
|
|
356
|
+
/**
|
|
357
|
+
* channels.update operation.
|
|
358
|
+
*
|
|
359
|
+
* Partially updates a channel. Moving a channel that is already attached to a different plan returns 409 CHANNEL_ALREADY_ASSIGNED unless `reassign` is `true`. Changing WhatsApp integration fields re-validates the configuration against Meta and re-triggers webhook synchronization.
|
|
360
|
+
*/
|
|
361
|
+
update(input: ChannelsUpdateInput, options?: NivaRequestOptions): Promise<ChannelsUpdateOutput>;
|
|
362
|
+
};
|
|
363
|
+
contacts: {
|
|
364
|
+
/**
|
|
365
|
+
* contacts.getById operation.
|
|
366
|
+
*
|
|
367
|
+
* Returns the contact, or `null` (HTTP 200) when it does not exist or belongs to another organization. Requires the omnichannel module.
|
|
368
|
+
*/
|
|
369
|
+
getById(input: ContactsGetByIdInput, options?: NivaRequestOptions): Promise<ContactsGetByIdOutput>;
|
|
370
|
+
/**
|
|
371
|
+
* contacts.list operation.
|
|
372
|
+
*
|
|
373
|
+
* Returns a paginated list of the organization's omnichannel contacts. Requires the omnichannel module, otherwise 403 MODULE_DISABLED is returned.
|
|
374
|
+
*/
|
|
375
|
+
list(input?: ContactsListInput, options?: NivaRequestOptions): Promise<ContactsListOutput>;
|
|
376
|
+
/**
|
|
377
|
+
* contacts.update operation.
|
|
378
|
+
*
|
|
379
|
+
* Partially updates a contact's profile fields. Requires the omnichannel module, and returns 404 CONTACT_NOT_FOUND when the contact does not exist or belongs to another organization.
|
|
380
|
+
*/
|
|
381
|
+
update(input: ContactsUpdateInput, options?: NivaRequestOptions): Promise<ContactsUpdateOutput>;
|
|
382
|
+
};
|
|
383
|
+
dashboard: {
|
|
384
|
+
/**
|
|
385
|
+
* dashboard.capacityStatus operation.
|
|
386
|
+
*
|
|
387
|
+
* Returns a live capacity snapshot for the organization, computed on demand from active sessions (Redis) and license/usage data (DB): voice and chat channel pools against their concurrent limits, license status, and — when the AI module is enabled — current STT/TTS/LLM usage against the monthly grant.
|
|
388
|
+
*/
|
|
389
|
+
capacityStatus(options?: NivaRequestOptions): Promise<DashboardCapacityStatusOutput>;
|
|
390
|
+
/**
|
|
391
|
+
* dashboard.watchDashboardMetrics operation.
|
|
392
|
+
*
|
|
393
|
+
* Server-Sent Events stream of the organization's capacity snapshot. The first event is always a full snapshot of the current state, and every later event carries the whole state too rather than a delta — so reconnecting is safe and never loses ground. The response advertises a 5s reconnect delay, and capacity is re-emitted after 30s of silence so a dropped update self-heals.
|
|
394
|
+
*/
|
|
395
|
+
watchDashboardMetrics(options?: NivaRequestOptions): NivaStream<DashboardWatchDashboardMetricsEvent>;
|
|
396
|
+
};
|
|
397
|
+
destinations: {
|
|
398
|
+
/**
|
|
399
|
+
* destinations.create operation.
|
|
400
|
+
*
|
|
401
|
+
* Creates a transfer destination pointing at a SIP/telephony `uri` that plans can forward calls to.
|
|
402
|
+
*/
|
|
403
|
+
create(input: DestinationsCreateInput, options?: NivaRequestOptions): Promise<DestinationsCreateOutput>;
|
|
404
|
+
/**
|
|
405
|
+
* destinations.delete operation.
|
|
406
|
+
*
|
|
407
|
+
* Deletes a destination. Returns 404 DESTINATION_NOT_FOUND when it does not exist, and `{ success: true }` on success.
|
|
408
|
+
*/
|
|
409
|
+
delete(input: DestinationsDeleteInput, options?: NivaRequestOptions): Promise<DestinationsDeleteOutput>;
|
|
410
|
+
/**
|
|
411
|
+
* destinations.getById operation.
|
|
412
|
+
*
|
|
413
|
+
* Returns the destination, or `null` (HTTP 200) when it does not exist or belongs to another organization.
|
|
414
|
+
*/
|
|
415
|
+
getById(input: DestinationsGetByIdInput, options?: NivaRequestOptions): Promise<DestinationsGetByIdOutput>;
|
|
416
|
+
/**
|
|
417
|
+
* destinations.list operation.
|
|
418
|
+
*
|
|
419
|
+
* Returns a paginated list of the organization's transfer destinations (call-forwarding targets).
|
|
420
|
+
*/
|
|
421
|
+
list(input?: DestinationsListInput, options?: NivaRequestOptions): Promise<DestinationsListOutput>;
|
|
422
|
+
/**
|
|
423
|
+
* destinations.update operation.
|
|
424
|
+
*
|
|
425
|
+
* Partially updates a destination. Returns 404 DESTINATION_NOT_FOUND when it does not exist or belongs to another organization.
|
|
426
|
+
*/
|
|
427
|
+
update(input: DestinationsUpdateInput, options?: NivaRequestOptions): Promise<DestinationsUpdateOutput>;
|
|
428
|
+
};
|
|
429
|
+
dialerAttempts: {
|
|
430
|
+
/**
|
|
431
|
+
* dialerAttempts.list operation.
|
|
432
|
+
*
|
|
433
|
+
* Returns the read-only call-attempt history for a campaign as a paginated envelope. Optionally filter by attempt status, by a single contact, and by a creation-time window (dateFrom is inclusive; a YYYY-MM-DD bound means that calendar day in the organization timezone, so a YYYY-MM-DD dateTo includes that whole local day, while an ISO timestamp is an absolute instant and dateTo stops there, excluding it). Each row includes the joined contact phone number and name (null if the contact row was removed), machine_type on an attempt a recording answered, and call_record_id, the call report the attempt produced (null when no record was written).
|
|
434
|
+
*/
|
|
435
|
+
list(input: DialerAttemptsListInput, options?: NivaRequestOptions): Promise<DialerAttemptsListOutput>;
|
|
436
|
+
};
|
|
437
|
+
dialerCampaigns: {
|
|
438
|
+
/**
|
|
439
|
+
* dialerCampaigns.control operation.
|
|
440
|
+
*
|
|
441
|
+
* Drives the campaign state machine. Valid transitions: start (draft/scheduled/finished -> running, or -> scheduled when a future auto_start_at is armed), pause (running -> paused), resume (paused -> running), stop (draft/scheduled/running/paused -> finished, cancelling pending retries). Invalid transitions return 409 DIALER_CAMPAIGN_INVALID_TRANSITION. start and resume additionally require the dialer module enabled (403 DIALER_MODULE_DISABLED), a published plan (422 DIALER_CAMPAIGN_PLAN_NOT_PUBLISHED) and at least one pending contact (422 DIALER_CAMPAIGN_NO_CONTACTS).
|
|
442
|
+
*/
|
|
443
|
+
control(input: DialerCampaignsControlInput, options?: NivaRequestOptions): Promise<DialerCampaignsControlOutput>;
|
|
444
|
+
/**
|
|
445
|
+
* dialerCampaigns.create operation.
|
|
446
|
+
*
|
|
447
|
+
* Creates a campaign in draft status bound to an existing visual plan. The plan need not be published at creation time (only at start); an unknown plan_id returns 404 PLAN_NOT_FOUND. Requires the dialer_campaign:create scope.
|
|
448
|
+
*/
|
|
449
|
+
create(input: DialerCampaignsCreateInput, options?: NivaRequestOptions): Promise<DialerCampaignsCreateOutput>;
|
|
450
|
+
/**
|
|
451
|
+
* dialerCampaigns.delete operation.
|
|
452
|
+
*
|
|
453
|
+
* Soft-deletes a campaign. Running, paused, or scheduled campaigns must be stopped first and otherwise return 409 DIALER_CAMPAIGN_INVALID_TRANSITION; an unknown id returns 404. Requires the dialer_campaign:delete scope.
|
|
454
|
+
*/
|
|
455
|
+
delete(input: DialerCampaignsDeleteInput, options?: NivaRequestOptions): Promise<DialerCampaignsDeleteOutput>;
|
|
456
|
+
/**
|
|
457
|
+
* dialerCampaigns.get operation.
|
|
458
|
+
*
|
|
459
|
+
* Fetches a single campaign by id. A missing or cross-org id returns 200 with a null body rather than 404, so it never reveals whether an id exists in another org.
|
|
460
|
+
*/
|
|
461
|
+
get(input: DialerCampaignsGetInput, options?: NivaRequestOptions): Promise<DialerCampaignsGetOutput>;
|
|
462
|
+
/**
|
|
463
|
+
* dialerCampaigns.list operation.
|
|
464
|
+
*
|
|
465
|
+
* Returns the org's dialer campaigns as a paginated envelope. Optionally filter by lifecycle status; page, limit, sort_by, sort_order and search follow the standard list contract.
|
|
466
|
+
*/
|
|
467
|
+
list(input?: DialerCampaignsListInput, options?: NivaRequestOptions): Promise<DialerCampaignsListOutput>;
|
|
468
|
+
/**
|
|
469
|
+
* dialerCampaigns.liveStats operation.
|
|
470
|
+
*
|
|
471
|
+
* Server-Sent Events stream of one campaign's live statistics. The first event is always a full snapshot of the current state, and every later event carries the whole state too rather than a delta — so reconnecting is safe and never loses ground. The response advertises a 5s reconnect delay. An unknown or cross-org id returns 404 DIALER_CAMPAIGN_NOT_FOUND before the stream opens.
|
|
472
|
+
*/
|
|
473
|
+
liveStats(input: DialerCampaignsLiveStatsInput, options?: NivaRequestOptions): NivaStream<DialerCampaignsLiveStatsEvent>;
|
|
474
|
+
/**
|
|
475
|
+
* dialerCampaigns.orgLiveStats operation.
|
|
476
|
+
*
|
|
477
|
+
* Server-Sent Events stream of live statistics for the org's running and paused campaigns, one event per campaign. It opens with a full snapshot of the current state, and every later event carries a campaign's whole state rather than a delta — so reconnecting is safe and never loses ground. The response advertises a 5s reconnect delay.
|
|
478
|
+
*/
|
|
479
|
+
orgLiveStats(options?: NivaRequestOptions): NivaStream<DialerCampaignsOrgLiveStatsEvent>;
|
|
480
|
+
/**
|
|
481
|
+
* dialerCampaigns.stats operation.
|
|
482
|
+
*
|
|
483
|
+
* Returns the campaign's cumulative call-outcome counters (answered, machine, busy, no-answer, failed, DNC-skipped, cancelled) plus live pending and calling counts. The machine counter is populated only on campaigns with answering-machine detection enabled, and answered never includes it. An unknown or cross-org id returns 404 DIALER_CAMPAIGN_NOT_FOUND.
|
|
484
|
+
*/
|
|
485
|
+
stats(input: DialerCampaignsStatsInput, options?: NivaRequestOptions): Promise<DialerCampaignsStatsOutput>;
|
|
486
|
+
/**
|
|
487
|
+
* dialerCampaigns.summary operation.
|
|
488
|
+
*
|
|
489
|
+
* Aggregates the org's currently running campaigns and their live calling contacts for the dashboard card. When exactly one campaign is running, its id and name are included so the client can deep-link into it.
|
|
490
|
+
*/
|
|
491
|
+
summary(options?: NivaRequestOptions): Promise<DialerCampaignsSummaryOutput>;
|
|
492
|
+
/**
|
|
493
|
+
* dialerCampaigns.update operation.
|
|
494
|
+
*
|
|
495
|
+
* Partially updates a campaign's configuration. Only an archived campaign is immutable and returns 409 DIALER_CAMPAIGN_INVALID_TRANSITION - a finished one is editable, since it can be reopened and nothing it stores takes effect until somebody starts it. Clearing auto_start_at on a scheduled campaign reverts it to draft. An unknown id returns 404. Requires the dialer_campaign:update scope.
|
|
496
|
+
*/
|
|
497
|
+
update(input: DialerCampaignsUpdateInput, options?: NivaRequestOptions): Promise<DialerCampaignsUpdateOutput>;
|
|
498
|
+
};
|
|
499
|
+
dialerContacts: {
|
|
500
|
+
/**
|
|
501
|
+
* dialerContacts.add operation.
|
|
502
|
+
*
|
|
503
|
+
* Adds one contact to a campaign's mailing in pending status. The phone number is normalized with the org default country; an unknown campaign returns 404 DIALER_CAMPAIGN_NOT_FOUND and an unparseable number returns 422 DIALER_IMPORT_INVALID. Requires the dialer_campaign:update scope.
|
|
504
|
+
*/
|
|
505
|
+
add(input: DialerContactsAddInput, options?: NivaRequestOptions): Promise<DialerContactsAddOutput>;
|
|
506
|
+
/**
|
|
507
|
+
* dialerContacts.bulkCancel operation.
|
|
508
|
+
*
|
|
509
|
+
* Cancels up to 500 pending contacts by id in one call. Non-pending contacts are skipped; the response reports cancelled and skipped counts. Requires the dialer_campaign:update scope.
|
|
510
|
+
*/
|
|
511
|
+
bulkCancel(input: DialerContactsBulkCancelInput, options?: NivaRequestOptions): Promise<DialerContactsBulkCancelOutput>;
|
|
512
|
+
/**
|
|
513
|
+
* dialerContacts.bulkRequeue operation.
|
|
514
|
+
*
|
|
515
|
+
* Requeues up to 500 terminal contacts by id back to pending. Non-terminal contacts are skipped; the response reports requeued and skipped counts. Requires the dialer_campaign:update scope.
|
|
516
|
+
*/
|
|
517
|
+
bulkRequeue(input: DialerContactsBulkRequeueInput, options?: NivaRequestOptions): Promise<DialerContactsBulkRequeueOutput>;
|
|
518
|
+
/**
|
|
519
|
+
* dialerContacts.cancel operation.
|
|
520
|
+
*
|
|
521
|
+
* Cancels a pending contact so it is no longer dialed, returning the updated contact. An unknown contact returns 404 CONTACT_NOT_FOUND. Requires the dialer_campaign:update scope.
|
|
522
|
+
*/
|
|
523
|
+
cancel(input: DialerContactsCancelInput, options?: NivaRequestOptions): Promise<DialerContactsCancelOutput>;
|
|
524
|
+
/**
|
|
525
|
+
* dialerContacts.exportCsv operation.
|
|
526
|
+
*
|
|
527
|
+
* Streams the campaign's mailing as Server-Sent Events (`text/event-stream`), one JSON object per contact - NOT a text/csv file; the caller joins the cells itself. Rows carry the fixed columns (phone_number, name, status, attempt_count, machine_attempts, machine_type, last_attempt_at) plus every custom field of that contact expanded as its own key, so the shape is import-symmetric and may vary between rows. The two machine columns are always present: machine_attempts counts the calls a recording answered and machine_type is the kind identified on the most recent classified one, empty when the contact was never classified. Filters mirror the contact listing. Requires the dialer module and the dialer_campaign:read scope.
|
|
528
|
+
*/
|
|
529
|
+
exportCsv(input: DialerContactsExportCsvInput, options?: NivaRequestOptions): NivaStream<DialerContactsExportCsvEvent>;
|
|
530
|
+
/**
|
|
531
|
+
* dialerContacts.get operation.
|
|
532
|
+
*
|
|
533
|
+
* Fetches a single mailing contact scoped to its campaign. An unknown or cross-org contact returns 404 CONTACT_NOT_FOUND.
|
|
534
|
+
*/
|
|
535
|
+
get(input: DialerContactsGetInput, options?: NivaRequestOptions): Promise<DialerContactsGetOutput>;
|
|
536
|
+
/**
|
|
537
|
+
* dialerContacts.list operation.
|
|
538
|
+
*
|
|
539
|
+
* Returns a campaign's mailing (contacts) as a paginated envelope. Optionally filter by contact status and by a creation-time window (dateFrom is inclusive; a YYYY-MM-DD bound means that calendar day in the organization timezone, so a YYYY-MM-DD dateTo includes that whole local day, while an ISO timestamp is an absolute instant and dateTo stops there, excluding it); search matches phone number and name. Each row also carries machine_type, the kind of recording identified on the contact's most recent classified call; null means no call of that contact was ever classified.
|
|
540
|
+
*/
|
|
541
|
+
list(input: DialerContactsListInput, options?: NivaRequestOptions): Promise<DialerContactsListOutput>;
|
|
542
|
+
/**
|
|
543
|
+
* dialerContacts.remove operation.
|
|
544
|
+
*
|
|
545
|
+
* Soft-deletes up to 500 contacts by id in one call. Contacts currently calling are skipped; the response reports removed and skipped counts. Requires the dialer_campaign:update scope.
|
|
546
|
+
*/
|
|
547
|
+
remove(input: DialerContactsRemoveInput, options?: NivaRequestOptions): Promise<DialerContactsRemoveOutput>;
|
|
548
|
+
/**
|
|
549
|
+
* dialerContacts.requeue operation.
|
|
550
|
+
*
|
|
551
|
+
* Requeues a terminal contact (lead recycling) back to pending without resetting cumulative counters. Only contacts in a terminal status can be requeued; pending/calling contacts return 409 DIALER_CONTACT_NOT_REQUEUEABLE and an unknown contact returns 404. Requires the dialer_campaign:update scope.
|
|
552
|
+
*/
|
|
553
|
+
requeue(input: DialerContactsRequeueInput, options?: NivaRequestOptions): Promise<DialerContactsRequeueOutput>;
|
|
554
|
+
/**
|
|
555
|
+
* dialerContacts.requeueAll operation.
|
|
556
|
+
*
|
|
557
|
+
* Requeues every terminal contact of a campaign back to pending, optionally restricted to a single terminal status. The response reports how many were requeued. Requires the dialer_campaign:update scope.
|
|
558
|
+
*/
|
|
559
|
+
requeueAll(input: DialerContactsRequeueAllInput, options?: NivaRequestOptions): Promise<DialerContactsRequeueAllOutput>;
|
|
560
|
+
/**
|
|
561
|
+
* dialerContacts.update operation.
|
|
562
|
+
*
|
|
563
|
+
* Partially updates a mailing contact. Only pending contacts are editable (409 DIALER_CONTACT_NOT_EDITABLE otherwise); a phone number colliding with another contact in the campaign returns 409 DIALER_CONTACT_DUPLICATE, an unparseable number 422 DIALER_IMPORT_INVALID and an unknown contact 404. Requires the dialer_campaign:update scope.
|
|
564
|
+
*/
|
|
565
|
+
update(input: DialerContactsUpdateInput, options?: NivaRequestOptions): Promise<DialerContactsUpdateOutput>;
|
|
566
|
+
};
|
|
567
|
+
dialerDnc: {
|
|
568
|
+
/**
|
|
569
|
+
* dialerDnc.add operation.
|
|
570
|
+
*
|
|
571
|
+
* Adds one number to the org's do-not-call list so future campaigns skip it. A number already present returns 409 DIALER_DNC_DUPLICATE and an unparseable number 422 DIALER_IMPORT_INVALID. Requires the dialer_dnc:manage scope.
|
|
572
|
+
*/
|
|
573
|
+
add(input: DialerDncAddInput, options?: NivaRequestOptions): Promise<DialerDncAddOutput>;
|
|
574
|
+
/**
|
|
575
|
+
* dialerDnc.bulkImport operation.
|
|
576
|
+
*
|
|
577
|
+
* Adds up to 10000 numbers to the do-not-call list in one call, applying an optional shared reason. Duplicates are skipped; the response reports added and skipped counts. Requires the dialer_dnc:manage scope.
|
|
578
|
+
*/
|
|
579
|
+
bulkImport(input: DialerDncBulkImportInput, options?: NivaRequestOptions): Promise<DialerDncBulkImportOutput>;
|
|
580
|
+
/**
|
|
581
|
+
* dialerDnc.bulkRemove operation.
|
|
582
|
+
*
|
|
583
|
+
* Soft-deletes up to 500 do-not-call entries by id in one call; unknown or already-removed ids are skipped and the response reports the removed count. Requires the dialer_dnc:manage scope.
|
|
584
|
+
*/
|
|
585
|
+
bulkRemove(input: DialerDncBulkRemoveInput, options?: NivaRequestOptions): Promise<DialerDncBulkRemoveOutput>;
|
|
586
|
+
/**
|
|
587
|
+
* dialerDnc.list operation.
|
|
588
|
+
*
|
|
589
|
+
* Returns the org's do-not-call entries as a paginated envelope; search matches the phone number. Requires the dialer_dnc:read scope.
|
|
590
|
+
*/
|
|
591
|
+
list(input?: DialerDncListInput, options?: NivaRequestOptions): Promise<DialerDncListOutput>;
|
|
592
|
+
/**
|
|
593
|
+
* dialerDnc.remove operation.
|
|
594
|
+
*
|
|
595
|
+
* Soft-deletes one do-not-call entry by id and returns { success: true }. Requires the dialer_dnc:manage scope.
|
|
596
|
+
*/
|
|
597
|
+
remove(input: DialerDncRemoveInput, options?: NivaRequestOptions): Promise<DialerDncRemoveOutput>;
|
|
598
|
+
};
|
|
599
|
+
dialerImports: {
|
|
600
|
+
/**
|
|
601
|
+
* dialerImports.create operation.
|
|
602
|
+
*
|
|
603
|
+
* Uploads a CSV (multipart) and starts an asynchronous import job that appends contacts to the campaign per the column mapping. Returns the created job immediately while rows are processed off the request path; poll the job or its SSE progress. An unknown campaign returns 404 DIALER_CAMPAIGN_NOT_FOUND and a malformed file/mapping returns 422 DIALER_IMPORT_INVALID. Requires the dialer_campaign:update scope.
|
|
604
|
+
*/
|
|
605
|
+
create(input: DialerImportsCreateInput, options?: NivaRequestOptions): Promise<DialerImportsCreateOutput>;
|
|
606
|
+
/**
|
|
607
|
+
* dialerImports.get operation.
|
|
608
|
+
*
|
|
609
|
+
* Fetches an import job with its current status and progress counters (total/processed rows, imported, skipped, invalid) plus a has_invalid_rows flag. An unknown or cross-org job returns 404 DIALER_IMPORT_JOB_NOT_FOUND.
|
|
610
|
+
*/
|
|
611
|
+
get(input: DialerImportsGetInput, options?: NivaRequestOptions): Promise<DialerImportsGetOutput>;
|
|
612
|
+
/**
|
|
613
|
+
* dialerImports.invalidRows operation.
|
|
614
|
+
*
|
|
615
|
+
* Returns a downloadable CSV of the rows an import job rejected (filename plus CSV body), or null when the job produced no invalid rows. An unknown job returns 404 DIALER_IMPORT_JOB_NOT_FOUND.
|
|
616
|
+
*/
|
|
617
|
+
invalidRows(input: DialerImportsInvalidRowsInput, options?: NivaRequestOptions): Promise<DialerImportsInvalidRowsOutput>;
|
|
618
|
+
/**
|
|
619
|
+
* dialerImports.progress operation.
|
|
620
|
+
*
|
|
621
|
+
* Server-Sent Events stream of an import job's progress. The first event is always a full snapshot of the current state, and every later event carries the whole state too rather than a delta — so reconnecting is safe and never loses ground. The response advertises a 5s reconnect delay; the stream closes once the job reaches done or failed. An unknown or cross-org job returns 404 DIALER_IMPORT_JOB_NOT_FOUND before the stream opens.
|
|
622
|
+
*/
|
|
623
|
+
progress(input: DialerImportsProgressInput, options?: NivaRequestOptions): NivaStream<DialerImportsProgressEvent>;
|
|
624
|
+
};
|
|
625
|
+
holidays: {
|
|
626
|
+
/**
|
|
627
|
+
* holidays.countries operation.
|
|
628
|
+
*
|
|
629
|
+
* Returns the countries supported by the external holiday provider (Nager.Date). Returns 502 NAGER_API_ERROR when the provider cannot be reached.
|
|
630
|
+
*/
|
|
631
|
+
countries(options?: NivaRequestOptions): Promise<HolidaysCountriesOutput>;
|
|
632
|
+
/**
|
|
633
|
+
* holidays.create operation.
|
|
634
|
+
*
|
|
635
|
+
* Adds a single holiday (a single day or a date range) to the given group. Set `recurring` to repeat it every year on the same date.
|
|
636
|
+
*/
|
|
637
|
+
create(input: HolidaysCreateInput, options?: NivaRequestOptions): Promise<HolidaysCreateOutput>;
|
|
638
|
+
/**
|
|
639
|
+
* holidays.delete operation.
|
|
640
|
+
*
|
|
641
|
+
* Deletes a single holiday. Returns 404 HOLIDAY_NOT_FOUND when it does not exist, and `{ success: true }` on success.
|
|
642
|
+
*/
|
|
643
|
+
delete(input: HolidaysDeleteInput, options?: NivaRequestOptions): Promise<HolidaysDeleteOutput>;
|
|
644
|
+
/**
|
|
645
|
+
* holidays.import operation.
|
|
646
|
+
*
|
|
647
|
+
* Imports the public holidays for a country and year from the external provider (Nager.Date) into the given group and returns how many were imported. Returns 404 HOLIDAY_GROUP_NOT_FOUND when the group does not exist and 502 NAGER_API_ERROR when the provider cannot be reached.
|
|
648
|
+
*/
|
|
649
|
+
import(input: HolidaysImportInput, options?: NivaRequestOptions): Promise<HolidaysImportOutput>;
|
|
650
|
+
/**
|
|
651
|
+
* holidays.list operation.
|
|
652
|
+
*
|
|
653
|
+
* Returns a paginated list of the holidays belonging to the given group.
|
|
654
|
+
*/
|
|
655
|
+
list(input: HolidaysListInput, options?: NivaRequestOptions): Promise<HolidaysListOutput>;
|
|
656
|
+
/**
|
|
657
|
+
* holidays.previewImport operation.
|
|
658
|
+
*
|
|
659
|
+
* Fetches the public holidays for a country and year from the external provider without persisting anything, so the result can be reviewed before import. Returns 502 NAGER_API_ERROR when the provider cannot be reached.
|
|
660
|
+
*/
|
|
661
|
+
previewImport(input: HolidaysPreviewImportInput, options?: NivaRequestOptions): Promise<HolidaysPreviewImportOutput>;
|
|
662
|
+
/**
|
|
663
|
+
* holidays.update operation.
|
|
664
|
+
*
|
|
665
|
+
* Partially updates a single holiday. Returns 404 HOLIDAY_NOT_FOUND when it does not exist.
|
|
666
|
+
*/
|
|
667
|
+
update(input: HolidaysUpdateInput, options?: NivaRequestOptions): Promise<HolidaysUpdateOutput>;
|
|
668
|
+
groups: {
|
|
669
|
+
/**
|
|
670
|
+
* holidays.groups.create operation.
|
|
671
|
+
*
|
|
672
|
+
* Creates an empty holiday group. Holidays can then be added individually or imported from an external provider.
|
|
673
|
+
*/
|
|
674
|
+
create(input: HolidaysGroupsCreateInput, options?: NivaRequestOptions): Promise<HolidaysGroupsCreateOutput>;
|
|
675
|
+
/**
|
|
676
|
+
* holidays.groups.delete operation.
|
|
677
|
+
*
|
|
678
|
+
* Deletes a holiday group and the holidays it contains. Returns 404 HOLIDAY_GROUP_NOT_FOUND when it does not exist, and `{ success: true }` on success.
|
|
679
|
+
*/
|
|
680
|
+
delete(input: HolidaysGroupsDeleteInput, options?: NivaRequestOptions): Promise<HolidaysGroupsDeleteOutput>;
|
|
681
|
+
/**
|
|
682
|
+
* holidays.groups.getById operation.
|
|
683
|
+
*
|
|
684
|
+
* Returns the holiday group, or `null` (HTTP 200) when it does not exist or belongs to another organization.
|
|
685
|
+
*/
|
|
686
|
+
getById(input: HolidaysGroupsGetByIdInput, options?: NivaRequestOptions): Promise<HolidaysGroupsGetByIdOutput>;
|
|
687
|
+
/**
|
|
688
|
+
* holidays.groups.list operation.
|
|
689
|
+
*
|
|
690
|
+
* Returns a paginated list of the organization's holiday groups (named collections of holidays that schedules can reference).
|
|
691
|
+
*/
|
|
692
|
+
list(input?: HolidaysGroupsListInput, options?: NivaRequestOptions): Promise<HolidaysGroupsListOutput>;
|
|
693
|
+
/**
|
|
694
|
+
* holidays.groups.update operation.
|
|
695
|
+
*
|
|
696
|
+
* Partially updates a holiday group's metadata. Returns 404 HOLIDAY_GROUP_NOT_FOUND when it does not exist or belongs to another organization.
|
|
697
|
+
*/
|
|
698
|
+
update(input: HolidaysGroupsUpdateInput, options?: NivaRequestOptions): Promise<HolidaysGroupsUpdateOutput>;
|
|
699
|
+
};
|
|
700
|
+
};
|
|
701
|
+
license: {
|
|
702
|
+
/**
|
|
703
|
+
* license.status operation.
|
|
704
|
+
*
|
|
705
|
+
* Returns the deployment-wide license status — identical for every organization on this server, since licensing is per-deployment rather than per-tenant. Includes enabled modules, expiry and grace-period state; in development mode the concurrent channel limits are capped at 10 voice and 10 chat.
|
|
706
|
+
*/
|
|
707
|
+
status(options?: NivaRequestOptions): Promise<LicenseStatusOutput>;
|
|
708
|
+
};
|
|
709
|
+
oauthGrants: {
|
|
710
|
+
/**
|
|
711
|
+
* oauthGrants.list operation.
|
|
712
|
+
*
|
|
713
|
+
* Lists the OAuth grants (connected apps) that are still alive in the organization. A member sees only their own consents; a role holding oauth_grant:revoke sees every member's. Requires the oauth_grant:read scope.
|
|
714
|
+
*/
|
|
715
|
+
list(input?: OauthGrantsListInput, options?: NivaRequestOptions): Promise<OauthGrantsListOutput>;
|
|
716
|
+
/**
|
|
717
|
+
* oauthGrants.revoke operation.
|
|
718
|
+
*
|
|
719
|
+
* Revokes a connected-app OAuth grant: the next refresh fails with invalid_grant and the live access token is refused immediately. A member can revoke only their own grants; oauth_grant:revoke revokes anyone's in the organization. Unknown or already-revoked ids return 404 OAUTH_GRANT_NOT_FOUND. Requires the oauth_grant:read scope; a credential (API key or OAuth token) additionally needs the oauth_grant:write scope, as any mutation.
|
|
720
|
+
*/
|
|
721
|
+
revoke(input: OauthGrantsRevokeInput, options?: NivaRequestOptions): Promise<OauthGrantsRevokeOutput>;
|
|
722
|
+
/**
|
|
723
|
+
* oauthGrants.usage operation.
|
|
724
|
+
*
|
|
725
|
+
* Returns which routes this OAuth grant called, how many times per day and when each route was last used, over the last `days` days (1 to 90, default 30). A member can read only their own grants; oauth_grant:revoke (org admin) reads anyone's in the organization. An unknown or cross-org id returns 404 OAUTH_GRANT_NOT_FOUND; another member's grant returns 403 OAUTH_GRANT_FORBIDDEN. Requires the oauth_grant:read scope.
|
|
726
|
+
*/
|
|
727
|
+
usage(input: OauthGrantsUsageInput, options?: NivaRequestOptions): Promise<OauthGrantsUsageOutput>;
|
|
728
|
+
};
|
|
729
|
+
orgSettings: {
|
|
730
|
+
/**
|
|
731
|
+
* orgSettings.getDialer operation.
|
|
732
|
+
*
|
|
733
|
+
* Returns the organization's dialer operational settings — reserved inbound channels, default trunk, default country and the answering-machine detection defaults. Returns null when no settings row exists yet.
|
|
734
|
+
*/
|
|
735
|
+
getDialer(options?: NivaRequestOptions): Promise<OrgSettingsGetDialerOutput>;
|
|
736
|
+
/**
|
|
737
|
+
* orgSettings.upsertDialer operation.
|
|
738
|
+
*
|
|
739
|
+
* Creates or updates the organization's dialer operational settings and returns the persisted values. The change is broadcast to running engines and recorded in the audit log.
|
|
740
|
+
*/
|
|
741
|
+
upsertDialer(input?: OrgSettingsUpsertDialerInput, options?: NivaRequestOptions): Promise<OrgSettingsUpsertDialerOutput>;
|
|
742
|
+
};
|
|
743
|
+
schedules: {
|
|
744
|
+
/**
|
|
745
|
+
* schedules.create operation.
|
|
746
|
+
*
|
|
747
|
+
* Creates a schedule from a set of time-based rules and optional holiday country calendars.
|
|
748
|
+
*/
|
|
749
|
+
create(input: SchedulesCreateInput, options?: NivaRequestOptions): Promise<SchedulesCreateOutput>;
|
|
750
|
+
/**
|
|
751
|
+
* schedules.delete operation.
|
|
752
|
+
*
|
|
753
|
+
* Deletes a schedule. Returns 404 SCHEDULE_NOT_FOUND when it does not exist, and `{ success: true }` on success.
|
|
754
|
+
*/
|
|
755
|
+
delete(input: SchedulesDeleteInput, options?: NivaRequestOptions): Promise<SchedulesDeleteOutput>;
|
|
756
|
+
/**
|
|
757
|
+
* schedules.getById operation.
|
|
758
|
+
*
|
|
759
|
+
* Returns the schedule, or `null` (HTTP 200) when it does not exist or belongs to another organization.
|
|
760
|
+
*/
|
|
761
|
+
getById(input: SchedulesGetByIdInput, options?: NivaRequestOptions): Promise<SchedulesGetByIdOutput>;
|
|
762
|
+
/**
|
|
763
|
+
* schedules.list operation.
|
|
764
|
+
*
|
|
765
|
+
* Returns a paginated list of the organization's schedules (business-hours rule sets used to gate when plans answer).
|
|
766
|
+
*/
|
|
767
|
+
list(input?: SchedulesListInput, options?: NivaRequestOptions): Promise<SchedulesListOutput>;
|
|
768
|
+
/**
|
|
769
|
+
* schedules.update operation.
|
|
770
|
+
*
|
|
771
|
+
* Partially updates a schedule. Returns 404 SCHEDULE_NOT_FOUND when it does not exist or belongs to another organization.
|
|
772
|
+
*/
|
|
773
|
+
update(input: SchedulesUpdateInput, options?: NivaRequestOptions): Promise<SchedulesUpdateOutput>;
|
|
774
|
+
};
|
|
775
|
+
secrets: {
|
|
776
|
+
/**
|
|
777
|
+
* secrets.list operation.
|
|
778
|
+
*
|
|
779
|
+
* Returns the organization's secrets as a paginated envelope: name, description, the last 4 characters of the value, and how many plans reference it, published and draft counted apart. The value itself is never returned by any procedure. Requires the secret:read scope.
|
|
780
|
+
*/
|
|
781
|
+
list(input?: SecretsListInput, options?: NivaRequestOptions): Promise<SecretsListOutput>;
|
|
782
|
+
/**
|
|
783
|
+
* secrets.listNames operation.
|
|
784
|
+
*
|
|
785
|
+
* Returns just the names of the organization's secrets, for plan-editor autocomplete and broken-reference detection. No values, suffixes or descriptions. Requires the visual_plan:read scope, not secret:read.
|
|
786
|
+
*/
|
|
787
|
+
listNames(options?: NivaRequestOptions): Promise<SecretsListNamesOutput>;
|
|
788
|
+
};
|
|
789
|
+
tts: {
|
|
790
|
+
/**
|
|
791
|
+
* tts.listModels operation.
|
|
792
|
+
*
|
|
793
|
+
* Returns the catalog of available TTS models as a raw array, limited to the active, licensed provider tier.
|
|
794
|
+
*/
|
|
795
|
+
listModels(options?: NivaRequestOptions): Promise<TtsListModelsOutput>;
|
|
796
|
+
/**
|
|
797
|
+
* tts.listVoices operation.
|
|
798
|
+
*
|
|
799
|
+
* Returns the catalog of available TTS voices as a raw array, optionally filtered by `language` and/or `model`. Only voices from the active, licensed provider tier are visible.
|
|
800
|
+
*/
|
|
801
|
+
listVoices(input?: TtsListVoicesInput, options?: NivaRequestOptions): Promise<TtsListVoicesOutput>;
|
|
802
|
+
/**
|
|
803
|
+
* tts.preview operation.
|
|
804
|
+
*
|
|
805
|
+
* Synthesizes the supplied text and returns the raw audio bytes without storing anything in the audio library. When `voice` and `model` are omitted they are resolved from the organization's language and active provider tier. Returns 422 TTS_VOICE_UNAVAILABLE when no voice is available for that language.
|
|
806
|
+
*/
|
|
807
|
+
preview(input: TtsPreviewInput, options?: NivaRequestOptions & {
|
|
808
|
+
range?: string;
|
|
809
|
+
}): Promise<Response>;
|
|
810
|
+
};
|
|
811
|
+
users: {
|
|
812
|
+
/**
|
|
813
|
+
* users.activateMember operation.
|
|
814
|
+
*
|
|
815
|
+
* Reactivates a previously suspended member, restoring their access. Returns 404 MEMBER_NOT_FOUND when the member does not exist.
|
|
816
|
+
*/
|
|
817
|
+
activateMember(input: UsersActivateMemberInput, options?: NivaRequestOptions): Promise<UsersActivateMemberOutput>;
|
|
818
|
+
/**
|
|
819
|
+
* users.createMember operation.
|
|
820
|
+
*
|
|
821
|
+
* Adds a member to the organization, either by attaching an existing user (by email) or by creating a new user. Creating a new user requires `password` and `name`, otherwise 422 NEW_USER_REQUIRES_PASSWORD is returned. Returns 409 DUPLICATE_EMAIL / ALREADY_MEMBER on conflicts and 422 ROLE_SCOPE_MISMATCH / 404 ROLE_NOT_FOUND for invalid role assignment.
|
|
822
|
+
*/
|
|
823
|
+
createMember(input: UsersCreateMemberInput, options?: NivaRequestOptions): Promise<UsersCreateMemberOutput>;
|
|
824
|
+
/**
|
|
825
|
+
* users.listMembers operation.
|
|
826
|
+
*
|
|
827
|
+
* Returns a paginated list of the organization's members, optionally filtered by membership `status`.
|
|
828
|
+
*/
|
|
829
|
+
listMembers(input?: UsersListMembersInput, options?: NivaRequestOptions): Promise<UsersListMembersOutput>;
|
|
830
|
+
/**
|
|
831
|
+
* users.me operation.
|
|
832
|
+
*
|
|
833
|
+
* Returns the authenticated user's profile for the current organization, including their effective `permissions`, role scope and feature flags. Under `X-API-Key` authentication this resolves to the user who created the key. A platform admin that is not a member of the resolved organization is answered from its platform-scope membership. Returns `null` (HTTP 200) when an organization-scoped caller is not a member of the organization.
|
|
834
|
+
*/
|
|
835
|
+
me(options?: NivaRequestOptions): Promise<UsersMeOutput>;
|
|
836
|
+
/**
|
|
837
|
+
* users.removeMember operation.
|
|
838
|
+
*
|
|
839
|
+
* Removes a member from the organization. Returns 409 CANNOT_REMOVE_SELF when the caller targets their own membership and 404 MEMBER_NOT_FOUND when the member does not exist. Returns `{ success: true }` on success.
|
|
840
|
+
*/
|
|
841
|
+
removeMember(input: UsersRemoveMemberInput, options?: NivaRequestOptions): Promise<UsersRemoveMemberOutput>;
|
|
842
|
+
/**
|
|
843
|
+
* users.suspendMember operation.
|
|
844
|
+
*
|
|
845
|
+
* Suspends a member, blocking their access while keeping the membership. Returns 409 CANNOT_SUSPEND_SELF when the caller targets themselves and 404 MEMBER_NOT_FOUND when the member does not exist.
|
|
846
|
+
*/
|
|
847
|
+
suspendMember(input: UsersSuspendMemberInput, options?: NivaRequestOptions): Promise<UsersSuspendMemberOutput>;
|
|
848
|
+
/**
|
|
849
|
+
* users.updateRole operation.
|
|
850
|
+
*
|
|
851
|
+
* Assigns a new role to a member. Returns 422 ROLE_SCOPE_MISMATCH when the role cannot be assigned in this organization context, 404 ROLE_NOT_FOUND when the role does not exist, and 404 MEMBER_NOT_FOUND when the member does not exist.
|
|
852
|
+
*/
|
|
853
|
+
updateRole(input: UsersUpdateRoleInput, options?: NivaRequestOptions): Promise<UsersUpdateRoleOutput>;
|
|
854
|
+
};
|
|
855
|
+
visualPlans: {
|
|
856
|
+
/**
|
|
857
|
+
* visualPlans.clone operation.
|
|
858
|
+
*
|
|
859
|
+
* Creates a new plan that duplicates the source plan's node graph and settings under a new name. The clone starts unpublished. Returns 404 PLAN_NOT_FOUND when the source plan does not exist.
|
|
860
|
+
*/
|
|
861
|
+
clone(input: VisualPlansCloneInput, options?: NivaRequestOptions): Promise<VisualPlansCloneOutput>;
|
|
862
|
+
/**
|
|
863
|
+
* visualPlans.create operation.
|
|
864
|
+
*
|
|
865
|
+
* Creates a visual plan. When `language` is omitted the organization's default language is used. Setting `transcription_enabled` to `true` requires the AI module, otherwise 403 MODULE_DISABLED is returned.
|
|
866
|
+
*/
|
|
867
|
+
create(input: VisualPlansCreateInput, options?: NivaRequestOptions): Promise<VisualPlansCreateOutput>;
|
|
868
|
+
/**
|
|
869
|
+
* visualPlans.delete operation.
|
|
870
|
+
*
|
|
871
|
+
* Deletes a visual plan. Returns 409 DIALER_PLAN_IN_USE when the plan is still referenced by an active dialer campaign, and 404 PLAN_NOT_FOUND when it does not exist. Returns `{ success: true }` on success.
|
|
872
|
+
*/
|
|
873
|
+
delete(input: VisualPlansDeleteInput, options?: NivaRequestOptions): Promise<VisualPlansDeleteOutput>;
|
|
874
|
+
/**
|
|
875
|
+
* visualPlans.getById operation.
|
|
876
|
+
*
|
|
877
|
+
* Returns the visual plan together with its working draft and published editor state. Returns 404 PLAN_NOT_FOUND when the plan does not exist or belongs to another organization.
|
|
878
|
+
*/
|
|
879
|
+
getById(input: VisualPlansGetByIdInput, options?: NivaRequestOptions): Promise<VisualPlansGetByIdOutput>;
|
|
880
|
+
/**
|
|
881
|
+
* visualPlans.importDraft operation.
|
|
882
|
+
*
|
|
883
|
+
* Replaces the visual plan's working draft with a serialized editor state. The state is stored as a draft and is not published; references that do not exist in the destination organization are reported when the plan is published, matching the editor import flow.
|
|
884
|
+
*/
|
|
885
|
+
importDraft(input: VisualPlansImportDraftInput, options?: NivaRequestOptions): Promise<VisualPlansImportDraftOutput>;
|
|
886
|
+
/**
|
|
887
|
+
* visualPlans.list operation.
|
|
888
|
+
*
|
|
889
|
+
* Returns a paginated list of visual plans, each including its recording/transcription/speech-analytics settings and the channels currently assigned to it.
|
|
890
|
+
*/
|
|
891
|
+
list(input?: VisualPlansListInput, options?: NivaRequestOptions): Promise<VisualPlansListOutput>;
|
|
892
|
+
/**
|
|
893
|
+
* visualPlans.listVersions operation.
|
|
894
|
+
*
|
|
895
|
+
* Returns the plan's version history along with the id of the currently published version. Returns 404 PLAN_NOT_FOUND when the plan does not exist or belongs to another organization.
|
|
896
|
+
*/
|
|
897
|
+
listVersions(input: VisualPlansListVersionsInput, options?: NivaRequestOptions): Promise<VisualPlansListVersionsOutput>;
|
|
898
|
+
/**
|
|
899
|
+
* visualPlans.publish operation.
|
|
900
|
+
*
|
|
901
|
+
* Validates the draft and creates a new immutable version that immediately starts answering calls and chats. Returns 422 PLAN_VALIDATION_FAILED when the plan has validation errors (including nodes that rely on modules the organization's license has disabled) and 409 DRAFT_STALE when `expectedRevision` no longer matches the current draft. Emits a `plan.published` webhook on success.
|
|
902
|
+
*/
|
|
903
|
+
publish(input: VisualPlansPublishInput, options?: NivaRequestOptions): Promise<VisualPlansPublishOutput>;
|
|
904
|
+
/**
|
|
905
|
+
* visualPlans.update operation.
|
|
906
|
+
*
|
|
907
|
+
* Partially updates a visual plan's metadata and capture settings. Setting `transcription_enabled` to `true` requires the AI module, otherwise 403 MODULE_DISABLED is returned. This does not modify the plan's node graph (see the draft/publish endpoints).
|
|
908
|
+
*/
|
|
909
|
+
update(input: VisualPlansUpdateInput, options?: NivaRequestOptions): Promise<VisualPlansUpdateOutput>;
|
|
910
|
+
/**
|
|
911
|
+
* visualPlans.validate operation.
|
|
912
|
+
*
|
|
913
|
+
* Validates a plan supplied either by `planId` (the stored draft) or by an inline `execution_plan`, without persisting anything. Returns the overall `valid` flag and a list of issues; nodes that rely on modules disabled for the organization's license are reported as issues.
|
|
914
|
+
*/
|
|
915
|
+
validate(input?: VisualPlansValidateInput, options?: NivaRequestOptions): Promise<VisualPlansValidateOutput>;
|
|
916
|
+
};
|
|
917
|
+
webhooks: {
|
|
918
|
+
deliveries: {
|
|
919
|
+
/**
|
|
920
|
+
* webhooks.deliveries.count operation.
|
|
921
|
+
*
|
|
922
|
+
* Returns the exact filtered webhook delivery-log count. REST query parameters use snake_case. Requires the webhook:read scope.
|
|
923
|
+
*/
|
|
924
|
+
count(input: WebhooksDeliveriesCountInput, options?: NivaRequestOptions): Promise<WebhooksDeliveriesCountOutput>;
|
|
925
|
+
/**
|
|
926
|
+
* webhooks.deliveries.getById operation.
|
|
927
|
+
*
|
|
928
|
+
* Fetches a single delivery attempt by id, including the payload, response status/body and retry metadata. A missing or cross-org id returns 200 with a null body. Requires the webhook:read scope.
|
|
929
|
+
*/
|
|
930
|
+
getById(input: WebhooksDeliveriesGetByIdInput, options?: NivaRequestOptions): Promise<WebhooksDeliveriesGetByIdOutput>;
|
|
931
|
+
/**
|
|
932
|
+
* webhooks.deliveries.list operation.
|
|
933
|
+
*
|
|
934
|
+
* Returns webhook delivery metadata with opaque keyset pagination. REST query parameters use snake_case; payload and response bodies are available only from the detail endpoint during the effective payload retention window. Requires the webhook:read scope.
|
|
935
|
+
*/
|
|
936
|
+
list(input: WebhooksDeliveriesListInput, options?: NivaRequestOptions): Promise<WebhooksDeliveriesListOutput>;
|
|
937
|
+
/**
|
|
938
|
+
* webhooks.deliveries.retention operation.
|
|
939
|
+
*
|
|
940
|
+
* Returns the effective installation retention windows for full payloads, individual delivery metadata, and daily aggregates. Requires the webhook:read scope.
|
|
941
|
+
*/
|
|
942
|
+
retention(options?: NivaRequestOptions): Promise<WebhooksDeliveriesRetentionOutput>;
|
|
943
|
+
/**
|
|
944
|
+
* webhooks.deliveries.retry operation.
|
|
945
|
+
*
|
|
946
|
+
* Re-queues a failed or pending delivery within the payload retention window for another attempt and returns { success: true }. Delivered events cannot be retried; deliveries whose payload has expired return 409 WEBHOOK_DELIVERY_RETENTION_EXPIRED. Requires the webhook:update scope.
|
|
947
|
+
*/
|
|
948
|
+
retry(input: WebhooksDeliveriesRetryInput, options?: NivaRequestOptions): Promise<WebhooksDeliveriesRetryOutput>;
|
|
949
|
+
aggregates: {
|
|
950
|
+
/**
|
|
951
|
+
* webhooks.deliveries.aggregates.get operation.
|
|
952
|
+
*
|
|
953
|
+
* Breaks one completed organization-local day down by endpoint, event type and HTTP class, with the raw endpoint/event/outcome/HTTP-class rows behind it. A day outside the aggregate retention window, or one whose individual logs have not been drained yet, returns 404 WEBHOOK_DELIVERY_AGGREGATE_NOT_FOUND. Requires the webhook:read scope.
|
|
954
|
+
*/
|
|
955
|
+
get(input: WebhooksDeliveriesAggregatesGetInput, options?: NivaRequestOptions): Promise<WebhooksDeliveriesAggregatesGetOutput>;
|
|
956
|
+
/**
|
|
957
|
+
* webhooks.deliveries.aggregates.list operation.
|
|
958
|
+
*
|
|
959
|
+
* Returns one compact result per completed organization-local day. REST query parameters use snake_case. Requires the webhook:read scope.
|
|
960
|
+
*/
|
|
961
|
+
list(input?: WebhooksDeliveriesAggregatesListInput, options?: NivaRequestOptions): Promise<WebhooksDeliveriesAggregatesListOutput>;
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
endpoints: {
|
|
965
|
+
/**
|
|
966
|
+
* webhooks.endpoints.create operation.
|
|
967
|
+
*
|
|
968
|
+
* Creates a webhook endpoint subscribed to the given event types. Events whose required module is disabled in the license are silently stripped; if none remain the call returns 403 MODULE_DISABLED. The plaintext signing secret is returned once, only in this response. Requires the webhook:create scope.
|
|
969
|
+
*/
|
|
970
|
+
create(input: WebhooksEndpointsCreateInput, options?: NivaRequestOptions): Promise<WebhooksEndpointsCreateOutput>;
|
|
971
|
+
/**
|
|
972
|
+
* webhooks.endpoints.delete operation.
|
|
973
|
+
*
|
|
974
|
+
* Soft-deletes a webhook endpoint and returns { success: true }. An unknown id returns 404 WEBHOOK_ENDPOINT_NOT_FOUND. Requires the webhook:delete scope.
|
|
975
|
+
*/
|
|
976
|
+
delete(input: WebhooksEndpointsDeleteInput, options?: NivaRequestOptions): Promise<WebhooksEndpointsDeleteOutput>;
|
|
977
|
+
/**
|
|
978
|
+
* webhooks.endpoints.getById operation.
|
|
979
|
+
*
|
|
980
|
+
* Fetches a single webhook endpoint by id. A missing or cross-org id returns 200 with a null body; the signing secret is never included. Requires the webhook:read scope.
|
|
981
|
+
*/
|
|
982
|
+
getById(input: WebhooksEndpointsGetByIdInput, options?: NivaRequestOptions): Promise<WebhooksEndpointsGetByIdOutput>;
|
|
983
|
+
/**
|
|
984
|
+
* webhooks.endpoints.list operation.
|
|
985
|
+
*
|
|
986
|
+
* Returns the org's webhook endpoints as a paginated envelope. The signing secret is never included. Requires the webhook:read scope.
|
|
987
|
+
*/
|
|
988
|
+
list(input?: WebhooksEndpointsListInput, options?: NivaRequestOptions): Promise<WebhooksEndpointsListOutput>;
|
|
989
|
+
/**
|
|
990
|
+
* webhooks.endpoints.rotateSecret operation.
|
|
991
|
+
*
|
|
992
|
+
* Generates a new signing secret for the endpoint, invalidating the previous one, and returns the new plaintext secret (shown only in this response). An unknown id returns 404 WEBHOOK_ENDPOINT_NOT_FOUND. Requires the webhook:update scope.
|
|
993
|
+
*/
|
|
994
|
+
rotateSecret(input: WebhooksEndpointsRotateSecretInput, options?: NivaRequestOptions): Promise<WebhooksEndpointsRotateSecretOutput>;
|
|
995
|
+
/**
|
|
996
|
+
* webhooks.endpoints.update operation.
|
|
997
|
+
*
|
|
998
|
+
* Partially updates a webhook endpoint. When events are supplied, those whose required module is disabled are stripped and an empty resulting set returns 403 MODULE_DISABLED. An unknown id returns 404 WEBHOOK_ENDPOINT_NOT_FOUND. Requires the webhook:update scope.
|
|
999
|
+
*/
|
|
1000
|
+
update(input: WebhooksEndpointsUpdateInput, options?: NivaRequestOptions): Promise<WebhooksEndpointsUpdateOutput>;
|
|
1001
|
+
};
|
|
1002
|
+
events: {
|
|
1003
|
+
/**
|
|
1004
|
+
* webhooks.events.list operation.
|
|
1005
|
+
*
|
|
1006
|
+
* Returns the technical fields, required module metadata, and example payload for every webhook event. The call.analysis_completed schema documents one aggregate delivery containing all parallel analysis results, including per-analysis failures. Requires the webhook:read scope.
|
|
1007
|
+
*/
|
|
1008
|
+
list(options?: NivaRequestOptions): Promise<WebhooksEventsListOutput>;
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
}
|