@signalhouse-sms/sdk 1.11.0 → 1.13.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.
@@ -43,6 +43,15 @@
43
43
  * @property {string} [email] - An individual's business email
44
44
  * @property {string} [mobile] - Mobile number, E.164
45
45
  */
46
+ /**
47
+ * Where one prefilled field's value came from. The agent's `autofill` holds one per field, keyed by its path
48
+ * (`consent.optInDetails`); the API marks a field `edited` once its value changes.
49
+ * @typedef {Object} RcsAgentAutofillMarker
50
+ * @property {("brand"|"campaign"|"landing")} source - The record the value came from
51
+ * @property {string|null} [sourceId] - That record's id (brand ID, campaign ID or landing page ID)
52
+ * @property {string} [at] - When the field was filled (ISO 8601; default now)
53
+ * @property {boolean} [edited] - Whether the value changed since (default false)
54
+ */
46
55
  /**
47
56
  * One recipient of an RCS send.
48
57
  * @typedef {Object} RcsRecipient
@@ -96,14 +105,15 @@ export class RcsAgents {
96
105
  * @param {RcsAgentConsent} [params.consent] - The launch text; required in full before the launch request
97
106
  * @param {RcsAgentContact} [params.contact] - The launch contact; required in full before the launch request
98
107
  * @param {("OTP"|"TRANSACTIONAL"|"PROMOTIONAL"|"MULTI_USE")} [params.useCase] - The agent's use case; required before submit
99
- * @param {("NON_CONVERSATIONAL"|"CONVERSATIONAL")} [params.billingCategory] - Default NON_CONVERSATIONAL; submit refuses CONVERSATIONAL
108
+ * @param {("NON_CONVERSATIONAL"|"CONVERSATIONAL")} [params.billingCategory] - Default NON_CONVERSATIONAL (per message); CONVERSATIONAL is billed per interactive session
100
109
  * @param {{ mode?: string, channel?: string, from?: string }|null} [params.defaultFallback] - Fallback mode (auto, rcs_only, sms_only, none), channel (auto, sms, mms) and from, a number on the linked campaign
101
110
  * @param {string[]} [params.excludedCarriers] - [] or ["T_MOBILE"] (the carrier partner's carrier name)
102
111
  * @param {string[]} [params.testers] - Tester numbers (up to 200), invited once the agent exists at the carrier
112
+ * @param {Object<string, RcsAgentAutofillMarker>} [params.autofill] - Where the fields you prefilled came from, by path (`consent.optInDetails`); the API adds its own for what it fills
103
113
  * @param {RequestOptions} [params.options] - Additional options for the request
104
114
  * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent (status DRAFT)
105
115
  */
106
- create({ brandId, campaignId, agent, consent, contact, useCase, billingCategory, defaultFallback, excludedCarriers, testers, options }: {
116
+ create({ brandId, campaignId, agent, consent, contact, useCase, billingCategory, defaultFallback, excludedCarriers, testers, autofill, options }: {
107
117
  brandId: string;
108
118
  campaignId?: string | null;
109
119
  agent?: RcsAgentProfile;
@@ -118,6 +128,9 @@ export class RcsAgents {
118
128
  } | null;
119
129
  excludedCarriers?: string[];
120
130
  testers?: string[];
131
+ autofill?: {
132
+ [x: string]: RcsAgentAutofillMarker;
133
+ };
121
134
  options?: RequestOptions;
122
135
  }): Promise<SdkResponse<any>>;
123
136
  /**
@@ -127,7 +140,7 @@ export class RcsAgents {
127
140
  * @param {Object} [params] - Filters
128
141
  * @param {string} [params.groupId] - Filter by group ID
129
142
  * @param {string} [params.subgroupId] - Filter by subgroup ID
130
- * @param {string|string[]} [params.status] - DRAFT, PENDING_REVIEW, REJECTED, AGENT_CREATING or ARCHIVED, one or a list
143
+ * @param {string|string[]} [params.status] - DRAFT, PENDING_REVIEW, REJECTED, AGENT_CREATING, ARCHIVE_PENDING or ARCHIVED, one or a list
131
144
  * @param {string} [params.brandId] - Agents linked to this brand (carrier brand ID, provisional UUID or _id)
132
145
  * @param {string} [params.campaignId] - Agents linked to this campaign (campaign ID or _id)
133
146
  * @param {number} [params.page] - Page number (default 1)
@@ -152,7 +165,7 @@ export class RcsAgents {
152
165
  * @param {Object} params - The lookup
153
166
  * @param {string} params.agentId - The agent ID (e.g. RCSA7K2M1QZ8RP)
154
167
  * @param {RequestOptions} [params.options] - Additional options for the request
155
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent
168
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent; googleAgentId is Google's id for it, null until Google has created the agent
156
169
  */
157
170
  get({ agentId, options }: {
158
171
  agentId: string;
@@ -160,9 +173,11 @@ export class RcsAgents {
160
173
  }): Promise<SdkResponse<any>>;
161
174
  /**
162
175
  * Edit an agent while it may change: a draft, a Signal House rejection, a request for changes, or an agent in
163
- * testing (the change is pushed to the carrier partner). `agent`, `consent` and `contact` merge field by field;
164
- * every other key replaces; campaignId: null unlinks the campaign. 409 in any other status; brandId is locked once
165
- * the agent exists at the partner and billingCategory once a launch was requested.
176
+ * testing (the change is pushed to the carrier partner). After a carrier rejected a launch other carriers took
177
+ * (PARTIALLY_LAUNCHED with a REJECTED carrier), only `consent` and `contact` may change, and nothing is pushed: send
178
+ * them with requestCarrierUpdate. `agent`, `consent` and `contact` merge field by field; every other key replaces;
179
+ * campaignId: null unlinks the campaign. 409 in any other status; brandId is locked once the agent exists at the
180
+ * partner and billingCategory once a launch was requested.
166
181
  * @async
167
182
  * @roles api, admin, developer, billing, user
168
183
  * @param {Object} params - The edit
@@ -177,10 +192,11 @@ export class RcsAgents {
177
192
  * @param {Object|null} [params.defaultFallback] - The fallback
178
193
  * @param {string[]} [params.excludedCarriers] - [] or ["T_MOBILE"] (the carrier partner's carrier name)
179
194
  * @param {string[]} [params.testers] - Tester numbers
195
+ * @param {Object<string, RcsAgentAutofillMarker>} [params.autofill] - Replaces the prefill markers; omitted, the stored ones are kept and a changed field's marker turns edited
180
196
  * @param {RequestOptions} [params.options] - Additional options for the request
181
197
  * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent
182
198
  */
183
- update({ agentId, brandId, campaignId, agent, consent, contact, useCase, billingCategory, defaultFallback, excludedCarriers, testers, options }: {
199
+ update({ agentId, brandId, campaignId, agent, consent, contact, useCase, billingCategory, defaultFallback, excludedCarriers, testers, autofill, options }: {
184
200
  agentId: string;
185
201
  brandId?: string;
186
202
  campaignId?: string | null;
@@ -192,12 +208,17 @@ export class RcsAgents {
192
208
  defaultFallback?: any | null;
193
209
  excludedCarriers?: string[];
194
210
  testers?: string[];
211
+ autofill?: {
212
+ [x: string]: RcsAgentAutofillMarker;
213
+ };
195
214
  options?: RequestOptions;
196
215
  }): Promise<SdkResponse<any>>;
197
216
  /**
198
217
  * Check an agent against the next gate on its path without writing: before it exists at the carrier partner, what
199
- * creating it needs (the full profile, useCase, NON_CONVERSATIONAL billing); after that, what the launch request needs
218
+ * creating it needs (the full profile, useCase, a billingCategory); after that, what the launch request needs
200
219
  * (a VERIFIED brand, the campaign, the full consent with the video, the contact)
220
+ * The launch gate also runs the carriers' copy rules; each error carries the carrier partner's key as `code`, for
221
+ * example OPT_IN_MSG_RATE_DISCL_MISSING.
201
222
  * @async
202
223
  * @roles api, admin, developer, billing, user
203
224
  * @param {Object} params - The lookup
@@ -211,8 +232,10 @@ export class RcsAgents {
211
232
  }): Promise<SdkResponse<any>>;
212
233
  /**
213
234
  * Submit a draft: create the agent at the carrier partner, with no review first. It needs the full profile, a
214
- * useCase and NON_CONVERSATIONAL billing; otherwise a 400 whose details carry { code: "REGISTRATION_INCOMPLETE",
235
+ * useCase and a billingCategory; otherwise a 400 whose details carry { code: "REGISTRATION_INCOMPLETE",
215
236
  * errors, warnings }. The agent moves to AGENT_CREATING, then IN_TESTING once the partner reports it ready.
237
+ * A group that has not finished account verification gets a 403 with code GROUP_UNVERIFIED, and a rejected one a 403
238
+ * with code GROUP_REJECTED; a pending verification passes.
216
239
  * @async
217
240
  * @roles api, admin, developer, billing, user
218
241
  * @param {Object} params - The submission
@@ -228,32 +251,74 @@ export class RcsAgents {
228
251
  * Request the agent's launch: the launch requirements are checked and the agent goes to Signal House review (status
229
252
  * PENDING_REVIEW), whose approval files the launch with the carrier partner. Allowed from IN_TESTING, REJECTED and
230
253
  * CARRIER_REJECTED (409 otherwise); a failed requirement is a 400 whose details carry { code:
231
- * "REGISTRATION_INCOMPLETE", errors, warnings }. Sends POST /registration/:agentId/launch: the agent is a registration.
232
- * The request charges the agent's launch fees: a wallet that cannot cover them gets a 402, and the agent stays where it is. The agent's launchFees quotes what the next request charges.
254
+ * "REGISTRATION_INCOMPLETE", errors, warnings }, and a copy-rule error carries the carrier partner's key as its `code`
255
+ * (for example OPT_IN_MSG_RATE_DISCL_MISSING). A group that has not finished account verification gets a 403 with code
256
+ * GROUP_UNVERIFIED, and a rejected one a 403 with code GROUP_REJECTED. Sends POST /registration/:agentId/launch: the agent is a registration.
257
+ * The request charges the agent's launch fees: a wallet that cannot cover them gets a 402, and the agent stays where it is. When any fee is due the request must set acknowledgeFees: true, or it gets a 400 with code FEE_ACKNOWLEDGEMENT_REQUIRED and nothing is held; a launch with nothing due needs no acknowledgement. The agent's launchFees quotes what the next request charges.
258
+ * When the agent's brand vertical is healthcare or insurance, the launch needs the protected health information (PHI) disclosure acknowledged: send acknowledgePhi: true, or the request gets a 400 REGISTRATION_INCOMPLETE whose errors name consent.phiAcknowledgement. The API records the acknowledgement as consent.phiAcknowledgement { acknowledgedAt, acknowledgedBy } from the caller; the client sends only the boolean, and an agent update cannot set it. Once recorded, a later launch request needs no new acknowledgement.
233
259
  * @async
234
260
  * @roles api, admin, developer, billing, user
235
261
  * @param {Object} params - The launch request
236
262
  * @param {string} params.agentId - The agent ID
263
+ * @param {boolean} [params.acknowledgeFees] - Accept the fees due; required when any are
264
+ * @param {boolean} [params.acknowledgePhi] - Accept the PHI disclosure; required for a healthcare or insurance brand
237
265
  * @param {RequestOptions} [params.options] - Additional options for the request
238
266
  * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent (status PENDING_REVIEW)
239
267
  */
240
- launch({ agentId, options }: {
268
+ launch({ agentId, acknowledgeFees, acknowledgePhi, options }: {
269
+ agentId: string;
270
+ acknowledgeFees?: boolean;
271
+ acknowledgePhi?: boolean;
272
+ options?: RequestOptions;
273
+ }): Promise<SdkResponse<any>>;
274
+ /**
275
+ * Send Signal House the corrected launch answers after a carrier rejected a launch other carriers took. The carrier
276
+ * partner takes no change through its API once a carrier launched, so Signal House emails it the update; edit
277
+ * `consent` and `contact` first. The agent's carrierUpdate reads REQUESTED for the rejected carriers, then SENT once
278
+ * Signal House sent it. 409 when no carrier is REJECTED after a partial launch, or an update already waits.
279
+ * Sends POST /registration/:agentId/carrier-update: the agent is a registration.
280
+ * @async
281
+ * @roles api, admin, developer, billing, user
282
+ * @param {Object} params - The request
283
+ * @param {string} params.agentId - The agent ID
284
+ * @param {RequestOptions} [params.options] - Additional options for the request
285
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent's registration, with data.carrierUpdate
286
+ */
287
+ requestCarrierUpdate({ agentId, options }: {
241
288
  agentId: string;
242
289
  options?: RequestOptions;
243
290
  }): Promise<SdkResponse<any>>;
244
291
  /**
245
- * Archive an agent
292
+ * Archive an agent. One the carrier partner created stops sending at once and stays ARCHIVE_PENDING until Signal House confirms the partner cancelled it, then ARCHIVED. Archiving cannot be undone; an agent already ARCHIVE_PENDING answers 409.
246
293
  * @async
247
294
  * @roles api, admin, developer, user
248
295
  * @param {Object} params - The archive request
249
296
  * @param {string} params.agentId - The agent ID
250
297
  * @param {RequestOptions} [params.options] - Additional options for the request
251
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent (status ARCHIVED)
298
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent (status ARCHIVE_PENDING or ARCHIVED)
252
299
  */
253
300
  archive({ agentId, options }: {
254
301
  agentId: string;
255
302
  options?: RequestOptions;
256
303
  }): Promise<SdkResponse<any>>;
304
+ /**
305
+ * Make the links that start a chat with the agent: an sms: deep link in Google's format, and a short link that redirects to it,
306
+ * to print as a QR code. With the agent's defaultFallback.from, the deep link names that number, so a handset that cannot reach
307
+ * the agent texts it instead. The same request returns the same short link. The links work for approved testers until a carrier
308
+ * launches the agent; before Google has created the agent the request answers 409 with code GOOGLE_AGENT_PENDING.
309
+ * @async
310
+ * @roles api, admin, developer, billing, user
311
+ * @param {Object} params - The request
312
+ * @param {string} params.agentId - The agent ID
313
+ * @param {string} [params.body] - The message the chat opens with, prefilled on the handset (max 1,000 characters)
314
+ * @param {RequestOptions} [params.options] - Additional options for the request
315
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { googleAgentId, deepLink, shortLink }
316
+ */
317
+ createEntryPoints({ agentId, body, options }: {
318
+ agentId: string;
319
+ body?: string;
320
+ options?: RequestOptions;
321
+ }): Promise<SdkResponse<any>>;
257
322
  /**
258
323
  * Resend a tester's expired invitation, which starts a new 24 hours for the tester to accept it. The number must be
259
324
  * a tester on the agent (404) and its invitation must be EXPIRED (409); up to 20 invitations go out a day (429).
@@ -270,6 +335,22 @@ export class RcsAgents {
270
335
  phoneNumber: string;
271
336
  options?: RequestOptions;
272
337
  }): Promise<SdkResponse<any>>;
338
+ /**
339
+ * Remove a tester at once, at any point before the agent is archived. The number must be a tester on the agent (404);
340
+ * an archived agent answers 409.
341
+ * @async
342
+ * @roles api, admin, developer, billing, user
343
+ * @param {Object} params - The removal
344
+ * @param {string} params.agentId - The agent ID
345
+ * @param {string} params.phoneNumber - The tester's US number, with or without the +
346
+ * @param {RequestOptions} [params.options] - Additional options for the request
347
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent
348
+ */
349
+ removeTester({ agentId, phoneNumber, options }: {
350
+ agentId: string;
351
+ phoneNumber: string;
352
+ options?: RequestOptions;
353
+ }): Promise<SdkResponse<any>>;
273
354
  /**
274
355
  * Host the agent's logo (224 × 224 px, 50 KB max) or hero image (1440 × 448 px, 200 KB max), PNG or JPEG, and set
275
356
  * it on the draft. Images of any other size are refused.
@@ -324,7 +405,7 @@ export class RcsMessages {
324
405
  * @param {boolean} [params.isTest] - Send as a test; approved testers only
325
406
  * @param {("not_capable"|"ttl_expired"|"delivered"|"read")} [params.simulate] - Simulate this outcome; approved testers only
326
407
  * @param {RequestOptions} [params.options] - Additional options for the request
327
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to { requested, enqueued, failed, bulkId, messages } (201). A blocked row carries blockReason, reason and issues; an archived template answers 409 TEMPLATE_ARCHIVED
408
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { requested, enqueued, failed, bulkId, messages } (201). A blocked row carries blockReason, reason and issues; an archived template answers 409 TEMPLATE_ARCHIVED. A recipient from 19999990000 to 19999990359 makes the whole request a simulation, as on SMS: it resolves to { simulated: true, webhooks } and nothing is stored, sent or charged
328
409
  */
329
410
  send({ agentId, recipients, templateId, templateVersion, content, contentFormat, trafficType, ttlSeconds, expireTime, fallback, statusCallbackUrl, enableShortlink, isTest, simulate, options }: {
330
411
  agentId: string;
@@ -343,6 +424,50 @@ export class RcsMessages {
343
424
  simulate?: ("not_capable" | "ttl_expired" | "delivered" | "read");
344
425
  options?: RequestOptions;
345
426
  }): Promise<SdkResponse<any>>;
427
+ /**
428
+ * Send an RCS message to up to 10,000 recipients in the background. The request runs the send's request checks, splits the
429
+ * recipients into chunks of 100, queues each chunk and answers 202. Every message carries the shared bulkId; track progress with
430
+ * the messages list filtered by bulkId (GET /message?bulkId=) and per-message webhooks. A chunk the wallet cannot cover, or that is
431
+ * refused after acceptance, gets BLOCKED messages with blockReason INSUFFICIENT_FUNDS or SEND_REFUSED; a chunk that keeps failing
432
+ * gets SEND_FAILED. Pass options.idempotencyKey to make a retry safe (same bulkId, no duplicate sends); a retry without one may
433
+ * send duplicates.
434
+ * @async
435
+ * @roles api, admin, developer, billing, user
436
+ * @param {Object} params - The send; the same fields as send
437
+ * @param {string} params.agentId - The agent that sends (RCSA…)
438
+ * @param {RcsRecipient[]} params.recipients - Up to 10,000 recipients
439
+ * @param {string} [params.templateId] - A template to send; exactly one of templateId or content
440
+ * @param {number} [params.templateVersion] - A published version of templateId; needs templateId. Pinned when the batch is accepted
441
+ * @param {Object} [params.content] - Inline content; exactly one of templateId or content
442
+ * @param {string} [params.contentFormat] - content.v1 (default) or google.rcs
443
+ * @param {("AUTHENTICATION"|"TRANSACTION"|"SERVICEREQUEST"|"ACKNOWLEDGEMENT"|"PROMOTION")} [params.trafficType] - Required on a MULTI_USE agent when the template sets none
444
+ * @param {number} [params.ttlSeconds] - Seconds each RCS message may wait for delivery, from when its chunk is sent; at most one of ttlSeconds or expireTime
445
+ * @param {string} [params.expireTime] - ISO-8601 time the RCS messages expire
446
+ * @param {RcsMessageFallback} [params.fallback] - The fallback for this send
447
+ * @param {string} [params.statusCallbackUrl] - URL that receives each message's events
448
+ * @param {boolean} [params.enableShortlink] - Shorten the links in the message
449
+ * @param {boolean} [params.isTest] - Send as a test; approved testers only
450
+ * @param {("not_capable"|"ttl_expired"|"delivered"|"read")} [params.simulate] - Simulate this outcome; approved testers only
451
+ * @param {RequestOptions} [params.options] - Additional options for the request
452
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { bulkId, status: "ACCEPTED", recipientCount } (202). Every message of the batch carries bulkId. A recipient from 19999990000 to 19999990359 makes the whole request a simulation, as on send
453
+ */
454
+ sendBatch({ agentId, recipients, templateId, templateVersion, content, contentFormat, trafficType, ttlSeconds, expireTime, fallback, statusCallbackUrl, enableShortlink, isTest, simulate, options }: {
455
+ agentId: string;
456
+ recipients: RcsRecipient[];
457
+ templateId?: string;
458
+ templateVersion?: number;
459
+ content?: any;
460
+ contentFormat?: string;
461
+ trafficType?: ("AUTHENTICATION" | "TRANSACTION" | "SERVICEREQUEST" | "ACKNOWLEDGEMENT" | "PROMOTION");
462
+ ttlSeconds?: number;
463
+ expireTime?: string;
464
+ fallback?: RcsMessageFallback;
465
+ statusCallbackUrl?: string;
466
+ enableShortlink?: boolean;
467
+ isTest?: boolean;
468
+ simulate?: ("not_capable" | "ttl_expired" | "delivered" | "read");
469
+ options?: RequestOptions;
470
+ }): Promise<SdkResponse<any>>;
346
471
  /**
347
472
  * Check a send without writing anything. Takes the same parameters as send.
348
473
  * @async
@@ -399,7 +524,7 @@ export class RcsMessages {
399
524
  * @param {string} [params.expireTime] - ISO-8601 time the RCS message expires
400
525
  * @param {RcsMessageFallback} [params.fallback] - The fallback to price; its from is optional here, and with none the leg is priced on the channel of the agent's linked campaign
401
526
  * @param {RequestOptions} [params.options] - Additional options for the request
402
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to { billingClass, segments, recipientCount, rcsLeg, fallbackLeg, totals, balance, issues, warnings }; rcsLeg.mediaSurcharge is the carrier's surcharge on media over 5 MB, already inside rcsLeg.cost; a message over 100 MB adds a MEDIA_TOO_LARGE issue.
527
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { billingClass, segments, recipientCount, rcsLeg, fallbackLeg, totals, balance, issues, warnings }; rcsLeg.mediaSurcharge is the carrier's surcharge on media over 5 MB for one recipient, and rcsLeg.cost already holds it for every recipient; rcsLeg.cost is null with the fallback mode sms_only; a message over 100 MB adds a MEDIA_TOO_LARGE issue.
403
528
  */
404
529
  estimate({ agentId, recipients, recipientCount, templateId, templateVersion, content, contentFormat, trafficType, ttlSeconds, expireTime, fallback, options }: {
405
530
  agentId: string;
@@ -423,13 +548,44 @@ export class RcsMessages {
423
548
  * @param {string} params.agentId - The agent (RCSA…)
424
549
  * @param {string[]} params.phoneNumbers - Up to 500 numbers, 10-15 digits, with or without the +
425
550
  * @param {RequestOptions} [params.options] - Additional options for the request
426
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to { results: [{ phoneNumber, capability }] }, capability being ENABLED, UNREACHABLE or UNKNOWN
551
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { results: [{ phoneNumber, capability, rcsEnabled, reason, features, carrier, checkedAt, cached }] }, capability being ENABLED, UNREACHABLE or UNKNOWN, and reason CAPABLE, NOT_CAPABLE, NOT_LAUNCHED_ON_CARRIER or UNKNOWN; rcsEnabled is true only for CAPABLE, carrier and checkedAt may be null, and features is empty today
427
552
  */
428
553
  capabilities({ agentId, phoneNumbers, options }: {
429
554
  agentId: string;
430
555
  phoneNumbers: string[];
431
556
  options?: RequestOptions;
432
557
  }): Promise<SdkResponse<any>>;
558
+ /**
559
+ * Fake an inbound event from an approved tester of the agent, with no carrier involved: it runs the real inbound handlers and webhooks, as free test traffic. A simulated STOP really opts the tester out; a simulated START clears it. Anyone else gets a 403 with code NOT_TESTER. Returns 202 with { status, messageId }.
560
+ * @async
561
+ * @roles api, admin, developer, billing, user
562
+ * @param {Object} params - The event
563
+ * @param {string} params.agentId - The agent (RCSA…)
564
+ * @param {string} params.from - The approved tester's number
565
+ * @param {string} params.type - TEXT, SUGGESTION, LOCATION, FILE or UNSUBSCRIBE
566
+ * @param {string} [params.text] - The text; required for TEXT
567
+ * @param {string} [params.postbackData] - The tapped suggestion's postback; SUGGESTION needs this or buttonId
568
+ * @param {string} [params.messageId] - The message a tap answers; the latest message delivered to the tester by default
569
+ * @param {string} [params.buttonId] - The suggestion's position, as webhooks report it
570
+ * @param {number} [params.latitude] - Required for LOCATION
571
+ * @param {number} [params.longitude] - Required for LOCATION
572
+ * @param {string} [params.fileName] - The file's name, for FILE
573
+ * @param {RequestOptions} [params.options] - Additional options for the request
574
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { status: "QUEUED", messageId }
575
+ */
576
+ simulateInbound({ agentId, from, type, text, postbackData, messageId, buttonId, latitude, longitude, fileName, options }: {
577
+ agentId: string;
578
+ from: string;
579
+ type: string;
580
+ text?: string;
581
+ postbackData?: string;
582
+ messageId?: string;
583
+ buttonId?: string;
584
+ latitude?: number;
585
+ longitude?: number;
586
+ fileName?: string;
587
+ options?: RequestOptions;
588
+ }): Promise<SdkResponse<any>>;
433
589
  /**
434
590
  * Get one message by its ID. The same route as messages.getMessage.
435
591
  * @async
@@ -437,7 +593,7 @@ export class RcsMessages {
437
593
  * @param {Object} params - The lookup
438
594
  * @param {string} params.messageId - The message ID
439
595
  * @param {RequestOptions} [params.options] - Additional options for the request
440
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to the message; an unknown ID is a 404
596
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the message; an unknown ID is a 404. A settled RCS message carries carrierFeeMicros, the carrier pass-through and media surcharge it was charged
441
597
  */
442
598
  get({ messageId, options }: {
443
599
  messageId: string;
@@ -464,7 +620,7 @@ export class RcsMessages {
464
620
  * @param {string} [params.deliveredChannel] - Filter by the channel that delivered the message (rcs, sms, mms)
465
621
  * @param {boolean} [params.isTest] - true for test messages only, false to leave them out
466
622
  * @param {RequestOptions} [params.options] - Additional options for the request
467
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to the list of messages
623
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the list of messages; a settled RCS message carries carrierFeeMicros
468
624
  */
469
625
  list({ groupId, from, to, agentId, status, page, limit, templateId, templateVersion, bulkId, fallbackReason, billingClass, deliveredChannel, isTest, options }: {
470
626
  groupId: string;
@@ -619,6 +775,28 @@ export type RcsAgentContact = {
619
775
  */
620
776
  mobile?: string;
621
777
  };
778
+ /**
779
+ * Where one prefilled field's value came from. The agent's `autofill` holds one per field, keyed by its path
780
+ * (`consent.optInDetails`); the API marks a field `edited` once its value changes.
781
+ */
782
+ export type RcsAgentAutofillMarker = {
783
+ /**
784
+ * - The record the value came from
785
+ */
786
+ source: ("brand" | "campaign" | "landing");
787
+ /**
788
+ * - That record's id (brand ID, campaign ID or landing page ID)
789
+ */
790
+ sourceId?: string | null;
791
+ /**
792
+ * - When the field was filled (ISO 8601; default now)
793
+ */
794
+ at?: string;
795
+ /**
796
+ * - Whether the value changed since (default false)
797
+ */
798
+ edited?: boolean;
799
+ };
622
800
  /**
623
801
  * One recipient of an RCS send.
624
802
  */
@@ -21,14 +21,23 @@ export class Registrations {
21
21
  * @param {Object} params - The parameters for the review decision
22
22
  * @param {string} params.registrationId - The registration ID (e.g. GB8T9GTD5AZY)
23
23
  * @param {("APPROVE"|"REJECT")} params.action - The review decision
24
- * @param {string} [params.reason] - Why the registration was rejected; required when action is REJECT
24
+ * @param {string} [params.reason] - Why the registration was rejected; required when action is REJECT. An RCS agent takes 10 to 256 characters
25
+ * @param {string} [params.reasonCode] - The rejection catalogue code; required to reject an RCS agent, refused for any other type
26
+ * @param {Array<{ field?: string|null, code: string, reason: string, recommendedAction?: string|null }>} [params.rejectionReasons] - Field-level reasons for an RCS agent
25
27
  * @param {RequestOptions} [params.options] - Additional options for the request
26
28
  * @returns {Promise<SdkResponse<any>>} A promise that resolves to the updated registration
27
29
  */
28
- reviewRegistration: ({ registrationId, action, reason, options }: {
30
+ reviewRegistration: ({ registrationId, action, reason, reasonCode, rejectionReasons, options }: {
29
31
  registrationId: string;
30
32
  action: ("APPROVE" | "REJECT");
31
33
  reason?: string;
34
+ reasonCode?: string;
35
+ rejectionReasons?: Array<{
36
+ field?: string | null;
37
+ code: string;
38
+ reason: string;
39
+ recommendedAction?: string | null;
40
+ }>;
32
41
  options?: RequestOptions;
33
42
  }) => Promise<SdkResponse<any>>;
34
43
  /**
@@ -92,6 +101,75 @@ export class Registrations {
92
101
  registrationId: string;
93
102
  options?: RequestOptions;
94
103
  }) => Promise<SdkResponse<ArrayBuffer>>;
104
+ /**
105
+ * Give an RCS agent an assignee in the staff review queue, or clear it (signalhouse only)
106
+ * @async
107
+ * @roles signalhouse
108
+ * @param {Object} params - The parameters for the assignment
109
+ * @param {string} params.registrationId - The agent's registration ID (e.g. RCSA7K2M1QZ8RP)
110
+ * @param {string|null} params.userId - An active Signal House staff user; null clears the assignee
111
+ * @param {RequestOptions} [params.options] - Additional options for the request
112
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the registration, as staff read it
113
+ */
114
+ assignRegistration: ({ registrationId, userId, options }: {
115
+ registrationId: string;
116
+ userId: string | null;
117
+ options?: RequestOptions;
118
+ }) => Promise<SdkResponse<any>>;
119
+ /**
120
+ * Nudge the owner of an RCS agent waiting in an SLA state, at most once per business day (signalhouse only)
121
+ * @async
122
+ * @roles signalhouse
123
+ * @param {Object} params - The parameters for the nudge
124
+ * @param {string} params.registrationId - The agent's registration ID (e.g. RCSA7K2M1QZ8RP)
125
+ * @param {RequestOptions} [params.options] - Additional options for the request
126
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the registration, as staff read it
127
+ */
128
+ nudgeRegistration: ({ registrationId, options }: {
129
+ registrationId: string;
130
+ options?: RequestOptions;
131
+ }) => Promise<SdkResponse<any>>;
132
+ /**
133
+ * Mark an RCS agent's requested carrier update as sent, once staff emailed it to the carrier partner (signalhouse only)
134
+ * @async
135
+ * @roles signalhouse
136
+ * @param {Object} params - The parameters for the update
137
+ * @param {string} params.registrationId - The agent's registration ID (e.g. RCSA7K2M1QZ8RP)
138
+ * @param {RequestOptions} [params.options] - Additional options for the request
139
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the registration, as staff read it; 409 when no update is REQUESTED
140
+ */
141
+ markCarrierUpdateSent: ({ registrationId, options }: {
142
+ registrationId: string;
143
+ options?: RequestOptions;
144
+ }) => Promise<SdkResponse<any>>;
145
+ /**
146
+ * Add an internal comment to a registration of any type; comments are append-only and never reach the customer (signalhouse only)
147
+ * @async
148
+ * @roles signalhouse
149
+ * @param {Object} params - The parameters for the comment
150
+ * @param {string} params.registrationId - The registration ID (e.g. RCSA7K2M1QZ8RP)
151
+ * @param {string} params.comment - The comment, 1 to 2,000 characters
152
+ * @param {RequestOptions} [params.options] - Additional options for the request
153
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { comment, createdAt, createdBy, createdByRole }
154
+ */
155
+ addComment: ({ registrationId, comment, options }: {
156
+ registrationId: string;
157
+ comment: string;
158
+ options?: RequestOptions;
159
+ }) => Promise<SdkResponse<any>>;
160
+ /**
161
+ * List a registration's internal comments, newest first (signalhouse only)
162
+ * @async
163
+ * @roles signalhouse
164
+ * @param {Object} params - The parameters for the read
165
+ * @param {string} params.registrationId - The registration ID (e.g. RCSA7K2M1QZ8RP)
166
+ * @param {RequestOptions} [params.options] - Additional options for the request
167
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { comments: [{ comment, createdAt, createdBy, createdByRole }] }
168
+ */
169
+ getComments: ({ registrationId, options }: {
170
+ registrationId: string;
171
+ options?: RequestOptions;
172
+ }) => Promise<SdkResponse<any>>;
95
173
  };
96
174
  /**
97
175
  * Get the registration types a region offers and whether each can be acquired right now
@@ -214,7 +292,8 @@ export class Registrations {
214
292
  * Submit a draft. A type Signal House reviews goes to SIGNAL_HOUSE_REVIEW; a type it does not (RCS_AGENT) goes to
215
293
  * SUBMITTING and is filed with the provider at once. A draft that fails a requirement gets a 400 whose details carry
216
294
  * { code: "REGISTRATION_INCOMPLETE", errors, warnings }; a second submit, or one of a registration the provider
217
- * already holds, gets a 409.
295
+ * already holds, gets a 409. An RCS agent whose group has not finished account verification gets a 403 with code
296
+ * GROUP_UNVERIFIED, and one whose group is rejected a 403 with code GROUP_REJECTED.
218
297
  * @async
219
298
  * @roles api, admin, developer, billing, user
220
299
  * @param {Object} params - The parameters for the submission
@@ -231,17 +310,24 @@ export class Registrations {
231
310
  * are checked and the registration goes to SIGNAL_HOUSE_REVIEW, whose approval files the provider's launch request.
232
311
  * Allowed while the provider reports the agent ready for testing, after a Signal House rejection, or after every
233
312
  * carrier refused an earlier launch (409 otherwise); a failed requirement is a 400 whose details carry
234
- * { code: "REGISTRATION_INCOMPLETE", errors, warnings }.
235
- * An RCS agent's launch request charges its launch fees: a wallet that cannot cover them gets a 402, and nothing changes.
313
+ * { code: "REGISTRATION_INCOMPLETE", errors, warnings }; an RCS agent's copy-rule error carries the carrier partner's key
314
+ * as its `code` (for example OPT_IN_MSG_RATE_DISCL_MISSING). An RCS agent whose group has not finished account
315
+ * verification gets a 403 with code GROUP_UNVERIFIED, and one whose group is rejected a 403 with code GROUP_REJECTED.
316
+ * An RCS agent's launch request charges its launch fees: a wallet that cannot cover them gets a 402, and nothing changes. When any fee is due the request must set acknowledgeFees: true, or it gets a 400 with code FEE_ACKNOWLEDGEMENT_REQUIRED and nothing is held; a launch with nothing due needs no acknowledgement.
317
+ * When the agent's brand vertical is healthcare or insurance, the launch needs the protected health information (PHI) disclosure acknowledged: send acknowledgePhi: true, or the request gets a 400 REGISTRATION_INCOMPLETE whose errors name consent.phiAcknowledgement. The API records the acknowledgement as consent.phiAcknowledgement { acknowledgedAt, acknowledgedBy } from the caller; the client sends only the boolean, and an agent update cannot set it. Once recorded, a later launch request needs no new acknowledgement.
236
318
  * @async
237
319
  * @roles api, admin, developer, billing, user
238
320
  * @param {Object} params - The parameters for the launch request
239
321
  * @param {string} params.registrationId - The registration ID (e.g. RCSA7K2M1QZ8RP)
322
+ * @param {boolean} [params.acknowledgeFees] - Accept the fees due; required when any are
323
+ * @param {boolean} [params.acknowledgePhi] - Accept the PHI disclosure; required for a healthcare or insurance brand
240
324
  * @param {RequestOptions} [params.options] - Additional options for the request
241
325
  * @returns {Promise<SdkResponse<any>>} A promise that resolves to the registration, now SIGNAL_HOUSE_REVIEW
242
326
  */
243
- launchRegistration({ registrationId, options }: {
327
+ launchRegistration({ registrationId, acknowledgeFees, acknowledgePhi, options }: {
244
328
  registrationId: string;
329
+ acknowledgeFees?: boolean;
330
+ acknowledgePhi?: boolean;
245
331
  options?: RequestOptions;
246
332
  }): Promise<SdkResponse<any>>;
247
333
  /**
@@ -138,6 +138,7 @@ export class Templates {
138
138
  }): Promise<SdkResponse<SavedTemplate>>;
139
139
  /**
140
140
  * Publish a template's current draft; no draft returns 409 NO_DRAFT, a draft changed mid-publish returns 409 DRAFT_CHANGED (publish again) and an incomplete draft returns 400 TEMPLATE_INVALID
141
+ * A block whose text or image the Moderation API flags is an error with code CONTENT_POLICY_FLAGGED, whose message names the category ("Content moderation flagged this text: spam"). The check passes when the Moderation API fails.
141
142
  * @async
142
143
  * @roles api, admin, developer
143
144
  * @param {Object} params - The parameters for publishing a template
@@ -189,6 +190,7 @@ export class Templates {
189
190
  }): Promise<SdkResponse<Page<VersionSummary>>>;
190
191
  /**
191
192
  * Validate an unsaved body or a stored version without writing anything
193
+ * Validate runs the publish checks, the content policy check included: a block whose text or image the Moderation API flags is an error with code CONTENT_POLICY_FLAGGED. Saving a draft does not run that check.
192
194
  * @async
193
195
  * @roles api, admin, developer, billing, user
194
196
  * @param {Object} params - The parameters for validation; pass exactly one of body or version
@@ -0,0 +1,71 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+ /**
7
+ * Carrier phone-number checks under /verify: SIM Swap and Number Verify. Every check the carrier answers is billed to
8
+ * the group's wallet (402 on insufficient funds); a check the carrier cannot run for the number is a 422 and is not charged.
9
+ */
10
+ export class Verify {
11
+ /**
12
+ * Keep the JSON client every verify request goes through.
13
+ * @param {any} client - The JSON request client
14
+ * @param {boolean} [enableAdmin] - Whether admin-scoped behaviors are enabled
15
+ */
16
+ constructor(client: any, enableAdmin?: boolean);
17
+ client: any;
18
+ enableAdmin: boolean;
19
+ /**
20
+ * Check whether a number's SIM card changed recently, as reported by its carrier. Billed once when the check answers;
21
+ * 422 when the check is not available for the number (not charged)
22
+ * @async
23
+ * @roles api, admin, developer
24
+ * @param {Object} params - The check
25
+ * @param {string} params.phoneNumber - The number to check, in international format (e.g. "+12025550123")
26
+ * @param {number} [params.maxAge] - Lookback window in hours, 1-2400; the carrier's default when omitted
27
+ * @param {boolean} [params.includeSwapDate] - Also return the latest SIM change date (no extra charge; default false)
28
+ * @param {RequestOptions} [params.options] - Additional options for the request
29
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ checkId, phoneNumber, swapped, maxAge, latestSimChange?, cost }`
30
+ */
31
+ checkSimSwap({ phoneNumber, maxAge, includeSwapDate, options }: {
32
+ phoneNumber: string;
33
+ maxAge?: number;
34
+ includeSwapDate?: boolean;
35
+ options?: RequestOptions;
36
+ }): Promise<SdkResponse<any>>;
37
+ /**
38
+ * Start a Number Verify check. The end user's phone must open the returned `authorizationUrl` on mobile data (Wi-Fi off)
39
+ * within 10 minutes; the carrier then confirms whether the phone's own number matches. Read the result with
40
+ * getNumberVerification. Billed only when the check is answered (VERIFIED or NOT_VERIFIED)
41
+ * @async
42
+ * @roles api, admin, developer
43
+ * @param {Object} params - The check
44
+ * @param {string} params.phoneNumber - The number to verify, in international format (e.g. "+12025550123")
45
+ * @param {string} [params.devicePhoneNumber] - The phone's own number, sent to the carrier as a login hint
46
+ * @param {string} [params.redirectUrl] - An https URL the end user's browser is sent to after the check, with `?checkId=…`
47
+ * @param {RequestOptions} [params.options] - Additional options for the request
48
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ checkId, phoneNumber, status: "PENDING", authorizationUrl, expiresAt }`
49
+ */
50
+ startNumberVerification({ phoneNumber, devicePhoneNumber, redirectUrl, options }: {
51
+ phoneNumber: string;
52
+ devicePhoneNumber?: string;
53
+ redirectUrl?: string;
54
+ options?: RequestOptions;
55
+ }): Promise<SdkResponse<any>>;
56
+ /**
57
+ * Get a Number Verify check's status and result. A PENDING check past its expiresAt reads as EXPIRED
58
+ * @async
59
+ * @roles api, admin, developer, billing, user
60
+ * @param {Object} params - The lookup
61
+ * @param {string} params.checkId - The check ID (e.g. NVC…)
62
+ * @param {RequestOptions} [params.options] - Additional options for the request
63
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ checkId, phoneNumber, status, devicePhoneNumberVerified, failureReason, createdAt, expiresAt, completedAt, cost }`
64
+ */
65
+ getNumberVerification({ checkId, options }: {
66
+ checkId: string;
67
+ options?: RequestOptions;
68
+ }): Promise<SdkResponse<any>>;
69
+ }
70
+ export type RequestOptions = import("../SignalHouseSDK.js").RequestOptions;
71
+ export type SdkResponse<T> = import("../SignalHouseSDK.js").SdkResponse<T>;