@sentdm/sentdm 0.45.0 → 0.47.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/CHANGELOG.md +19 -0
- package/client.d.mts +6 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -11
- package/client.d.ts.map +1 -1
- package/client.js +3 -10
- package/client.js.map +1 -1
- package/client.mjs +3 -10
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +25 -0
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +25 -0
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +28 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +26 -0
- package/core/pagination.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/channels/channels.d.mts +2 -2
- package/resources/channels/channels.d.mts.map +1 -1
- package/resources/channels/channels.d.ts +2 -2
- package/resources/channels/channels.d.ts.map +1 -1
- package/resources/channels/channels.js.map +1 -1
- package/resources/channels/channels.mjs.map +1 -1
- package/resources/channels/index.d.mts +1 -1
- package/resources/channels/index.d.mts.map +1 -1
- package/resources/channels/index.d.ts +1 -1
- package/resources/channels/index.d.ts.map +1 -1
- package/resources/channels/index.js.map +1 -1
- package/resources/channels/index.mjs.map +1 -1
- package/resources/channels/voice.d.mts +72 -115
- package/resources/channels/voice.d.mts.map +1 -1
- package/resources/channels/voice.d.ts +72 -115
- package/resources/channels/voice.d.ts.map +1 -1
- package/resources/channels/voice.js +35 -45
- package/resources/channels/voice.js.map +1 -1
- package/resources/channels/voice.mjs +35 -45
- package/resources/channels/voice.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +8 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +8 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/profiles/campaigns.d.mts +3 -2
- package/resources/profiles/campaigns.d.mts.map +1 -1
- package/resources/profiles/campaigns.d.ts +3 -2
- package/resources/profiles/campaigns.d.ts.map +1 -1
- package/resources/profiles/campaigns.js +3 -2
- package/resources/profiles/campaigns.js.map +1 -1
- package/resources/profiles/campaigns.mjs +3 -2
- package/resources/profiles/campaigns.mjs.map +1 -1
- package/resources/templates.d.mts +14 -13
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +14 -13
- package/resources/templates.d.ts.map +1 -1
- package/resources/voice/agents.d.mts +524 -0
- package/resources/voice/agents.d.mts.map +1 -0
- package/resources/voice/agents.d.ts +524 -0
- package/resources/voice/agents.d.ts.map +1 -0
- package/resources/voice/agents.js +193 -0
- package/resources/voice/agents.js.map +1 -0
- package/resources/voice/agents.mjs +189 -0
- package/resources/voice/agents.mjs.map +1 -0
- package/resources/{calls → voice/calls}/calls.d.mts +103 -26
- package/resources/voice/calls/calls.d.mts.map +1 -0
- package/resources/{calls → voice/calls}/calls.d.ts +103 -26
- package/resources/voice/calls/calls.d.ts.map +1 -0
- package/resources/{calls → voice/calls}/calls.js +35 -28
- package/resources/voice/calls/calls.js.map +1 -0
- package/resources/{calls → voice/calls}/calls.mjs +34 -27
- package/resources/voice/calls/calls.mjs.map +1 -0
- package/resources/voice/calls/index.d.mts.map +1 -0
- package/resources/voice/calls/index.d.ts.map +1 -0
- package/resources/voice/calls/index.js.map +1 -0
- package/resources/voice/calls/index.mjs.map +1 -0
- package/resources/{calls → voice/calls}/participants.d.mts +16 -14
- package/resources/voice/calls/participants.d.mts.map +1 -0
- package/resources/{calls → voice/calls}/participants.d.ts +16 -14
- package/resources/voice/calls/participants.d.ts.map +1 -0
- package/resources/{calls → voice/calls}/participants.js +19 -17
- package/resources/voice/calls/participants.js.map +1 -0
- package/resources/{calls → voice/calls}/participants.mjs +19 -17
- package/resources/voice/calls/participants.mjs.map +1 -0
- package/resources/voice/calls.d.mts.map +1 -0
- package/resources/voice/calls.d.ts.map +1 -0
- package/resources/{calls.js → voice/calls.js} +1 -1
- package/resources/voice/calls.js.map +1 -0
- package/resources/voice/calls.mjs.map +1 -0
- package/resources/voice/catalogue.d.mts +86 -0
- package/resources/voice/catalogue.d.mts.map +1 -0
- package/resources/voice/catalogue.d.ts +86 -0
- package/resources/voice/catalogue.d.ts.map +1 -0
- package/resources/voice/catalogue.js +40 -0
- package/resources/voice/catalogue.js.map +1 -0
- package/resources/voice/catalogue.mjs +36 -0
- package/resources/voice/catalogue.mjs.map +1 -0
- package/resources/voice/index.d.mts +6 -0
- package/resources/voice/index.d.mts.map +1 -0
- package/resources/voice/index.d.ts +6 -0
- package/resources/voice/index.d.ts.map +1 -0
- package/resources/voice/index.js +15 -0
- package/resources/voice/index.js.map +1 -0
- package/resources/voice/index.mjs +7 -0
- package/resources/voice/index.mjs.map +1 -0
- package/resources/voice/tokens.d.mts +111 -0
- package/resources/voice/tokens.d.mts.map +1 -0
- package/resources/voice/tokens.d.ts +111 -0
- package/resources/voice/tokens.d.ts.map +1 -0
- package/resources/voice/tokens.js +47 -0
- package/resources/voice/tokens.js.map +1 -0
- package/resources/voice/tokens.mjs +43 -0
- package/resources/voice/tokens.mjs.map +1 -0
- package/resources/voice/voice.d.mts +22 -0
- package/resources/voice/voice.d.mts.map +1 -0
- package/resources/voice/voice.d.ts +22 -0
- package/resources/voice/voice.d.ts.map +1 -0
- package/resources/voice/voice.js +29 -0
- package/resources/voice/voice.js.map +1 -0
- package/resources/voice/voice.mjs +24 -0
- package/resources/voice/voice.mjs.map +1 -0
- package/resources/voice.d.mts +2 -0
- package/resources/voice.d.mts.map +1 -0
- package/resources/voice.d.ts +2 -0
- package/resources/voice.d.ts.map +1 -0
- package/resources/voice.js +6 -0
- package/resources/voice.js.map +1 -0
- package/resources/voice.mjs +3 -0
- package/resources/voice.mjs.map +1 -0
- package/resources/webhooks.d.mts +154 -31
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +154 -31
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +51 -11
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +51 -11
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +12 -45
- package/src/core/pagination.ts +64 -0
- package/src/resources/channels/channels.ts +0 -6
- package/src/resources/channels/index.ts +0 -3
- package/src/resources/channels/voice.ts +74 -144
- package/src/resources/index.ts +1 -18
- package/src/resources/messages.ts +8 -1
- package/src/resources/profiles/campaigns.ts +3 -2
- package/src/resources/templates.ts +14 -13
- package/src/resources/voice/agents.ts +729 -0
- package/src/resources/{calls → voice/calls}/calls.ts +122 -33
- package/src/resources/{calls → voice/calls}/participants.ts +23 -21
- package/src/resources/voice/catalogue.ts +118 -0
- package/src/resources/voice/index.ts +55 -0
- package/src/resources/voice/tokens.ts +146 -0
- package/src/resources/voice/voice.ts +134 -0
- package/src/resources/voice.ts +3 -0
- package/src/resources/webhooks.ts +162 -31
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/calls/calls.d.mts.map +0 -1
- package/resources/calls/calls.d.ts.map +0 -1
- package/resources/calls/calls.js.map +0 -1
- package/resources/calls/calls.mjs.map +0 -1
- package/resources/calls/index.d.mts.map +0 -1
- package/resources/calls/index.d.ts.map +0 -1
- package/resources/calls/index.js.map +0 -1
- package/resources/calls/index.mjs.map +0 -1
- package/resources/calls/participants.d.mts.map +0 -1
- package/resources/calls/participants.d.ts.map +0 -1
- package/resources/calls/participants.js.map +0 -1
- package/resources/calls/participants.mjs.map +0 -1
- package/resources/calls.d.mts.map +0 -1
- package/resources/calls.d.ts.map +0 -1
- package/resources/calls.js.map +0 -1
- package/resources/calls.mjs.map +0 -1
- /package/resources/{calls → voice/calls}/index.d.mts +0 -0
- /package/resources/{calls → voice/calls}/index.d.ts +0 -0
- /package/resources/{calls → voice/calls}/index.js +0 -0
- /package/resources/{calls → voice/calls}/index.mjs +0 -0
- /package/resources/{calls.d.mts → voice/calls.d.mts} +0 -0
- /package/resources/{calls.d.ts → voice/calls.d.ts} +0 -0
- /package/resources/{calls.mjs → voice/calls.mjs} +0 -0
- /package/src/resources/{calls → voice/calls}/index.ts +0 -0
- /package/src/resources/{calls.ts → voice/calls.ts} +0 -0
|
@@ -10,7 +10,7 @@ import { path } from '../../internal/utils/path';
|
|
|
10
10
|
/**
|
|
11
11
|
* The senders you send from, one per channel.
|
|
12
12
|
*
|
|
13
|
-
* **SMS is a list of markets**, each keyed by `(country, number_type)` — a customer can hold `us/10dlc` and `gb/alphanumeric` at once, so a market is addressed by the pair rather than by country alone. **WhatsApp and RCS are single**: a customer has one business account and one agent. **Voice is per number**: each number you hold can carry phone calls on its own (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do with its calls, one of them is the default line for calls placed from your app, and voice tokens are minted
|
|
13
|
+
* **SMS is a list of markets**, each keyed by `(country, number_type)` — a customer can hold `us/10dlc` and `gb/alphanumeric` at once, so a market is addressed by the pair rather than by country alone. **WhatsApp and RCS are single**: a customer has one business account and one agent. **Voice is per number**: each number you hold can carry phone calls on its own (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do with its calls, one of them is the default line for calls placed from your app, and voice tokens are minted with `POST /v3/voice/tokens`. Read your voice numbers with `GET /v3/channels/voice` and change one with `PATCH /v3/channels/voice/{number}`.
|
|
14
14
|
*
|
|
15
15
|
* ## Compliance lives on the market
|
|
16
16
|
*
|
|
@@ -35,6 +35,16 @@ export class Voice extends APIResource {
|
|
|
35
35
|
* question the way you verify a webhook. `POST /v3/channels/voice/{number}/test`
|
|
36
36
|
* sends a test question and reports the verdict.
|
|
37
37
|
*
|
|
38
|
+
* Send `agent_id` instead of `callback_url`, or with it, to have one of your voice
|
|
39
|
+
* agents (`GET /v3/voice/agents`) answer calls to the number. The agent wins over
|
|
40
|
+
* the callback URL for calls to the number; calls your app places from it still
|
|
41
|
+
* follow your app. `routes_to` in the response says which answers, and reads
|
|
42
|
+
* `agent_pending` while the number is still being moved to the agent. Calls follow
|
|
43
|
+
* the move within about an hour, as the provider applies it on its own clock.
|
|
44
|
+
* While numbers cannot be bound to agents, a request with `agent_id` is refused
|
|
45
|
+
* with `502` before any number is obtained or anything is written; send
|
|
46
|
+
* `callback_url` instead.
|
|
47
|
+
*
|
|
38
48
|
* Your first voice number becomes the line app-originated calls are placed from
|
|
39
49
|
* when a voice token names no number; send `default_for_app_calls: true` to give
|
|
40
50
|
* that role to another number. A number you turned off earlier is turned back on,
|
|
@@ -109,18 +119,27 @@ export class Voice extends APIResource {
|
|
|
109
119
|
*
|
|
110
120
|
* ## What it changes
|
|
111
121
|
*
|
|
112
|
-
* | Body | Effect
|
|
113
|
-
* | --------------------------------------------- |
|
|
114
|
-
* | `"status": "ACTIVE"` | turns calls on again for a number you turned off; the callback URL and the secret it had are kept
|
|
115
|
-
* | `"status": "INACTIVE"` | turns calls off; the callback URL and the secret stay on the number
|
|
116
|
-
* | `"default_for_app_calls": true` | makes this the line app-originated calls are placed from when a voice token names no number
|
|
117
|
-
* | `"callback_url": "https://example.com/voice"` | replaces where Sent asks what to do with each call on the number; the signing secret
|
|
118
|
-
* |
|
|
122
|
+
* | Body | Effect |
|
|
123
|
+
* | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
124
|
+
* | `"status": "ACTIVE"` | turns calls on again for a number you turned off; the callback URL and the secret it had are kept |
|
|
125
|
+
* | `"status": "INACTIVE"` | turns calls off; the callback URL and the secret stay on the number |
|
|
126
|
+
* | `"default_for_app_calls": true` | makes this the line app-originated calls are placed from when a voice token names no number |
|
|
127
|
+
* | `"callback_url": "https://example.com/voice"` | replaces where Sent asks what to do with each call on the number; the signing secret and the status are kept |
|
|
128
|
+
* | `"agent_id": "agent_…"` | one of your voice agents answers calls to the number, within about an hour of the change (the provider applies the move on its own clock, and `routes_to` reads `agent` as soon as it has recorded it); it wins over `callback_url` for calls to the number, and calls your app places from it still follow your app. `routes_to` reads `agent_pending` while the number is still being moved to the agent |
|
|
129
|
+
* | `"agent_id": null` | unbinds the agent, so `callback_url` answers calls to the number again |
|
|
130
|
+
* | key omitted | left exactly as it is |
|
|
119
131
|
*
|
|
120
132
|
* `status` is matched ignoring case. Any combination is accepted:
|
|
121
133
|
* `status: "ACTIVE"` with `default_for_app_calls: true` turns a number on as the
|
|
122
|
-
* new default, and a `callback_url` sent with either status is written too.
|
|
123
|
-
*
|
|
134
|
+
* new default, and a `callback_url` sent with either status is written too.
|
|
135
|
+
* `agent_id` is applied first, so a refusal to move the number to or from the
|
|
136
|
+
* agent leaves everything as it was, and the `409` and `400` refusals below are
|
|
137
|
+
* decided before anything is written, so they leave everything as it was too. A
|
|
138
|
+
* body that names none of them is refused.
|
|
139
|
+
*
|
|
140
|
+
* A number can be on without a callback URL: calls placed from your app then
|
|
141
|
+
* connect straight to the number or user they dial, and calls to the number are
|
|
142
|
+
* declined.
|
|
124
143
|
*
|
|
125
144
|
* ## What it will refuse
|
|
126
145
|
*
|
|
@@ -135,13 +154,12 @@ export class Voice extends APIResource {
|
|
|
135
154
|
* **Making an inactive number the default is `400`.** Send `status: "ACTIVE"` in
|
|
136
155
|
* the same call.
|
|
137
156
|
*
|
|
138
|
-
* A number
|
|
139
|
-
*
|
|
140
|
-
* line if you have no other active voice number. A number you turned off while it
|
|
141
|
-
* had a URL stays off.
|
|
157
|
+
* **A number you never turned voice on for is `404`**, and so is an `agent_id`
|
|
158
|
+
* that is not one of your agents. Add the number with `POST /v3/channels/voice`.
|
|
142
159
|
*
|
|
143
|
-
*
|
|
144
|
-
* `
|
|
160
|
+
* **`502` means the number could not be moved to or from the agent**, or an
|
|
161
|
+
* `agent_id` was sent while numbers cannot be bound to agents; nothing was
|
|
162
|
+
* written.
|
|
145
163
|
*
|
|
146
164
|
* The number is the E.164 value in the path with the plus sign URL-encoded
|
|
147
165
|
* (`%2B`).
|
|
@@ -153,7 +171,7 @@ export class Voice extends APIResource {
|
|
|
153
171
|
* @example
|
|
154
172
|
* ```ts
|
|
155
173
|
* const apiResponseOfVoiceNumber =
|
|
156
|
-
* await client.channels.voice.update('
|
|
174
|
+
* await client.channels.voice.update('number');
|
|
157
175
|
* ```
|
|
158
176
|
*/
|
|
159
177
|
update(
|
|
@@ -206,35 +224,6 @@ export class Voice extends APIResource {
|
|
|
206
224
|
});
|
|
207
225
|
}
|
|
208
226
|
|
|
209
|
-
/**
|
|
210
|
-
* Mints a short-lived token for one of your app users. Call this from your backend
|
|
211
|
-
* and return the token to your app, which passes it to the voice client SDK to
|
|
212
|
-
* register. The identity is bound to the given number, or to your default app-call
|
|
213
|
-
* number when omitted, and calls placed by that identity are routed through the
|
|
214
|
-
* bound number. Minting again re-binds the identity, so an identity can move
|
|
215
|
-
* between numbers.
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* ```ts
|
|
219
|
-
* const apiResponseOfVoiceToken =
|
|
220
|
-
* await client.channels.voice.createToken();
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
createToken(params: VoiceCreateTokenParams, options?: RequestOptions): APIPromise<APIResponseOfVoiceToken> {
|
|
224
|
-
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
225
|
-
return this._client.post('/v3/channels/voice/tokens', {
|
|
226
|
-
body,
|
|
227
|
-
...options,
|
|
228
|
-
headers: buildHeaders([
|
|
229
|
-
{
|
|
230
|
-
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
231
|
-
...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
|
|
232
|
-
},
|
|
233
|
-
options?.headers,
|
|
234
|
-
]),
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
|
|
238
227
|
/**
|
|
239
228
|
* Generates a new signing secret for the questions Sent sends to this number's
|
|
240
229
|
* callback URL and returns it. The previous secret stops signing immediately, so
|
|
@@ -434,31 +423,6 @@ export interface APIResponseOfVoiceSecret {
|
|
|
434
423
|
success?: boolean;
|
|
435
424
|
}
|
|
436
425
|
|
|
437
|
-
/**
|
|
438
|
-
* Standard API response envelope for all v3 endpoints
|
|
439
|
-
*/
|
|
440
|
-
export interface APIResponseOfVoiceToken {
|
|
441
|
-
/**
|
|
442
|
-
* A short-lived token your app passes to the voice client SDK to register
|
|
443
|
-
*/
|
|
444
|
-
data?: VoiceToken | null;
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Error information
|
|
448
|
-
*/
|
|
449
|
-
error?: WebhooksAPI.ErrorDetail | null;
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* Request and response metadata
|
|
453
|
-
*/
|
|
454
|
-
meta?: WebhooksAPI.APIMeta;
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Indicates whether the request was successful
|
|
458
|
-
*/
|
|
459
|
-
success?: boolean;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
426
|
/**
|
|
463
427
|
* The verdict of a test question sent to your callback URL
|
|
464
428
|
*/
|
|
@@ -558,6 +522,14 @@ export interface VoiceCallbackTestResponseInfo {
|
|
|
558
522
|
* One number the profile carries phone calls on.
|
|
559
523
|
*/
|
|
560
524
|
export interface VoiceNumber {
|
|
525
|
+
/**
|
|
526
|
+
* The voice agent calls to this number go to, such as
|
|
527
|
+
* agent_9f2ab000-0000-4000-8000-000000000001. It wins over callback_url for calls
|
|
528
|
+
* to the number; calls your app places from the number still follow your app. Null
|
|
529
|
+
* when no agent answers the number.
|
|
530
|
+
*/
|
|
531
|
+
agent_id?: string | null;
|
|
532
|
+
|
|
561
533
|
/**
|
|
562
534
|
* Where Sent asks what to do with each call on this number: a signed question is
|
|
563
535
|
* POSTed here when a call arrives or a caller presses a key, and the answer
|
|
@@ -580,6 +552,14 @@ export interface VoiceNumber {
|
|
|
580
552
|
*/
|
|
581
553
|
number?: string;
|
|
582
554
|
|
|
555
|
+
/**
|
|
556
|
+
* Who answers calls to this number: agent, the voice agent in agent_id;
|
|
557
|
+
* agent_pending, that agent once the number has finished moving to it, with calls
|
|
558
|
+
* possibly unanswered until then; callback, your callback_url; or none, in which
|
|
559
|
+
* case calls to it are declined.
|
|
560
|
+
*/
|
|
561
|
+
routes_to?: string;
|
|
562
|
+
|
|
583
563
|
/**
|
|
584
564
|
* ACTIVE while the number carries calls, INACTIVE once it was turned off. Nothing
|
|
585
565
|
* provisions: a number the customer holds can carry calls the moment voice is
|
|
@@ -614,49 +594,33 @@ export interface VoiceSecret {
|
|
|
614
594
|
callback_secret?: string;
|
|
615
595
|
}
|
|
616
596
|
|
|
617
|
-
|
|
618
|
-
* A short-lived token your app passes to the voice client SDK to register
|
|
619
|
-
*/
|
|
620
|
-
export interface VoiceToken {
|
|
621
|
-
/**
|
|
622
|
-
* The signed token. Hand it to the client SDK unchanged.
|
|
623
|
-
*/
|
|
624
|
-
token?: string;
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* When the token expires (UTC)
|
|
628
|
-
*/
|
|
629
|
-
expires_at?: string;
|
|
630
|
-
|
|
597
|
+
export interface VoiceCreateParams {
|
|
631
598
|
/**
|
|
632
|
-
*
|
|
599
|
+
* Body param: One of your voice agents (GET /v3/voice/agents), such as
|
|
600
|
+
* agent_9f2ab000-0000-4000-8000-000000000001, to answer calls to this number. It
|
|
601
|
+
* wins over callback_url for calls to the number, and both may be sent; calls your
|
|
602
|
+
* app places from the number still follow your app. Send it instead of
|
|
603
|
+
* callback_url for a number only an agent answers.
|
|
633
604
|
*/
|
|
634
|
-
|
|
605
|
+
agent_id?: string | null;
|
|
635
606
|
|
|
636
607
|
/**
|
|
637
|
-
* The
|
|
608
|
+
* Body param: The US area code a new number should be in, as 212. Only for a
|
|
609
|
+
* request that leaves number out — sending both says two different things about
|
|
610
|
+
* which number to use, and is refused. Omit it too and the number comes from
|
|
611
|
+
* anywhere in the country.
|
|
638
612
|
*/
|
|
639
|
-
|
|
640
|
-
}
|
|
613
|
+
area_code?: string | null;
|
|
641
614
|
|
|
642
|
-
export interface VoiceCreateParams {
|
|
643
615
|
/**
|
|
644
616
|
* Body param: Where Sent asks what to do with each call on this number: an
|
|
645
617
|
* absolute HTTP or HTTPS URL on a public host. A signed question is POSTed here
|
|
646
618
|
* when a call arrives or a caller presses a key, and the answer decides the call.
|
|
647
619
|
* Every question is signed with the callback_secret the response returns, the same
|
|
648
620
|
* way your webhooks are signed. Turning the number on again with a different URL
|
|
649
|
-
* replaces it and keeps the secret.
|
|
621
|
+
* replaces it and keeps the secret. Required unless agent_id is sent.
|
|
650
622
|
*/
|
|
651
|
-
callback_url
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* Body param: The US area code a new number should be in, as 212. Only for a
|
|
655
|
-
* request that leaves number out — sending both says two different things about
|
|
656
|
-
* which number to use, and is refused. Omit it too and the number comes from
|
|
657
|
-
* anywhere in the country.
|
|
658
|
-
*/
|
|
659
|
-
area_code?: string | null;
|
|
623
|
+
callback_url?: string | null;
|
|
660
624
|
|
|
661
625
|
/**
|
|
662
626
|
* Body param: Make this the line app-originated calls are placed from when a voice
|
|
@@ -702,6 +666,15 @@ export interface VoiceRetrieveParams {
|
|
|
702
666
|
}
|
|
703
667
|
|
|
704
668
|
export interface VoiceUpdateParams {
|
|
669
|
+
/**
|
|
670
|
+
* Body param: One of your voice agents, such as
|
|
671
|
+
* agent_9f2ab000-0000-4000-8000-000000000001, to answer calls to the number, or
|
|
672
|
+
* null to unbind it so the callback URL answers them again. The agent wins over
|
|
673
|
+
* callback_url for calls to the number; calls your app places from it still follow
|
|
674
|
+
* your app.
|
|
675
|
+
*/
|
|
676
|
+
agent_id?: string | null;
|
|
677
|
+
|
|
705
678
|
/**
|
|
706
679
|
* Body param: A new callback URL for the number, active or not: an absolute HTTP
|
|
707
680
|
* or HTTPS URL on a public host, where Sent asks what to do with each call. The
|
|
@@ -753,46 +726,6 @@ export interface VoiceListParams {
|
|
|
753
726
|
'x-profile-id'?: string;
|
|
754
727
|
}
|
|
755
728
|
|
|
756
|
-
export interface VoiceCreateTokenParams {
|
|
757
|
-
/**
|
|
758
|
-
* Body param: Your identifier for the app user, such as an agent or account id.
|
|
759
|
-
* Letters, digits, hyphens and underscores only, up to 200 characters.
|
|
760
|
-
*/
|
|
761
|
-
identity?: string;
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* Body param: One of your voice-enabled phone numbers in E.164 format. Calls
|
|
765
|
-
* placed by this identity are routed through that number. Omit to use your default
|
|
766
|
-
* app-call number.
|
|
767
|
-
*/
|
|
768
|
-
number?: string | null;
|
|
769
|
-
|
|
770
|
-
/**
|
|
771
|
-
* Body param: Sandbox flag - when true, the operation is simulated without side
|
|
772
|
-
* effects Useful for testing integrations without actual execution
|
|
773
|
-
*/
|
|
774
|
-
sandbox?: boolean;
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* Body param: Token lifetime in seconds. Defaults to 600 and cannot exceed 3600.
|
|
778
|
-
*/
|
|
779
|
-
ttl?: number | null;
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
* Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
783
|
-
* alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
784
|
-
* hours per key per customer.
|
|
785
|
-
*/
|
|
786
|
-
'Idempotency-Key'?: string;
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
790
|
-
* organization API keys can use this header. The profile must belong to the
|
|
791
|
-
* calling organization.
|
|
792
|
-
*/
|
|
793
|
-
'x-profile-id'?: string;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
729
|
export interface VoiceRotateSecretParams {
|
|
797
730
|
/**
|
|
798
731
|
* Body param: Sandbox flag - when true, the operation is simulated without side
|
|
@@ -844,7 +777,6 @@ export declare namespace Voice {
|
|
|
844
777
|
type APIResponseOfVoiceNumber as APIResponseOfVoiceNumber,
|
|
845
778
|
type APIResponseOfVoiceNumberCreated as APIResponseOfVoiceNumberCreated,
|
|
846
779
|
type APIResponseOfVoiceSecret as APIResponseOfVoiceSecret,
|
|
847
|
-
type APIResponseOfVoiceToken as APIResponseOfVoiceToken,
|
|
848
780
|
type VoiceCallbackTest as VoiceCallbackTest,
|
|
849
781
|
type VoiceCallbackTestErrorInfo as VoiceCallbackTestErrorInfo,
|
|
850
782
|
type VoiceCallbackTestRequestInfo as VoiceCallbackTestRequestInfo,
|
|
@@ -852,12 +784,10 @@ export declare namespace Voice {
|
|
|
852
784
|
type VoiceNumber as VoiceNumber,
|
|
853
785
|
type VoiceNumberCreated as VoiceNumberCreated,
|
|
854
786
|
type VoiceSecret as VoiceSecret,
|
|
855
|
-
type VoiceToken as VoiceToken,
|
|
856
787
|
type VoiceCreateParams as VoiceCreateParams,
|
|
857
788
|
type VoiceRetrieveParams as VoiceRetrieveParams,
|
|
858
789
|
type VoiceUpdateParams as VoiceUpdateParams,
|
|
859
790
|
type VoiceListParams as VoiceListParams,
|
|
860
|
-
type VoiceCreateTokenParams as VoiceCreateTokenParams,
|
|
861
791
|
type VoiceRotateSecretParams as VoiceRotateSecretParams,
|
|
862
792
|
type VoiceTestParams as VoiceTestParams,
|
|
863
793
|
};
|
package/src/resources/index.ts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
Calls,
|
|
5
|
-
type APIResponseOfCall,
|
|
6
|
-
type APIResponseOfCallRecordings,
|
|
7
|
-
type APIResponseOfCallsList,
|
|
8
|
-
type Call,
|
|
9
|
-
type CallParty,
|
|
10
|
-
type CallRecording,
|
|
11
|
-
type CallRecordings,
|
|
12
|
-
type CallTimelineEntry,
|
|
13
|
-
type CallsList,
|
|
14
|
-
type CallRetrieveParams,
|
|
15
|
-
type CallListParams,
|
|
16
|
-
type CallHangupParams,
|
|
17
|
-
type CallListRecordingsParams,
|
|
18
|
-
type CallRecordParams,
|
|
19
|
-
type CallsCallsPage,
|
|
20
|
-
} from './calls/calls';
|
|
21
3
|
export { Channels } from './channels/channels';
|
|
22
4
|
export {
|
|
23
5
|
Contacts,
|
|
@@ -105,6 +87,7 @@ export {
|
|
|
105
87
|
type UserRemoveParams,
|
|
106
88
|
type UserUpdateRoleParams,
|
|
107
89
|
} from './users';
|
|
90
|
+
export { Voice } from './voice/voice';
|
|
108
91
|
export {
|
|
109
92
|
Webhooks,
|
|
110
93
|
type APIMeta,
|
|
@@ -646,6 +646,11 @@ export interface MessageSendParams {
|
|
|
646
646
|
* itself is unchanged: the same rules are scored and ranked the same way, with
|
|
647
647
|
* routes pinned to numbers you did not list removed from the running.
|
|
648
648
|
*
|
|
649
|
+
* Each channel's list is independent: an sms list does not restrict MMS. To choose
|
|
650
|
+
* the numbers a message may go out from as MMS, name them under mms. MMS sends
|
|
651
|
+
* from your SMS numbers, so an mms list may name any of your active SMS numbers
|
|
652
|
+
* whose market carries MMS — the ones listed under mms in your channels.
|
|
653
|
+
*
|
|
649
654
|
* Every number must be an active sender on your account. The request itself is
|
|
650
655
|
* still accepted (202) if one is not — like every other send-time rule, that is
|
|
651
656
|
* decided per message, so each affected message is recorded BLOCKED with error
|
|
@@ -663,7 +668,9 @@ export interface MessageSendParams {
|
|
|
663
668
|
*
|
|
664
669
|
* Their presence is also what makes a message eligible for MMS on an auto-detect
|
|
665
670
|
* send: a message with nothing attached is delivered as SMS, because an MMS with
|
|
666
|
-
* no media is a more expensive text message.
|
|
671
|
+
* no media is a more expensive text message. For the same reason a send that names
|
|
672
|
+
* mms in channel with nothing attached, here or on the template, is refused with
|
|
673
|
+
* a 400.
|
|
667
674
|
*
|
|
668
675
|
* The recipient's carrier fetches each URL after the send is accepted, so it must
|
|
669
676
|
* stay publicly reachable — a link that expires, or one behind auth, arrives as a
|
|
@@ -53,8 +53,9 @@ export class Campaigns extends APIResource {
|
|
|
53
53
|
* which models a profile's markets, compliance, brand, campaigns and billing
|
|
54
54
|
* explicitly.
|
|
55
55
|
*
|
|
56
|
-
* Updates an existing campaign under the brand of the specified profile.
|
|
57
|
-
*
|
|
56
|
+
* Updates an existing campaign under the brand of the specified profile. Once the
|
|
57
|
+
* campaign has been submitted to TCR its volume can no longer move between low
|
|
58
|
+
* volume (under 2,000 messages a day) and high volume.
|
|
58
59
|
*
|
|
59
60
|
* @deprecated
|
|
60
61
|
*/
|
|
@@ -255,17 +255,18 @@ export interface Template {
|
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
257
|
* The channels this template's definition can render on, in canonical order: sms,
|
|
258
|
-
* whatsapp, rcs.
|
|
258
|
+
* whatsapp, rcs, mms.
|
|
259
259
|
*
|
|
260
260
|
* Derived from the definition's body, mirroring each channel's send-time fallback
|
|
261
261
|
* chain, so a channel is listed only when a real body would be produced for it:
|
|
262
262
|
* SMS reads sms ?? multiChannel, WhatsApp reads whatsapp ?? multiChannel, and RCS
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
* too.
|
|
263
|
+
* and MMS read rcs ?? multiChannel ?? sms and mms ?? multiChannel ?? sms. A
|
|
264
|
+
* multiChannel body therefore reports all four, and the extra SMS fallback is why
|
|
265
|
+
* an sms/whatsapp pair reports RCS and MMS too.
|
|
266
266
|
*
|
|
267
267
|
* This says what the content can render on, not what may be sent: sending also
|
|
268
|
-
* needs the template approved for that channel
|
|
268
|
+
* needs the template approved for that channel, and MMS needs an attachment, from
|
|
269
|
+
* media_urls or the template's mms body.
|
|
269
270
|
*/
|
|
270
271
|
channels?: Array<string> | null;
|
|
271
272
|
|
|
@@ -323,10 +324,10 @@ export interface TemplateBody {
|
|
|
323
324
|
* MMS-specific content — subject, text and attachments.
|
|
324
325
|
*
|
|
325
326
|
* Like Rcs, an override that cannot stand on its own: a template still needs a
|
|
326
|
-
* MultiChannel body or the Sms + Whatsapp pair to be deliverable at all.
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
327
|
+
* MultiChannel body or the Sms + Whatsapp pair to be deliverable at all. Without
|
|
328
|
+
* this slot MMS renders the shared or SMS body, so it is only needed for
|
|
329
|
+
* MMS-specific copy, a subject or attachments. When present it replaces that body
|
|
330
|
+
* on MMS rather than adding to it.
|
|
330
331
|
*/
|
|
331
332
|
mms?: TemplateBody.Mms | null;
|
|
332
333
|
|
|
@@ -358,10 +359,10 @@ export namespace TemplateBody {
|
|
|
358
359
|
* MMS-specific content — subject, text and attachments.
|
|
359
360
|
*
|
|
360
361
|
* Like Rcs, an override that cannot stand on its own: a template still needs a
|
|
361
|
-
* MultiChannel body or the Sms + Whatsapp pair to be deliverable at all.
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
362
|
+
* MultiChannel body or the Sms + Whatsapp pair to be deliverable at all. Without
|
|
363
|
+
* this slot MMS renders the shared or SMS body, so it is only needed for
|
|
364
|
+
* MMS-specific copy, a subject or attachments. When present it replaces that body
|
|
365
|
+
* on MMS rather than adding to it.
|
|
365
366
|
*/
|
|
366
367
|
export interface Mms extends TemplatesAPI.TemplateBodyContent {
|
|
367
368
|
/**
|