@linqapp/sdk 0.35.1 → 0.37.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 +34 -0
- package/client.d.mts +86 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +86 -5
- package/client.d.ts.map +1 -1
- package/client.js +84 -3
- package/client.js.map +1 -1
- package/client.mjs +84 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/attachments.d.mts +3 -5
- package/resources/attachments.d.mts.map +1 -1
- package/resources/attachments.d.ts +3 -5
- package/resources/attachments.d.ts.map +1 -1
- package/resources/attachments.js +3 -5
- package/resources/attachments.js.map +1 -1
- package/resources/attachments.mjs +3 -5
- package/resources/attachments.mjs.map +1 -1
- package/resources/capability.d.mts +22 -0
- package/resources/capability.d.mts.map +1 -1
- package/resources/capability.d.ts +22 -0
- package/resources/capability.d.ts.map +1 -1
- package/resources/capability.js +7 -0
- package/resources/capability.js.map +1 -1
- package/resources/capability.mjs +7 -0
- package/resources/capability.mjs.map +1 -1
- package/resources/chats/chats.d.mts +20 -14
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +20 -14
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/messages.d.mts +4 -3
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +4 -3
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/experiences.d.mts +61 -3
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +61 -3
- package/resources/experiences.d.ts.map +1 -1
- package/resources/experiences.js +61 -3
- package/resources/experiences.js.map +1 -1
- package/resources/experiences.mjs +61 -3
- package/resources/experiences.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.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +13 -8
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +13 -8
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/payment-requests.d.mts +35 -0
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +35 -0
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +35 -0
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +35 -0
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +229 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +229 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +36 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +36 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/src/client.ts +104 -3
- package/src/resources/attachments.ts +3 -5
- package/src/resources/capability.ts +24 -0
- package/src/resources/chats/chats.ts +21 -15
- package/src/resources/chats/messages.ts +4 -3
- package/src/resources/experiences.ts +61 -3
- package/src/resources/index.ts +10 -0
- package/src/resources/messages/messages.ts +13 -8
- package/src/resources/payment-requests.ts +35 -0
- package/src/resources/phone-numbers.ts +286 -0
- 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
|
@@ -37,6 +37,228 @@ export declare class PhoneNumbers extends APIResource {
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
list(options?: RequestOptions): APIPromise<PhoneNumberListResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the audit's status and, once complete, the report. Audits are scoped to
|
|
42
|
+
* the line in the URL — an `auditId` started on a different line returns `404`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const reputationAudit =
|
|
47
|
+
* await client.phoneNumbers.getReputationAudit('auditId', {
|
|
48
|
+
* phoneNumber: 'phoneNumber',
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
getReputationAudit(auditID: string, params: PhoneNumberGetReputationAuditParams, options?: RequestOptions): APIPromise<ReputationAudit>;
|
|
53
|
+
/**
|
|
54
|
+
* Starts an asynchronous reputation audit for a line and returns an `audit_id`.
|
|
55
|
+
* Poll the GET endpoint for the result.
|
|
56
|
+
*
|
|
57
|
+
* Rate limited per line: only one audit may run at a time (a second request
|
|
58
|
+
* returns `409` while the first is still in progress), and a new audit can't be
|
|
59
|
+
* started for the same line until a cooldown elapses (`429`, with `Retry-After`
|
|
60
|
+
* carrying the wait).
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const reputationAuditStarted =
|
|
65
|
+
* await client.phoneNumbers.startReputationAudit(
|
|
66
|
+
* 'phoneNumber',
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
startReputationAudit(phoneNumber: string, options?: RequestOptions): APIPromise<ReputationAuditStarted>;
|
|
71
|
+
}
|
|
72
|
+
export interface ReputationActionItem {
|
|
73
|
+
detail?: string;
|
|
74
|
+
expected_impact?: 'high' | 'medium' | 'low';
|
|
75
|
+
/**
|
|
76
|
+
* 1 = do first
|
|
77
|
+
*/
|
|
78
|
+
priority?: number;
|
|
79
|
+
title?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ReputationAudit {
|
|
82
|
+
audit_id: string;
|
|
83
|
+
/**
|
|
84
|
+
* `pending` until the report is ready — poll until `complete` or `error`.
|
|
85
|
+
*/
|
|
86
|
+
status: 'pending' | 'complete' | 'error';
|
|
87
|
+
/**
|
|
88
|
+
* Present only when `status` is `error`. Short, generic reason safe to display.
|
|
89
|
+
*/
|
|
90
|
+
error?: string;
|
|
91
|
+
/**
|
|
92
|
+
* When the report was generated; signals reflect the line at this moment.
|
|
93
|
+
*/
|
|
94
|
+
generated_at?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The line audited, E.164.
|
|
97
|
+
*/
|
|
98
|
+
phone?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Present only when `status` is `complete`.
|
|
101
|
+
*/
|
|
102
|
+
report?: ReputationReport;
|
|
103
|
+
}
|
|
104
|
+
export interface ReputationAuditStarted {
|
|
105
|
+
/**
|
|
106
|
+
* Identifier for this audit. Poll
|
|
107
|
+
* `GET /v3/phone_numbers/{phoneNumber}/reputation_audit/{auditId}` until `status`
|
|
108
|
+
* is `complete` or `error`.
|
|
109
|
+
*/
|
|
110
|
+
audit_id: string;
|
|
111
|
+
/**
|
|
112
|
+
* A newly started audit is `pending`.
|
|
113
|
+
*/
|
|
114
|
+
status: 'pending' | 'complete' | 'error';
|
|
115
|
+
}
|
|
116
|
+
export interface ReputationDriver {
|
|
117
|
+
/**
|
|
118
|
+
* Stable driver-category identifier — what is dragging the line, or one of its
|
|
119
|
+
* conversations, down.
|
|
120
|
+
*
|
|
121
|
+
* - `low_engagement` — The conversation is one-sided: several messages sent, few
|
|
122
|
+
* or no replies back. Pause or rework outreach where recipients are not
|
|
123
|
+
* replying, and lead with messages that invite a response. Conversation-level:
|
|
124
|
+
* it appears on `evidence.unhealthy_chats[].driver_keys`, never in `drivers`.
|
|
125
|
+
* - `overall_conversation_health` — A large share of the line's active
|
|
126
|
+
* conversations are trending unhealthy. Fix those conversations first — review
|
|
127
|
+
* their content and timing, and whether recipients are engaging.
|
|
128
|
+
* - `volume_spike` — The line's daily sending volume jumped far above its own
|
|
129
|
+
* normal level. Ramp gradually instead of spiking, spread large sends across
|
|
130
|
+
* days, and prioritize people who have already engaged.
|
|
131
|
+
* - `new_conversation_rate` — The line is starting too many brand-new
|
|
132
|
+
* conversations in a single day. Spread new conversations out over time instead
|
|
133
|
+
* of starting many at once.
|
|
134
|
+
* - `opt_out_handling` — Recipients asked this line to stop. Honor every stop
|
|
135
|
+
* request immediately: send nothing further to that recipient unless they opt
|
|
136
|
+
* back in. Every send to them is rejected with `403` (error code `2024`),
|
|
137
|
+
* including a final courtesy message — to send one telling them they can reply
|
|
138
|
+
* to resume, set `override_optout: true` on that single request.
|
|
139
|
+
* - `flagged` — The line is currently restricted and its messages may not be
|
|
140
|
+
* reaching recipients. Move active traffic to a healthy line now, and let this
|
|
141
|
+
* one recover before sending more.
|
|
142
|
+
* - `other` — Fallback for a signal without dedicated partner copy.
|
|
143
|
+
*/
|
|
144
|
+
key?: ReputationDriverKey;
|
|
145
|
+
/**
|
|
146
|
+
* A specific observed figure when available; otherwise a short qualitative note.
|
|
147
|
+
*/
|
|
148
|
+
metric?: string;
|
|
149
|
+
/**
|
|
150
|
+
* One plain-English sentence.
|
|
151
|
+
*/
|
|
152
|
+
summary?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Stable driver-category identifier — what is dragging the line, or one of its
|
|
156
|
+
* conversations, down.
|
|
157
|
+
*
|
|
158
|
+
* - `low_engagement` — The conversation is one-sided: several messages sent, few
|
|
159
|
+
* or no replies back. Pause or rework outreach where recipients are not
|
|
160
|
+
* replying, and lead with messages that invite a response. Conversation-level:
|
|
161
|
+
* it appears on `evidence.unhealthy_chats[].driver_keys`, never in `drivers`.
|
|
162
|
+
* - `overall_conversation_health` — A large share of the line's active
|
|
163
|
+
* conversations are trending unhealthy. Fix those conversations first — review
|
|
164
|
+
* their content and timing, and whether recipients are engaging.
|
|
165
|
+
* - `volume_spike` — The line's daily sending volume jumped far above its own
|
|
166
|
+
* normal level. Ramp gradually instead of spiking, spread large sends across
|
|
167
|
+
* days, and prioritize people who have already engaged.
|
|
168
|
+
* - `new_conversation_rate` — The line is starting too many brand-new
|
|
169
|
+
* conversations in a single day. Spread new conversations out over time instead
|
|
170
|
+
* of starting many at once.
|
|
171
|
+
* - `opt_out_handling` — Recipients asked this line to stop. Honor every stop
|
|
172
|
+
* request immediately: send nothing further to that recipient unless they opt
|
|
173
|
+
* back in. Every send to them is rejected with `403` (error code `2024`),
|
|
174
|
+
* including a final courtesy message — to send one telling them they can reply
|
|
175
|
+
* to resume, set `override_optout: true` on that single request.
|
|
176
|
+
* - `flagged` — The line is currently restricted and its messages may not be
|
|
177
|
+
* reaching recipients. Move active traffic to a healthy line now, and let this
|
|
178
|
+
* one recover before sending more.
|
|
179
|
+
* - `other` — Fallback for a signal without dedicated partner copy.
|
|
180
|
+
*/
|
|
181
|
+
export type ReputationDriverKey = 'low_engagement' | 'overall_conversation_health' | 'volume_spike' | 'new_conversation_rate' | 'opt_out_handling' | 'flagged' | 'other';
|
|
182
|
+
/**
|
|
183
|
+
* The specific conversations behind the drivers, so partners can verify every
|
|
184
|
+
* claim against their own send logs. Each `chat_id` can be fetched via
|
|
185
|
+
* `GET /v3/chats/{chatId}` — its current health appears there.
|
|
186
|
+
*/
|
|
187
|
+
export interface ReputationEvidence {
|
|
188
|
+
/**
|
|
189
|
+
* Worst first — most messages sent after the stop request; honor these
|
|
190
|
+
* immediately.
|
|
191
|
+
*/
|
|
192
|
+
opt_out_chats?: Array<ReputationOptOutChat>;
|
|
193
|
+
/**
|
|
194
|
+
* Up to 15, worst first.
|
|
195
|
+
*/
|
|
196
|
+
unhealthy_chats?: Array<ReputationUnhealthyChat>;
|
|
197
|
+
}
|
|
198
|
+
export interface ReputationOptOutChat {
|
|
199
|
+
chat_id?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Outbound messages sent after the recipient asked to stop.
|
|
202
|
+
*/
|
|
203
|
+
messages_after_stop?: number;
|
|
204
|
+
}
|
|
205
|
+
export interface ReputationReport {
|
|
206
|
+
/**
|
|
207
|
+
* Ordered by `priority`; 1 = do first.
|
|
208
|
+
*/
|
|
209
|
+
action_items?: Array<ReputationActionItem>;
|
|
210
|
+
/**
|
|
211
|
+
* Ranked, highest impact first.
|
|
212
|
+
*/
|
|
213
|
+
drivers?: Array<ReputationDriver>;
|
|
214
|
+
/**
|
|
215
|
+
* The specific conversations behind the drivers, so partners can verify every
|
|
216
|
+
* claim against their own send logs. Each `chat_id` can be fetched via
|
|
217
|
+
* `GET /v3/chats/{chatId}` — its current health appears there.
|
|
218
|
+
*/
|
|
219
|
+
evidence?: ReputationEvidence;
|
|
220
|
+
/**
|
|
221
|
+
* The `key` of the most important driver. Empty string when the line has nothing
|
|
222
|
+
* to act on — the report then carries a single reassurance action item. Its values
|
|
223
|
+
* are the `ReputationDriverKey` vocabulary — see that schema for what each means
|
|
224
|
+
* and what to do about it.
|
|
225
|
+
*/
|
|
226
|
+
primary_driver?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Current reputation of this phone line.
|
|
229
|
+
*
|
|
230
|
+
* - `HEALTHY` — The line is in good standing. Send normally.
|
|
231
|
+
* - `AT_RISK` — Warning signs on the line: engagement is low across many of its
|
|
232
|
+
* conversations, or it's starting too many brand-new conversations in a single
|
|
233
|
+
* day — and a spike in send volume can add to either. Slow the line's send pace,
|
|
234
|
+
* avoid opening many new conversations at once, and review your messaging
|
|
235
|
+
* patterns.
|
|
236
|
+
* - `CRITICAL` — Strong signals that messages from this line aren't landing well.
|
|
237
|
+
* Pause outbound on the line until it recovers.
|
|
238
|
+
*
|
|
239
|
+
* Defaults to `HEALTHY` for lines that have not yet been scored.
|
|
240
|
+
*/
|
|
241
|
+
severity?: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
|
|
242
|
+
/**
|
|
243
|
+
* Deterministic markdown rendering of this report, suitable for feeding directly
|
|
244
|
+
* to automated systems and AI agents as investigation context. Rendered from the
|
|
245
|
+
* structured fields above, which remain the source of truth.
|
|
246
|
+
*/
|
|
247
|
+
summary_markdown?: string;
|
|
248
|
+
}
|
|
249
|
+
export interface ReputationUnhealthyChat {
|
|
250
|
+
chat_id?: string;
|
|
251
|
+
/**
|
|
252
|
+
* What is dragging this conversation down, in the same vocabulary as the report's
|
|
253
|
+
* drivers. Each key's meaning and the fix for it are documented on
|
|
254
|
+
* `ReputationDriverKey`.
|
|
255
|
+
*/
|
|
256
|
+
driver_keys?: Array<ReputationDriverKey>;
|
|
257
|
+
/**
|
|
258
|
+
* The conversation's current health — the same value `GET /v3/chats/{chatId}`
|
|
259
|
+
* reports for it.
|
|
260
|
+
*/
|
|
261
|
+
status?: 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
|
|
40
262
|
}
|
|
41
263
|
export interface PhoneNumberUpdateResponse {
|
|
42
264
|
/**
|
|
@@ -127,7 +349,13 @@ export interface PhoneNumberUpdateParams {
|
|
|
127
349
|
*/
|
|
128
350
|
forwarding_number: string | null;
|
|
129
351
|
}
|
|
352
|
+
export interface PhoneNumberGetReputationAuditParams {
|
|
353
|
+
/**
|
|
354
|
+
* The line in E.164 format.
|
|
355
|
+
*/
|
|
356
|
+
phoneNumber: string;
|
|
357
|
+
}
|
|
130
358
|
export declare namespace PhoneNumbers {
|
|
131
|
-
export { type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, };
|
|
359
|
+
export { type ReputationActionItem as ReputationActionItem, type ReputationAudit as ReputationAudit, type ReputationAuditStarted as ReputationAuditStarted, type ReputationDriver as ReputationDriver, type ReputationDriverKey as ReputationDriverKey, type ReputationEvidence as ReputationEvidence, type ReputationOptOutChat as ReputationOptOutChat, type ReputationReport as ReputationReport, type ReputationUnhealthyChat as ReputationUnhealthyChat, type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, type PhoneNumberGetReputationAuditParams as PhoneNumberGetReputationAuditParams, };
|
|
132
360
|
}
|
|
133
361
|
//# sourceMappingURL=phone-numbers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.d.mts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mapp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,CAAC;QAEnC;;;WAGG;QACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC;IAED,UAAiB,WAAW,CAAC;QAC3B;;;;;;;;;;WAUG;QACH,UAAiB,UAAU;YACzB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAEhB;;;;;;;;;;;;;eAaG;YACH,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;SAC5C;KACF;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mCAAmC,IAAI,mCAAmC,GAChF,CAAC;CACH"}
|
|
@@ -37,6 +37,228 @@ export declare class PhoneNumbers extends APIResource {
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
list(options?: RequestOptions): APIPromise<PhoneNumberListResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the audit's status and, once complete, the report. Audits are scoped to
|
|
42
|
+
* the line in the URL — an `auditId` started on a different line returns `404`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const reputationAudit =
|
|
47
|
+
* await client.phoneNumbers.getReputationAudit('auditId', {
|
|
48
|
+
* phoneNumber: 'phoneNumber',
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
getReputationAudit(auditID: string, params: PhoneNumberGetReputationAuditParams, options?: RequestOptions): APIPromise<ReputationAudit>;
|
|
53
|
+
/**
|
|
54
|
+
* Starts an asynchronous reputation audit for a line and returns an `audit_id`.
|
|
55
|
+
* Poll the GET endpoint for the result.
|
|
56
|
+
*
|
|
57
|
+
* Rate limited per line: only one audit may run at a time (a second request
|
|
58
|
+
* returns `409` while the first is still in progress), and a new audit can't be
|
|
59
|
+
* started for the same line until a cooldown elapses (`429`, with `Retry-After`
|
|
60
|
+
* carrying the wait).
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const reputationAuditStarted =
|
|
65
|
+
* await client.phoneNumbers.startReputationAudit(
|
|
66
|
+
* 'phoneNumber',
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
startReputationAudit(phoneNumber: string, options?: RequestOptions): APIPromise<ReputationAuditStarted>;
|
|
71
|
+
}
|
|
72
|
+
export interface ReputationActionItem {
|
|
73
|
+
detail?: string;
|
|
74
|
+
expected_impact?: 'high' | 'medium' | 'low';
|
|
75
|
+
/**
|
|
76
|
+
* 1 = do first
|
|
77
|
+
*/
|
|
78
|
+
priority?: number;
|
|
79
|
+
title?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ReputationAudit {
|
|
82
|
+
audit_id: string;
|
|
83
|
+
/**
|
|
84
|
+
* `pending` until the report is ready — poll until `complete` or `error`.
|
|
85
|
+
*/
|
|
86
|
+
status: 'pending' | 'complete' | 'error';
|
|
87
|
+
/**
|
|
88
|
+
* Present only when `status` is `error`. Short, generic reason safe to display.
|
|
89
|
+
*/
|
|
90
|
+
error?: string;
|
|
91
|
+
/**
|
|
92
|
+
* When the report was generated; signals reflect the line at this moment.
|
|
93
|
+
*/
|
|
94
|
+
generated_at?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The line audited, E.164.
|
|
97
|
+
*/
|
|
98
|
+
phone?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Present only when `status` is `complete`.
|
|
101
|
+
*/
|
|
102
|
+
report?: ReputationReport;
|
|
103
|
+
}
|
|
104
|
+
export interface ReputationAuditStarted {
|
|
105
|
+
/**
|
|
106
|
+
* Identifier for this audit. Poll
|
|
107
|
+
* `GET /v3/phone_numbers/{phoneNumber}/reputation_audit/{auditId}` until `status`
|
|
108
|
+
* is `complete` or `error`.
|
|
109
|
+
*/
|
|
110
|
+
audit_id: string;
|
|
111
|
+
/**
|
|
112
|
+
* A newly started audit is `pending`.
|
|
113
|
+
*/
|
|
114
|
+
status: 'pending' | 'complete' | 'error';
|
|
115
|
+
}
|
|
116
|
+
export interface ReputationDriver {
|
|
117
|
+
/**
|
|
118
|
+
* Stable driver-category identifier — what is dragging the line, or one of its
|
|
119
|
+
* conversations, down.
|
|
120
|
+
*
|
|
121
|
+
* - `low_engagement` — The conversation is one-sided: several messages sent, few
|
|
122
|
+
* or no replies back. Pause or rework outreach where recipients are not
|
|
123
|
+
* replying, and lead with messages that invite a response. Conversation-level:
|
|
124
|
+
* it appears on `evidence.unhealthy_chats[].driver_keys`, never in `drivers`.
|
|
125
|
+
* - `overall_conversation_health` — A large share of the line's active
|
|
126
|
+
* conversations are trending unhealthy. Fix those conversations first — review
|
|
127
|
+
* their content and timing, and whether recipients are engaging.
|
|
128
|
+
* - `volume_spike` — The line's daily sending volume jumped far above its own
|
|
129
|
+
* normal level. Ramp gradually instead of spiking, spread large sends across
|
|
130
|
+
* days, and prioritize people who have already engaged.
|
|
131
|
+
* - `new_conversation_rate` — The line is starting too many brand-new
|
|
132
|
+
* conversations in a single day. Spread new conversations out over time instead
|
|
133
|
+
* of starting many at once.
|
|
134
|
+
* - `opt_out_handling` — Recipients asked this line to stop. Honor every stop
|
|
135
|
+
* request immediately: send nothing further to that recipient unless they opt
|
|
136
|
+
* back in. Every send to them is rejected with `403` (error code `2024`),
|
|
137
|
+
* including a final courtesy message — to send one telling them they can reply
|
|
138
|
+
* to resume, set `override_optout: true` on that single request.
|
|
139
|
+
* - `flagged` — The line is currently restricted and its messages may not be
|
|
140
|
+
* reaching recipients. Move active traffic to a healthy line now, and let this
|
|
141
|
+
* one recover before sending more.
|
|
142
|
+
* - `other` — Fallback for a signal without dedicated partner copy.
|
|
143
|
+
*/
|
|
144
|
+
key?: ReputationDriverKey;
|
|
145
|
+
/**
|
|
146
|
+
* A specific observed figure when available; otherwise a short qualitative note.
|
|
147
|
+
*/
|
|
148
|
+
metric?: string;
|
|
149
|
+
/**
|
|
150
|
+
* One plain-English sentence.
|
|
151
|
+
*/
|
|
152
|
+
summary?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Stable driver-category identifier — what is dragging the line, or one of its
|
|
156
|
+
* conversations, down.
|
|
157
|
+
*
|
|
158
|
+
* - `low_engagement` — The conversation is one-sided: several messages sent, few
|
|
159
|
+
* or no replies back. Pause or rework outreach where recipients are not
|
|
160
|
+
* replying, and lead with messages that invite a response. Conversation-level:
|
|
161
|
+
* it appears on `evidence.unhealthy_chats[].driver_keys`, never in `drivers`.
|
|
162
|
+
* - `overall_conversation_health` — A large share of the line's active
|
|
163
|
+
* conversations are trending unhealthy. Fix those conversations first — review
|
|
164
|
+
* their content and timing, and whether recipients are engaging.
|
|
165
|
+
* - `volume_spike` — The line's daily sending volume jumped far above its own
|
|
166
|
+
* normal level. Ramp gradually instead of spiking, spread large sends across
|
|
167
|
+
* days, and prioritize people who have already engaged.
|
|
168
|
+
* - `new_conversation_rate` — The line is starting too many brand-new
|
|
169
|
+
* conversations in a single day. Spread new conversations out over time instead
|
|
170
|
+
* of starting many at once.
|
|
171
|
+
* - `opt_out_handling` — Recipients asked this line to stop. Honor every stop
|
|
172
|
+
* request immediately: send nothing further to that recipient unless they opt
|
|
173
|
+
* back in. Every send to them is rejected with `403` (error code `2024`),
|
|
174
|
+
* including a final courtesy message — to send one telling them they can reply
|
|
175
|
+
* to resume, set `override_optout: true` on that single request.
|
|
176
|
+
* - `flagged` — The line is currently restricted and its messages may not be
|
|
177
|
+
* reaching recipients. Move active traffic to a healthy line now, and let this
|
|
178
|
+
* one recover before sending more.
|
|
179
|
+
* - `other` — Fallback for a signal without dedicated partner copy.
|
|
180
|
+
*/
|
|
181
|
+
export type ReputationDriverKey = 'low_engagement' | 'overall_conversation_health' | 'volume_spike' | 'new_conversation_rate' | 'opt_out_handling' | 'flagged' | 'other';
|
|
182
|
+
/**
|
|
183
|
+
* The specific conversations behind the drivers, so partners can verify every
|
|
184
|
+
* claim against their own send logs. Each `chat_id` can be fetched via
|
|
185
|
+
* `GET /v3/chats/{chatId}` — its current health appears there.
|
|
186
|
+
*/
|
|
187
|
+
export interface ReputationEvidence {
|
|
188
|
+
/**
|
|
189
|
+
* Worst first — most messages sent after the stop request; honor these
|
|
190
|
+
* immediately.
|
|
191
|
+
*/
|
|
192
|
+
opt_out_chats?: Array<ReputationOptOutChat>;
|
|
193
|
+
/**
|
|
194
|
+
* Up to 15, worst first.
|
|
195
|
+
*/
|
|
196
|
+
unhealthy_chats?: Array<ReputationUnhealthyChat>;
|
|
197
|
+
}
|
|
198
|
+
export interface ReputationOptOutChat {
|
|
199
|
+
chat_id?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Outbound messages sent after the recipient asked to stop.
|
|
202
|
+
*/
|
|
203
|
+
messages_after_stop?: number;
|
|
204
|
+
}
|
|
205
|
+
export interface ReputationReport {
|
|
206
|
+
/**
|
|
207
|
+
* Ordered by `priority`; 1 = do first.
|
|
208
|
+
*/
|
|
209
|
+
action_items?: Array<ReputationActionItem>;
|
|
210
|
+
/**
|
|
211
|
+
* Ranked, highest impact first.
|
|
212
|
+
*/
|
|
213
|
+
drivers?: Array<ReputationDriver>;
|
|
214
|
+
/**
|
|
215
|
+
* The specific conversations behind the drivers, so partners can verify every
|
|
216
|
+
* claim against their own send logs. Each `chat_id` can be fetched via
|
|
217
|
+
* `GET /v3/chats/{chatId}` — its current health appears there.
|
|
218
|
+
*/
|
|
219
|
+
evidence?: ReputationEvidence;
|
|
220
|
+
/**
|
|
221
|
+
* The `key` of the most important driver. Empty string when the line has nothing
|
|
222
|
+
* to act on — the report then carries a single reassurance action item. Its values
|
|
223
|
+
* are the `ReputationDriverKey` vocabulary — see that schema for what each means
|
|
224
|
+
* and what to do about it.
|
|
225
|
+
*/
|
|
226
|
+
primary_driver?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Current reputation of this phone line.
|
|
229
|
+
*
|
|
230
|
+
* - `HEALTHY` — The line is in good standing. Send normally.
|
|
231
|
+
* - `AT_RISK` — Warning signs on the line: engagement is low across many of its
|
|
232
|
+
* conversations, or it's starting too many brand-new conversations in a single
|
|
233
|
+
* day — and a spike in send volume can add to either. Slow the line's send pace,
|
|
234
|
+
* avoid opening many new conversations at once, and review your messaging
|
|
235
|
+
* patterns.
|
|
236
|
+
* - `CRITICAL` — Strong signals that messages from this line aren't landing well.
|
|
237
|
+
* Pause outbound on the line until it recovers.
|
|
238
|
+
*
|
|
239
|
+
* Defaults to `HEALTHY` for lines that have not yet been scored.
|
|
240
|
+
*/
|
|
241
|
+
severity?: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
|
|
242
|
+
/**
|
|
243
|
+
* Deterministic markdown rendering of this report, suitable for feeding directly
|
|
244
|
+
* to automated systems and AI agents as investigation context. Rendered from the
|
|
245
|
+
* structured fields above, which remain the source of truth.
|
|
246
|
+
*/
|
|
247
|
+
summary_markdown?: string;
|
|
248
|
+
}
|
|
249
|
+
export interface ReputationUnhealthyChat {
|
|
250
|
+
chat_id?: string;
|
|
251
|
+
/**
|
|
252
|
+
* What is dragging this conversation down, in the same vocabulary as the report's
|
|
253
|
+
* drivers. Each key's meaning and the fix for it are documented on
|
|
254
|
+
* `ReputationDriverKey`.
|
|
255
|
+
*/
|
|
256
|
+
driver_keys?: Array<ReputationDriverKey>;
|
|
257
|
+
/**
|
|
258
|
+
* The conversation's current health — the same value `GET /v3/chats/{chatId}`
|
|
259
|
+
* reports for it.
|
|
260
|
+
*/
|
|
261
|
+
status?: 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
|
|
40
262
|
}
|
|
41
263
|
export interface PhoneNumberUpdateResponse {
|
|
42
264
|
/**
|
|
@@ -127,7 +349,13 @@ export interface PhoneNumberUpdateParams {
|
|
|
127
349
|
*/
|
|
128
350
|
forwarding_number: string | null;
|
|
129
351
|
}
|
|
352
|
+
export interface PhoneNumberGetReputationAuditParams {
|
|
353
|
+
/**
|
|
354
|
+
* The line in E.164 format.
|
|
355
|
+
*/
|
|
356
|
+
phoneNumber: string;
|
|
357
|
+
}
|
|
130
358
|
export declare namespace PhoneNumbers {
|
|
131
|
-
export { type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, };
|
|
359
|
+
export { type ReputationActionItem as ReputationActionItem, type ReputationAudit as ReputationAudit, type ReputationAuditStarted as ReputationAuditStarted, type ReputationDriver as ReputationDriver, type ReputationDriverKey as ReputationDriverKey, type ReputationEvidence as ReputationEvidence, type ReputationOptOutChat as ReputationOptOutChat, type ReputationReport as ReputationReport, type ReputationUnhealthyChat as ReputationUnhealthyChat, type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, type PhoneNumberGetReputationAuditParams as PhoneNumberGetReputationAuditParams, };
|
|
132
360
|
}
|
|
133
361
|
//# sourceMappingURL=phone-numbers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names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C,UAAU,CAAC;QAEnC;;;WAGG;QACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC;IAED,UAAiB,WAAW,CAAC;QAC3B;;;;;;;;;;WAUG;QACH,UAAiB,UAAU;YACzB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAEhB;;;;;;;;;;;;;eAaG;YACH,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;SAC5C;KACF;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mCAAmC,IAAI,mCAAmC,GAChF,CAAC;CACH"}
|
|
@@ -44,6 +44,42 @@ class PhoneNumbers extends resource_1.APIResource {
|
|
|
44
44
|
list(options) {
|
|
45
45
|
return this._client.get('/v3/phone_numbers', options);
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Returns the audit's status and, once complete, the report. Audits are scoped to
|
|
49
|
+
* the line in the URL — an `auditId` started on a different line returns `404`.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const reputationAudit =
|
|
54
|
+
* await client.phoneNumbers.getReputationAudit('auditId', {
|
|
55
|
+
* phoneNumber: 'phoneNumber',
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
getReputationAudit(auditID, params, options) {
|
|
60
|
+
const { phoneNumber } = params;
|
|
61
|
+
return this._client.get((0, path_1.path) `/v3/phone_numbers/${phoneNumber}/reputation_audit/${auditID}`, options);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Starts an asynchronous reputation audit for a line and returns an `audit_id`.
|
|
65
|
+
* Poll the GET endpoint for the result.
|
|
66
|
+
*
|
|
67
|
+
* Rate limited per line: only one audit may run at a time (a second request
|
|
68
|
+
* returns `409` while the first is still in progress), and a new audit can't be
|
|
69
|
+
* started for the same line until a cooldown elapses (`429`, with `Retry-After`
|
|
70
|
+
* carrying the wait).
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const reputationAuditStarted =
|
|
75
|
+
* await client.phoneNumbers.startReputationAudit(
|
|
76
|
+
* 'phoneNumber',
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
startReputationAudit(phoneNumber, options) {
|
|
81
|
+
return this._client.post((0, path_1.path) `/v3/phone_numbers/${phoneNumber}/reputation_audit`, options);
|
|
82
|
+
}
|
|
47
83
|
}
|
|
48
84
|
exports.PhoneNumbers = PhoneNumbers;
|
|
49
85
|
//# sourceMappingURL=phone-numbers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,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AAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,WAAW,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;CACF;AA9ED,oCA8EC"}
|
|
@@ -41,5 +41,41 @@ export class PhoneNumbers extends APIResource {
|
|
|
41
41
|
list(options) {
|
|
42
42
|
return this._client.get('/v3/phone_numbers', options);
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Returns the audit's status and, once complete, the report. Audits are scoped to
|
|
46
|
+
* the line in the URL — an `auditId` started on a different line returns `404`.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const reputationAudit =
|
|
51
|
+
* await client.phoneNumbers.getReputationAudit('auditId', {
|
|
52
|
+
* phoneNumber: 'phoneNumber',
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
getReputationAudit(auditID, params, options) {
|
|
57
|
+
const { phoneNumber } = params;
|
|
58
|
+
return this._client.get(path `/v3/phone_numbers/${phoneNumber}/reputation_audit/${auditID}`, options);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Starts an asynchronous reputation audit for a line and returns an `audit_id`.
|
|
62
|
+
* Poll the GET endpoint for the result.
|
|
63
|
+
*
|
|
64
|
+
* Rate limited per line: only one audit may run at a time (a second request
|
|
65
|
+
* returns `409` while the first is still in progress), and a new audit can't be
|
|
66
|
+
* started for the same line until a cooldown elapses (`429`, with `Retry-After`
|
|
67
|
+
* carrying the wait).
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const reputationAuditStarted =
|
|
72
|
+
* await client.phoneNumbers.startReputationAudit(
|
|
73
|
+
* 'phoneNumber',
|
|
74
|
+
* );
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
startReputationAudit(phoneNumber, options) {
|
|
78
|
+
return this._client.post(path `/v3/phone_numbers/${phoneNumber}/reputation_audit`, options);
|
|
79
|
+
}
|
|
44
80
|
}
|
|
45
81
|
//# sourceMappingURL=phone-numbers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,aAAqB,EACrB,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,aAAqB,EACrB,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAwB;QAC3B,O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