@signalhouse-sms/sdk 1.14.0 → 1.16.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/package.json +1 -1
- package/src/SignalHouseSDK.js +6 -0
- package/src/domains/Auth.js +3 -2
- package/src/domains/Brands.js +1 -1
- package/src/domains/Compliance.js +324 -0
- package/src/domains/Groups.js +68 -0
- package/src/domains/Messages.js +1 -1
- package/src/domains/Subgroups.js +51 -0
- package/src/domains/Vetting.js +159 -0
- package/src/domains/Voice.js +3 -0
- package/src/domains/voice/CallFlows.js +243 -0
- package/src/domains/voice/NumberRoutes.js +2 -1
- package/src/domains/voice/ProgrammableVoiceProfiles.js +4 -2
- package/types/SignalHouseSDK.d.ts +4 -0
- package/types/domains/Auth.d.ts +3 -1
- package/types/domains/Brands.d.ts +1 -1
- package/types/domains/Compliance.d.ts +325 -0
- package/types/domains/Groups.d.ts +64 -0
- package/types/domains/Messages.d.ts +1 -1
- package/types/domains/Subgroups.d.ts +51 -0
- package/types/domains/Vetting.d.ts +163 -0
- package/types/domains/Voice.d.ts +3 -0
- package/types/domains/voice/CallFlows.d.ts +319 -0
- package/types/domains/voice/NumberRoutes.d.ts +8 -3
- package/types/domains/voice/ProgrammableVoiceProfiles.d.ts +16 -6
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
|
|
2
|
+
/**
|
|
3
|
+
* @template T
|
|
4
|
+
* @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} CallFlowListFilters
|
|
8
|
+
* @property {number} [page] - Page number, from 1 (default 1).
|
|
9
|
+
* @property {number} [limit] - Page size, 1-100 (default 20).
|
|
10
|
+
* @property {string} [q] - Match against the flow name.
|
|
11
|
+
* @property {string} [subgroupId] - Only flows in this subgroup.
|
|
12
|
+
* @property {boolean} [includeDeleted] - Include deleted flows (default false).
|
|
13
|
+
* @property {"createdAt"|"updatedAt"|"name"} [sortBy] - Sort field (default "createdAt").
|
|
14
|
+
* @property {"asc"|"desc"} [sortOrder] - Sort direction (default "desc").
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {Object} CreateCallFlowData
|
|
18
|
+
* @property {string} name - Flow name, unique within its subgroup.
|
|
19
|
+
* @property {string} subgroupId - The subgroup the flow belongs to. Fixed once created; only numbers and Programmable Voice Profiles in this subgroup can run the flow.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {Object} UpdateCallFlowData
|
|
23
|
+
* @property {string} [name] - New name, unique within the flow's subgroup.
|
|
24
|
+
* @property {"ACTIVE"|"DISABLED"} [status] - A disabled flow does not run; numbers routed to it fall through to their next routing layer.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {Object} CallFlowStep
|
|
28
|
+
* @property {string} id - A UUID you generate. It is kept as the step's id, so it stays stable across saves.
|
|
29
|
+
* @property {"inbound"|"answer"|"play"|"sms"|"ivr"|"fwd_phone"|"voicemail"|"hangup"} type - The step kind. `catalog()` lists the kinds this service can run.
|
|
30
|
+
* @property {string} name - Display name.
|
|
31
|
+
* @property {Object} [config] - The step's settings, which depend on its type.
|
|
32
|
+
* @property {number} [positionX] - Canvas x position, for a visual builder.
|
|
33
|
+
* @property {number} [positionY] - Canvas y position, for a visual builder.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* @typedef {Object} CallFlowConnection
|
|
37
|
+
* @property {string} id - A UUID you generate.
|
|
38
|
+
* @property {string} fromNodeId - The step the connection leaves.
|
|
39
|
+
* @property {string} toNodeId - The step it leads to.
|
|
40
|
+
* @property {string} port - The outcome of the source step it leaves from, e.g. "next", "success", "no_input" or "opt_<optionId>".
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* @typedef {Object} CallFlowDraft
|
|
44
|
+
* @property {CallFlowStep[]} nodes - Every step in the flow, including exactly one "inbound" step.
|
|
45
|
+
* @property {CallFlowConnection[]} edges - Every connection between steps.
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Call Flows — customer-built call trees (greeting, menu, forward, voicemail, hang up)
|
|
49
|
+
* that run when a number's route, or its Programmable Voice Profile, names the flow
|
|
50
|
+
* with `routeAction: "CALL_FLOW"`.
|
|
51
|
+
*
|
|
52
|
+
* Each flow has one working draft you edit with `saveDraft`, and published versions.
|
|
53
|
+
* `publish` validates the draft and makes it the version calls run; the draft stays
|
|
54
|
+
* editable without affecting calls until you publish again.
|
|
55
|
+
*
|
|
56
|
+
* Calls the Voice service mounted under /voice. Accessed via `sdk.voice.callFlows`.
|
|
57
|
+
*/
|
|
58
|
+
export class CallFlows {
|
|
59
|
+
constructor(client: any, enableAdmin: any);
|
|
60
|
+
client: any;
|
|
61
|
+
enableAdmin: any;
|
|
62
|
+
/**
|
|
63
|
+
* List the account's call flows, newest first by default.
|
|
64
|
+
* @async
|
|
65
|
+
* @roles api, admin, developer, billing, user
|
|
66
|
+
* @param {Object} [params] - Request parameters.
|
|
67
|
+
* @param {CallFlowListFilters} [params.filters] - Paging, search, subgroup and sort.
|
|
68
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
69
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: [...], meta: { total, page, limit, totalPages } }`.
|
|
70
|
+
*/
|
|
71
|
+
list({ filters, options }?: {
|
|
72
|
+
filters?: CallFlowListFilters;
|
|
73
|
+
options?: RequestOptions;
|
|
74
|
+
}): Promise<SdkResponse<any>>;
|
|
75
|
+
/**
|
|
76
|
+
* List the step types this service can run, with the outcomes each one offers.
|
|
77
|
+
* @async
|
|
78
|
+
* @roles api, admin, developer, billing, user
|
|
79
|
+
* @param {Object} [params] - Request parameters.
|
|
80
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
81
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { nodeTypes: [{ type, ports, configurable }] } }`.
|
|
82
|
+
*/
|
|
83
|
+
catalog({ options }?: {
|
|
84
|
+
options?: RequestOptions;
|
|
85
|
+
}): Promise<SdkResponse<any>>;
|
|
86
|
+
/**
|
|
87
|
+
* Get a call flow with its working draft and the issues that stop the draft being published.
|
|
88
|
+
* @async
|
|
89
|
+
* @roles api, admin, developer, billing, user
|
|
90
|
+
* @param {Object} params - Request parameters.
|
|
91
|
+
* @param {string} params.id - The call flow UUID.
|
|
92
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
93
|
+
* @throws {Error} If id is missing.
|
|
94
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { ...flow, draft: { versionId, nodes, edges, issues } } }`.
|
|
95
|
+
*/
|
|
96
|
+
get({ id, options }: {
|
|
97
|
+
id: string;
|
|
98
|
+
options?: RequestOptions;
|
|
99
|
+
}): Promise<SdkResponse<any>>;
|
|
100
|
+
/**
|
|
101
|
+
* Create a call flow, with its working draft and the Inbound Call step every flow starts from.
|
|
102
|
+
* @async
|
|
103
|
+
* @roles api, admin, developer
|
|
104
|
+
* @param {Object} params - Request parameters.
|
|
105
|
+
* @param {CreateCallFlowData} params.flowData - The flow to create.
|
|
106
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
107
|
+
* @throws {Error} If flowData is missing.
|
|
108
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { ...flow, draft } }`.
|
|
109
|
+
*/
|
|
110
|
+
create({ flowData, options }: {
|
|
111
|
+
flowData: CreateCallFlowData;
|
|
112
|
+
options?: RequestOptions;
|
|
113
|
+
}): Promise<SdkResponse<any>>;
|
|
114
|
+
/**
|
|
115
|
+
* Rename a call flow, or enable or disable it (partial update).
|
|
116
|
+
* @async
|
|
117
|
+
* @roles api, admin, developer
|
|
118
|
+
* @param {Object} params - Request parameters.
|
|
119
|
+
* @param {string} params.id - The call flow UUID.
|
|
120
|
+
* @param {UpdateCallFlowData} params.updateData - Fields to update.
|
|
121
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
122
|
+
* @throws {Error} If id or updateData is missing.
|
|
123
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { ...flow, draft } }`.
|
|
124
|
+
*/
|
|
125
|
+
update({ id, updateData, options }: {
|
|
126
|
+
id: string;
|
|
127
|
+
updateData: UpdateCallFlowData;
|
|
128
|
+
options?: RequestOptions;
|
|
129
|
+
}): Promise<SdkResponse<any>>;
|
|
130
|
+
/**
|
|
131
|
+
* Delete a call flow. Reversible with `restore`: while deleted, numbers and profiles
|
|
132
|
+
* routed to it fall through to their next routing layer.
|
|
133
|
+
* @async
|
|
134
|
+
* @roles api, admin, developer
|
|
135
|
+
* @param {Object} params - Request parameters.
|
|
136
|
+
* @param {string} params.id - The call flow UUID.
|
|
137
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
138
|
+
* @throws {Error} If id is missing.
|
|
139
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { ...flow } }`.
|
|
140
|
+
*/
|
|
141
|
+
delete({ id, options }: {
|
|
142
|
+
id: string;
|
|
143
|
+
options?: RequestOptions;
|
|
144
|
+
}): Promise<SdkResponse<any>>;
|
|
145
|
+
/**
|
|
146
|
+
* Restore a deleted call flow.
|
|
147
|
+
*
|
|
148
|
+
* Sends an empty JSON body: the SDK always declares JSON, and the Voice service
|
|
149
|
+
* rejects a JSON request with no body at all.
|
|
150
|
+
* @async
|
|
151
|
+
* @roles api, admin, developer
|
|
152
|
+
* @param {Object} params - Request parameters.
|
|
153
|
+
* @param {string} params.id - The call flow UUID.
|
|
154
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
155
|
+
* @throws {Error} If id is missing.
|
|
156
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { ...flow, draft } }`.
|
|
157
|
+
*/
|
|
158
|
+
restore({ id, options }: {
|
|
159
|
+
id: string;
|
|
160
|
+
options?: RequestOptions;
|
|
161
|
+
}): Promise<SdkResponse<any>>;
|
|
162
|
+
/**
|
|
163
|
+
* Copy a call flow and its working draft into a new flow in the same subgroup. The copy is not published.
|
|
164
|
+
* @async
|
|
165
|
+
* @roles api, admin, developer
|
|
166
|
+
* @param {Object} params - Request parameters.
|
|
167
|
+
* @param {string} params.id - The call flow UUID to copy.
|
|
168
|
+
* @param {string} [params.name] - Name for the copy (default "<name> (copy)").
|
|
169
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
170
|
+
* @throws {Error} If id is missing.
|
|
171
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { ...flow, draft } }`.
|
|
172
|
+
*/
|
|
173
|
+
duplicate({ id, name, options }: {
|
|
174
|
+
id: string;
|
|
175
|
+
name?: string;
|
|
176
|
+
options?: RequestOptions;
|
|
177
|
+
}): Promise<SdkResponse<any>>;
|
|
178
|
+
/**
|
|
179
|
+
* Replace the working draft. The whole draft is saved, even when it is not finished;
|
|
180
|
+
* the issues that would stop it being published come back in the response.
|
|
181
|
+
* @async
|
|
182
|
+
* @roles api, admin, developer
|
|
183
|
+
* @param {Object} params - Request parameters.
|
|
184
|
+
* @param {string} params.id - The call flow UUID.
|
|
185
|
+
* @param {CallFlowDraft} params.draft - Every step and connection.
|
|
186
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
187
|
+
* @throws {Error} If id or draft is missing.
|
|
188
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { nodes, edges, issues } }`.
|
|
189
|
+
*/
|
|
190
|
+
saveDraft({ id, draft, options }: {
|
|
191
|
+
id: string;
|
|
192
|
+
draft: CallFlowDraft;
|
|
193
|
+
options?: RequestOptions;
|
|
194
|
+
}): Promise<SdkResponse<any>>;
|
|
195
|
+
/**
|
|
196
|
+
* Publish the working draft, making it the version calls run. A draft that is not
|
|
197
|
+
* ready returns 400 with `error.issues` listing each step that needs attention.
|
|
198
|
+
*
|
|
199
|
+
* Sends an empty JSON body: the SDK always declares JSON, and the Voice service
|
|
200
|
+
* rejects a JSON request with no body at all.
|
|
201
|
+
* @async
|
|
202
|
+
* @roles api, admin, developer
|
|
203
|
+
* @param {Object} params - Request parameters.
|
|
204
|
+
* @param {string} params.id - The call flow UUID.
|
|
205
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
206
|
+
* @throws {Error} If id is missing.
|
|
207
|
+
* @returns {Promise<SdkResponse<any>>} `{ data: { id, versionNumber, status, publishedAt } }`.
|
|
208
|
+
*/
|
|
209
|
+
publish({ id, options }: {
|
|
210
|
+
id: string;
|
|
211
|
+
options?: RequestOptions;
|
|
212
|
+
}): Promise<SdkResponse<any>>;
|
|
213
|
+
}
|
|
214
|
+
export type RequestOptions = import("../../SignalHouseSDK.js").RequestOptions;
|
|
215
|
+
export type SdkResponse<T> = import("../../SignalHouseSDK.js").SdkResponse<T>;
|
|
216
|
+
export type CallFlowListFilters = {
|
|
217
|
+
/**
|
|
218
|
+
* - Page number, from 1 (default 1).
|
|
219
|
+
*/
|
|
220
|
+
page?: number;
|
|
221
|
+
/**
|
|
222
|
+
* - Page size, 1-100 (default 20).
|
|
223
|
+
*/
|
|
224
|
+
limit?: number;
|
|
225
|
+
/**
|
|
226
|
+
* - Match against the flow name.
|
|
227
|
+
*/
|
|
228
|
+
q?: string;
|
|
229
|
+
/**
|
|
230
|
+
* - Only flows in this subgroup.
|
|
231
|
+
*/
|
|
232
|
+
subgroupId?: string;
|
|
233
|
+
/**
|
|
234
|
+
* - Include deleted flows (default false).
|
|
235
|
+
*/
|
|
236
|
+
includeDeleted?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* - Sort field (default "createdAt").
|
|
239
|
+
*/
|
|
240
|
+
sortBy?: "createdAt" | "updatedAt" | "name";
|
|
241
|
+
/**
|
|
242
|
+
* - Sort direction (default "desc").
|
|
243
|
+
*/
|
|
244
|
+
sortOrder?: "asc" | "desc";
|
|
245
|
+
};
|
|
246
|
+
export type CreateCallFlowData = {
|
|
247
|
+
/**
|
|
248
|
+
* - Flow name, unique within its subgroup.
|
|
249
|
+
*/
|
|
250
|
+
name: string;
|
|
251
|
+
/**
|
|
252
|
+
* - The subgroup the flow belongs to. Fixed once created; only numbers and Programmable Voice Profiles in this subgroup can run the flow.
|
|
253
|
+
*/
|
|
254
|
+
subgroupId: string;
|
|
255
|
+
};
|
|
256
|
+
export type UpdateCallFlowData = {
|
|
257
|
+
/**
|
|
258
|
+
* - New name, unique within the flow's subgroup.
|
|
259
|
+
*/
|
|
260
|
+
name?: string;
|
|
261
|
+
/**
|
|
262
|
+
* - A disabled flow does not run; numbers routed to it fall through to their next routing layer.
|
|
263
|
+
*/
|
|
264
|
+
status?: "ACTIVE" | "DISABLED";
|
|
265
|
+
};
|
|
266
|
+
export type CallFlowStep = {
|
|
267
|
+
/**
|
|
268
|
+
* - A UUID you generate. It is kept as the step's id, so it stays stable across saves.
|
|
269
|
+
*/
|
|
270
|
+
id: string;
|
|
271
|
+
/**
|
|
272
|
+
* - The step kind. `catalog()` lists the kinds this service can run.
|
|
273
|
+
*/
|
|
274
|
+
type: "inbound" | "answer" | "play" | "sms" | "ivr" | "fwd_phone" | "voicemail" | "hangup";
|
|
275
|
+
/**
|
|
276
|
+
* - Display name.
|
|
277
|
+
*/
|
|
278
|
+
name: string;
|
|
279
|
+
/**
|
|
280
|
+
* - The step's settings, which depend on its type.
|
|
281
|
+
*/
|
|
282
|
+
config?: any;
|
|
283
|
+
/**
|
|
284
|
+
* - Canvas x position, for a visual builder.
|
|
285
|
+
*/
|
|
286
|
+
positionX?: number;
|
|
287
|
+
/**
|
|
288
|
+
* - Canvas y position, for a visual builder.
|
|
289
|
+
*/
|
|
290
|
+
positionY?: number;
|
|
291
|
+
};
|
|
292
|
+
export type CallFlowConnection = {
|
|
293
|
+
/**
|
|
294
|
+
* - A UUID you generate.
|
|
295
|
+
*/
|
|
296
|
+
id: string;
|
|
297
|
+
/**
|
|
298
|
+
* - The step the connection leaves.
|
|
299
|
+
*/
|
|
300
|
+
fromNodeId: string;
|
|
301
|
+
/**
|
|
302
|
+
* - The step it leads to.
|
|
303
|
+
*/
|
|
304
|
+
toNodeId: string;
|
|
305
|
+
/**
|
|
306
|
+
* - The outcome of the source step it leaves from, e.g. "next", "success", "no_input" or "opt_<optionId>".
|
|
307
|
+
*/
|
|
308
|
+
port: string;
|
|
309
|
+
};
|
|
310
|
+
export type CallFlowDraft = {
|
|
311
|
+
/**
|
|
312
|
+
* - Every step in the flow, including exactly one "inbound" step.
|
|
313
|
+
*/
|
|
314
|
+
nodes: CallFlowStep[];
|
|
315
|
+
/**
|
|
316
|
+
* - Every connection between steps.
|
|
317
|
+
*/
|
|
318
|
+
edges: CallFlowConnection[];
|
|
319
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* @typedef {Object} NumberRouteData
|
|
8
|
-
* @property {"FORWARD"|"WEBRTC"|"SIP_TRUNK"|"SIP_PROFILE"|"CALL_CONTROL"|"AI"|"VOICEMAIL"} routeAction - How inbound calls to the number are handled.
|
|
8
|
+
* @property {"FORWARD"|"WEBRTC"|"SIP_TRUNK"|"SIP_PROFILE"|"CALL_CONTROL"|"AI"|"VOICEMAIL"|"CALL_FLOW"} routeAction - How inbound calls to the number are handled. CALL_FLOW runs a call flow (see `sdk.voice.callFlows`).
|
|
9
9
|
* @property {string|null} [forwardToE164] - FORWARD destination (required for FORWARD), or the WEBRTC no-answer destination when noAnswerAction is FORWARD.
|
|
10
10
|
* @property {"VOICEMAIL"|"FORWARD"|"KEEP_RINGING"|null} [noAnswerAction] - WEBRTC only: what happens when nobody answers (default VOICEMAIL).
|
|
11
11
|
* @property {number|null} [noAnswerSeconds] - WEBRTC only: seconds to ring before the no-answer action, 5-120 (default 20).
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* @property {string|null} [routeSipProfileId] - SIP endpoint to ring (required for SIP_PROFILE).
|
|
14
14
|
* @property {string|null} [webhookUrl] - SHML program URL (required for CALL_CONTROL).
|
|
15
15
|
* @property {string|null} [routeAgentProfileId] - AI agent profile id, AGP… (required for AI).
|
|
16
|
+
* @property {string|null} [routeCallFlowId] - Call flow to run (required for CALL_FLOW). Must be in the number's subgroup. It need not be published yet: until it is, calls fall through to the number's profile or subgroup settings, which `effective` shows.
|
|
16
17
|
* @property {boolean} [recordingEnabled] - Record calls handled by this route.
|
|
17
18
|
*/
|
|
18
19
|
/**
|
|
@@ -76,9 +77,9 @@ export type RequestOptions = import("../../SignalHouseSDK.js").RequestOptions;
|
|
|
76
77
|
export type SdkResponse<T> = import("../../SignalHouseSDK.js").SdkResponse<T>;
|
|
77
78
|
export type NumberRouteData = {
|
|
78
79
|
/**
|
|
79
|
-
* - How inbound calls to the number are handled.
|
|
80
|
+
* - How inbound calls to the number are handled. CALL_FLOW runs a call flow (see `sdk.voice.callFlows`).
|
|
80
81
|
*/
|
|
81
|
-
routeAction: "FORWARD" | "WEBRTC" | "SIP_TRUNK" | "SIP_PROFILE" | "CALL_CONTROL" | "AI" | "VOICEMAIL";
|
|
82
|
+
routeAction: "FORWARD" | "WEBRTC" | "SIP_TRUNK" | "SIP_PROFILE" | "CALL_CONTROL" | "AI" | "VOICEMAIL" | "CALL_FLOW";
|
|
82
83
|
/**
|
|
83
84
|
* - FORWARD destination (required for FORWARD), or the WEBRTC no-answer destination when noAnswerAction is FORWARD.
|
|
84
85
|
*/
|
|
@@ -107,6 +108,10 @@ export type NumberRouteData = {
|
|
|
107
108
|
* - AI agent profile id, AGP… (required for AI).
|
|
108
109
|
*/
|
|
109
110
|
routeAgentProfileId?: string | null;
|
|
111
|
+
/**
|
|
112
|
+
* - Call flow to run (required for CALL_FLOW). Must be in the number's subgroup. It need not be published yet: until it is, calls fall through to the number's profile or subgroup settings, which `effective` shows.
|
|
113
|
+
*/
|
|
114
|
+
routeCallFlowId?: string | null;
|
|
110
115
|
/**
|
|
111
116
|
* - Record calls handled by this route.
|
|
112
117
|
*/
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
* @property {string} name - Profile name (required).
|
|
9
9
|
* @property {string[]} subgroupIds - Subgroups this profile spans (required, at least one).
|
|
10
10
|
* @property {string} [region] - Region/POP label.
|
|
11
|
-
* @property {"FORWARD"|"WEBRTC"|"SIP_TRUNK"|"SIP_PROFILE"|"CALL_CONTROL"|"AI"} [routeAction] - Inbound call action (default "FORWARD"). Deliver the call to a PSTN number (FORWARD), ring the profile's subgroup registered softphones (WEBRTC), send to a SIP trunk (SIP_TRUNK), ring a registered SIP endpoint (SIP_PROFILE), hand the call to your programmable call-control webhook that returns SHML (CALL_CONTROL),
|
|
11
|
+
* @property {"FORWARD"|"WEBRTC"|"SIP_TRUNK"|"SIP_PROFILE"|"CALL_CONTROL"|"AI"|"CALL_FLOW"} [routeAction] - Inbound call action (default "FORWARD"). Deliver the call to a PSTN number (FORWARD), ring the profile's subgroup registered softphones (WEBRTC), send to a SIP trunk (SIP_TRUNK), ring a registered SIP endpoint (SIP_PROFILE), hand the call to your programmable call-control webhook that returns SHML (CALL_CONTROL), answer it with an AI agent (AI), or run a call flow (CALL_FLOW).
|
|
12
12
|
* @property {string} [forwardToE164] - Destination number, required when routeAction is "FORWARD".
|
|
13
13
|
* @property {number} [forwardAfterSeconds] - Ring seconds before the action fires.
|
|
14
14
|
* @property {string} [routeSipTrunkId] - SIP trunk id, required when routeAction is "SIP_TRUNK".
|
|
15
15
|
* @property {string} [routeSipProfileId] - SIP endpoint id, required when routeAction is "SIP_PROFILE".
|
|
16
16
|
* @property {string} [webhookUrl] - Your inbound voice webhook (SHML program URL), required when routeAction is "CALL_CONTROL". Inbound calls to this profile's numbers are driven by the SHML your webhook returns.
|
|
17
17
|
* @property {string} [routeAgentProfileId] - AI agent profile id (AGP…), required when routeAction is "AI". The agent's prompt, voice, model and tools are read when the call lands, so editing the agent takes effect on the next call with nothing to re-save here.
|
|
18
|
+
* @property {string} [routeCallFlowId] - Call flow to run, required when routeAction is "CALL_FLOW". Must be in one of the profile's subgroups.
|
|
18
19
|
* @property {boolean} [recordingEnabled] - Record calls on this profile.
|
|
19
20
|
* @property {boolean} [enabled] - Active state (default true).
|
|
20
21
|
*/
|
|
@@ -23,13 +24,14 @@
|
|
|
23
24
|
* @property {string} [name] - Profile name.
|
|
24
25
|
* @property {string[]} [subgroupIds] - Subgroups this profile spans.
|
|
25
26
|
* @property {string|null} [region] - Region/POP label.
|
|
26
|
-
* @property {"FORWARD"|"WEBRTC"|"SIP_TRUNK"|"SIP_PROFILE"|"CALL_CONTROL"|"AI"} [routeAction] - Inbound call action (FORWARD | WEBRTC | SIP_TRUNK | SIP_PROFILE | CALL_CONTROL | AI).
|
|
27
|
+
* @property {"FORWARD"|"WEBRTC"|"SIP_TRUNK"|"SIP_PROFILE"|"CALL_CONTROL"|"AI"|"CALL_FLOW"} [routeAction] - Inbound call action (FORWARD | WEBRTC | SIP_TRUNK | SIP_PROFILE | CALL_CONTROL | AI | CALL_FLOW).
|
|
27
28
|
* @property {string|null} [forwardToE164] - FORWARD destination.
|
|
28
29
|
* @property {number|null} [forwardAfterSeconds] - Ring seconds before the action fires.
|
|
29
30
|
* @property {string|null} [routeSipTrunkId] - SIP trunk id (required when routeAction is "SIP_TRUNK").
|
|
30
31
|
* @property {string|null} [routeSipProfileId] - SIP endpoint id (required when routeAction is "SIP_PROFILE").
|
|
31
32
|
* @property {string|null} [webhookUrl] - Inbound voice webhook / SHML program URL (required when routeAction is "CALL_CONTROL"). Pass null to clear.
|
|
32
33
|
* @property {string|null} [routeAgentProfileId] - AI agent profile id (AGP…), required when routeAction is "AI". Pass null to clear.
|
|
34
|
+
* @property {string|null} [routeCallFlowId] - Call flow to run, required when routeAction is "CALL_FLOW". Must be in one of the profile's subgroups; narrowing subgroupIds away from it is refused. Pass null to clear.
|
|
33
35
|
* @property {boolean} [recordingEnabled] - Record calls on this profile.
|
|
34
36
|
* @property {boolean} [enabled] - Active state.
|
|
35
37
|
*/
|
|
@@ -182,9 +184,9 @@ export type CreateProgrammableVoiceProfileData = {
|
|
|
182
184
|
*/
|
|
183
185
|
region?: string;
|
|
184
186
|
/**
|
|
185
|
-
* - Inbound call action (default "FORWARD"). Deliver the call to a PSTN number (FORWARD), ring the profile's subgroup registered softphones (WEBRTC), send to a SIP trunk (SIP_TRUNK), ring a registered SIP endpoint (SIP_PROFILE), hand the call to your programmable call-control webhook that returns SHML (CALL_CONTROL),
|
|
187
|
+
* - Inbound call action (default "FORWARD"). Deliver the call to a PSTN number (FORWARD), ring the profile's subgroup registered softphones (WEBRTC), send to a SIP trunk (SIP_TRUNK), ring a registered SIP endpoint (SIP_PROFILE), hand the call to your programmable call-control webhook that returns SHML (CALL_CONTROL), answer it with an AI agent (AI), or run a call flow (CALL_FLOW).
|
|
186
188
|
*/
|
|
187
|
-
routeAction?: "FORWARD" | "WEBRTC" | "SIP_TRUNK" | "SIP_PROFILE" | "CALL_CONTROL" | "AI";
|
|
189
|
+
routeAction?: "FORWARD" | "WEBRTC" | "SIP_TRUNK" | "SIP_PROFILE" | "CALL_CONTROL" | "AI" | "CALL_FLOW";
|
|
188
190
|
/**
|
|
189
191
|
* - Destination number, required when routeAction is "FORWARD".
|
|
190
192
|
*/
|
|
@@ -209,6 +211,10 @@ export type CreateProgrammableVoiceProfileData = {
|
|
|
209
211
|
* - AI agent profile id (AGP…), required when routeAction is "AI". The agent's prompt, voice, model and tools are read when the call lands, so editing the agent takes effect on the next call with nothing to re-save here.
|
|
210
212
|
*/
|
|
211
213
|
routeAgentProfileId?: string;
|
|
214
|
+
/**
|
|
215
|
+
* - Call flow to run, required when routeAction is "CALL_FLOW". Must be in one of the profile's subgroups.
|
|
216
|
+
*/
|
|
217
|
+
routeCallFlowId?: string;
|
|
212
218
|
/**
|
|
213
219
|
* - Record calls on this profile.
|
|
214
220
|
*/
|
|
@@ -232,9 +238,9 @@ export type UpdateProgrammableVoiceProfileData = {
|
|
|
232
238
|
*/
|
|
233
239
|
region?: string | null;
|
|
234
240
|
/**
|
|
235
|
-
* - Inbound call action (FORWARD | WEBRTC | SIP_TRUNK | SIP_PROFILE | CALL_CONTROL | AI).
|
|
241
|
+
* - Inbound call action (FORWARD | WEBRTC | SIP_TRUNK | SIP_PROFILE | CALL_CONTROL | AI | CALL_FLOW).
|
|
236
242
|
*/
|
|
237
|
-
routeAction?: "FORWARD" | "WEBRTC" | "SIP_TRUNK" | "SIP_PROFILE" | "CALL_CONTROL" | "AI";
|
|
243
|
+
routeAction?: "FORWARD" | "WEBRTC" | "SIP_TRUNK" | "SIP_PROFILE" | "CALL_CONTROL" | "AI" | "CALL_FLOW";
|
|
238
244
|
/**
|
|
239
245
|
* - FORWARD destination.
|
|
240
246
|
*/
|
|
@@ -259,6 +265,10 @@ export type UpdateProgrammableVoiceProfileData = {
|
|
|
259
265
|
* - AI agent profile id (AGP…), required when routeAction is "AI". Pass null to clear.
|
|
260
266
|
*/
|
|
261
267
|
routeAgentProfileId?: string | null;
|
|
268
|
+
/**
|
|
269
|
+
* - Call flow to run, required when routeAction is "CALL_FLOW". Must be in one of the profile's subgroups; narrowing subgroupIds away from it is refused. Pass null to clear.
|
|
270
|
+
*/
|
|
271
|
+
routeCallFlowId?: string | null;
|
|
262
272
|
/**
|
|
263
273
|
* - Record calls on this profile.
|
|
264
274
|
*/
|