@sentdm/sentdm 0.34.0 → 0.35.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 +8 -0
- package/client.d.mts +53 -22
- package/client.d.mts.map +1 -1
- package/client.d.ts +53 -22
- package/client.d.ts.map +1 -1
- package/client.js +39 -8
- package/client.js.map +1 -1
- package/client.mjs +39 -8
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/contacts.d.mts +606 -89
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +606 -89
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +21 -15
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +21 -15
- package/resources/contacts.mjs.map +1 -1
- package/resources/conversations.d.mts +335 -69
- package/resources/conversations.d.mts.map +1 -1
- package/resources/conversations.d.ts +335 -69
- package/resources/conversations.d.ts.map +1 -1
- package/resources/conversations.js +15 -10
- package/resources/conversations.js.map +1 -1
- package/resources/conversations.mjs +15 -10
- package/resources/conversations.mjs.map +1 -1
- package/resources/index.d.mts +7 -7
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -7
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/me.d.mts +132 -41
- package/resources/me.d.mts.map +1 -1
- package/resources/me.d.ts +132 -41
- package/resources/me.d.ts.map +1 -1
- package/resources/me.js +3 -1
- package/resources/me.js.map +1 -1
- package/resources/me.mjs +3 -1
- package/resources/me.mjs.map +1 -1
- package/resources/messages.d.mts +206 -27
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +206 -27
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +5 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +5 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/numbers.d.mts +45 -4
- package/resources/numbers.d.mts.map +1 -1
- package/resources/numbers.d.ts +45 -4
- package/resources/numbers.d.ts.map +1 -1
- package/resources/numbers.js +3 -1
- package/resources/numbers.js.map +1 -1
- package/resources/numbers.mjs +3 -1
- package/resources/numbers.mjs.map +1 -1
- package/resources/profiles/campaigns.d.mts +579 -209
- package/resources/profiles/campaigns.d.mts.map +1 -1
- package/resources/profiles/campaigns.d.ts +579 -209
- package/resources/profiles/campaigns.d.ts.map +1 -1
- package/resources/profiles/campaigns.js +33 -64
- package/resources/profiles/campaigns.js.map +1 -1
- package/resources/profiles/campaigns.mjs +33 -64
- package/resources/profiles/campaigns.mjs.map +1 -1
- package/resources/profiles/index.d.mts +2 -2
- package/resources/profiles/index.d.mts.map +1 -1
- package/resources/profiles/index.d.ts +2 -2
- package/resources/profiles/index.d.ts.map +1 -1
- package/resources/profiles/index.js.map +1 -1
- package/resources/profiles/index.mjs.map +1 -1
- package/resources/profiles/profiles.d.mts +2006 -508
- package/resources/profiles/profiles.d.mts.map +1 -1
- package/resources/profiles/profiles.d.ts +2006 -508
- package/resources/profiles/profiles.d.ts.map +1 -1
- package/resources/profiles/profiles.js +98 -75
- package/resources/profiles/profiles.js.map +1 -1
- package/resources/profiles/profiles.mjs +98 -75
- package/resources/profiles/profiles.mjs.map +1 -1
- package/resources/templates.d.mts +497 -84
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +497 -84
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +6 -4
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +6 -4
- package/resources/templates.mjs.map +1 -1
- package/resources/users.d.mts +444 -43
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +444 -43
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +6 -4
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +6 -4
- package/resources/users.mjs.map +1 -1
- package/resources/webhooks.d.mts +770 -169
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +770 -169
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +11 -8
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +11 -8
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +78 -60
- package/src/resources/contacts.ts +696 -92
- package/src/resources/conversations.ts +400 -77
- package/src/resources/index.ts +20 -26
- package/src/resources/me.ts +151 -52
- package/src/resources/messages.ts +230 -27
- package/src/resources/numbers.ts +50 -4
- package/src/resources/profiles/campaigns.ts +706 -232
- package/src/resources/profiles/index.ts +6 -14
- package/src/resources/profiles/profiles.ts +2421 -646
- package/src/resources/templates.ts +583 -99
- package/src/resources/users.ts +514 -44
- package/src/resources/webhooks.ts +1006 -283
- 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
|
@@ -8,7 +8,11 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
8
8
|
import { path } from '../internal/utils/path';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Delivery reports and inbound messages, pushed to you.
|
|
12
|
+
*
|
|
13
|
+
* Subscribe an endpoint to the event types you care about — `GET /v3/webhooks/event-types` lists them — and we POST each one as it happens, retrying on failure. Polling `GET /v3/messages/{id}` works and does not scale.
|
|
14
|
+
*
|
|
15
|
+
* **Verify the signature.** Every delivery is signed with your endpoint's secret; an unverified endpoint is one anybody can post to. `rotate-secret` replaces it, `test` sends a specimen event, and `GET /v3/webhooks/{id}/events` shows what we tried to deliver and what your endpoint answered — which is the first place to look when something appears to be missing.
|
|
12
16
|
*/
|
|
13
17
|
export class Webhooks extends APIResource {
|
|
14
18
|
/**
|
|
@@ -16,10 +20,10 @@ export class Webhooks extends APIResource {
|
|
|
16
20
|
*
|
|
17
21
|
* @example
|
|
18
22
|
* ```ts
|
|
19
|
-
* const
|
|
23
|
+
* const webhook = await client.webhooks.create();
|
|
20
24
|
* ```
|
|
21
25
|
*/
|
|
22
|
-
create(params: WebhookCreateParams, options?: RequestOptions): APIPromise<
|
|
26
|
+
create(params: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse> {
|
|
23
27
|
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
24
28
|
return this._client.post('/v3/webhooks', {
|
|
25
29
|
body,
|
|
@@ -39,7 +43,7 @@ export class Webhooks extends APIResource {
|
|
|
39
43
|
*
|
|
40
44
|
* @example
|
|
41
45
|
* ```ts
|
|
42
|
-
* const
|
|
46
|
+
* const webhook = await client.webhooks.retrieve(
|
|
43
47
|
* 'd4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8',
|
|
44
48
|
* );
|
|
45
49
|
* ```
|
|
@@ -48,7 +52,7 @@ export class Webhooks extends APIResource {
|
|
|
48
52
|
id: string,
|
|
49
53
|
params: WebhookRetrieveParams | null | undefined = {},
|
|
50
54
|
options?: RequestOptions,
|
|
51
|
-
): APIPromise<
|
|
55
|
+
): APIPromise<WebhookRetrieveResponse> {
|
|
52
56
|
const { 'x-profile-id': xProfileID } = params ?? {};
|
|
53
57
|
return this._client.get(path`/v3/webhooks/${id}`, {
|
|
54
58
|
...options,
|
|
@@ -64,12 +68,16 @@ export class Webhooks extends APIResource {
|
|
|
64
68
|
*
|
|
65
69
|
* @example
|
|
66
70
|
* ```ts
|
|
67
|
-
* const
|
|
71
|
+
* const webhook = await client.webhooks.update(
|
|
68
72
|
* 'd4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8',
|
|
69
73
|
* );
|
|
70
74
|
* ```
|
|
71
75
|
*/
|
|
72
|
-
update(
|
|
76
|
+
update(
|
|
77
|
+
id: string,
|
|
78
|
+
params: WebhookUpdateParams,
|
|
79
|
+
options?: RequestOptions,
|
|
80
|
+
): APIPromise<WebhookUpdateResponse> {
|
|
73
81
|
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
74
82
|
return this._client.put(path`/v3/webhooks/${id}`, {
|
|
75
83
|
body,
|
|
@@ -241,17 +249,16 @@ export class Webhooks extends APIResource {
|
|
|
241
249
|
*
|
|
242
250
|
* @example
|
|
243
251
|
* ```ts
|
|
244
|
-
* const
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* );
|
|
252
|
+
* const response = await client.webhooks.toggleStatus(
|
|
253
|
+
* 'd4f5a6b7-c8d9-4e0f-a1b2-c3d4e5f6a7b8',
|
|
254
|
+
* );
|
|
248
255
|
* ```
|
|
249
256
|
*/
|
|
250
257
|
toggleStatus(
|
|
251
258
|
id: string,
|
|
252
259
|
params: WebhookToggleStatusParams,
|
|
253
260
|
options?: RequestOptions,
|
|
254
|
-
): APIPromise<
|
|
261
|
+
): APIPromise<WebhookToggleStatusResponse> {
|
|
255
262
|
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
256
263
|
return this._client.patch(path`/v3/webhooks/${id}/toggle-status`, {
|
|
257
264
|
body,
|
|
@@ -267,76 +274,6 @@ export class Webhooks extends APIResource {
|
|
|
267
274
|
}
|
|
268
275
|
}
|
|
269
276
|
|
|
270
|
-
/**
|
|
271
|
-
* Request and response metadata
|
|
272
|
-
*/
|
|
273
|
-
export interface APIMeta {
|
|
274
|
-
/**
|
|
275
|
-
* Unique identifier for this request (for tracing and support)
|
|
276
|
-
*/
|
|
277
|
-
request_id?: string;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Server timestamp when the response was generated
|
|
281
|
-
*/
|
|
282
|
-
timestamp?: string;
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* API version used for this request
|
|
286
|
-
*/
|
|
287
|
-
version?: string;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Standard API response envelope for all v3 endpoints
|
|
292
|
-
*/
|
|
293
|
-
export interface APIResponseWebhook {
|
|
294
|
-
/**
|
|
295
|
-
* The response data (null if error)
|
|
296
|
-
*/
|
|
297
|
-
data?: WebhookResponse | null;
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Error information
|
|
301
|
-
*/
|
|
302
|
-
error?: ErrorDetail | null;
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Request and response metadata
|
|
306
|
-
*/
|
|
307
|
-
meta?: APIMeta;
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* Indicates whether the request was successful
|
|
311
|
-
*/
|
|
312
|
-
success?: boolean;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Error information
|
|
317
|
-
*/
|
|
318
|
-
export interface ErrorDetail {
|
|
319
|
-
/**
|
|
320
|
-
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
321
|
-
*/
|
|
322
|
-
code?: string;
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Additional validation error details (field-level errors)
|
|
326
|
-
*/
|
|
327
|
-
details?: { [key: string]: Array<string> } | null;
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* URL to documentation about this error
|
|
331
|
-
*/
|
|
332
|
-
doc_url?: string | null;
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Human-readable error message
|
|
336
|
-
*/
|
|
337
|
-
message?: string;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
277
|
/**
|
|
341
278
|
* The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
342
279
|
* this shape and varies only in Payload.
|
|
@@ -508,66 +445,6 @@ export interface MessageEventPayload {
|
|
|
508
445
|
updated_at?: string;
|
|
509
446
|
}
|
|
510
447
|
|
|
511
|
-
export interface MutationRequest {
|
|
512
|
-
/**
|
|
513
|
-
* Sandbox flag - when true, the operation is simulated without side effects Useful
|
|
514
|
-
* for testing integrations without actual execution
|
|
515
|
-
*/
|
|
516
|
-
sandbox?: boolean;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* Pagination metadata for list responses
|
|
521
|
-
*/
|
|
522
|
-
export interface PaginationMeta {
|
|
523
|
-
/**
|
|
524
|
-
* Cursor-based pagination pointers
|
|
525
|
-
*/
|
|
526
|
-
cursors?: PaginationMeta.Cursors | null;
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* Whether there are more pages after this one
|
|
530
|
-
*/
|
|
531
|
-
has_more?: boolean;
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* Current page number (1-indexed)
|
|
535
|
-
*/
|
|
536
|
-
page?: number;
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* Number of items per page
|
|
540
|
-
*/
|
|
541
|
-
page_size?: number;
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* Total number of items across all pages
|
|
545
|
-
*/
|
|
546
|
-
total_count?: number;
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* Total number of pages
|
|
550
|
-
*/
|
|
551
|
-
total_pages?: number;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
export namespace PaginationMeta {
|
|
555
|
-
/**
|
|
556
|
-
* Cursor-based pagination pointers
|
|
557
|
-
*/
|
|
558
|
-
export interface Cursors {
|
|
559
|
-
/**
|
|
560
|
-
* Cursor to fetch the next page
|
|
561
|
-
*/
|
|
562
|
-
after?: string | null;
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* Cursor to fetch the previous page
|
|
566
|
-
*/
|
|
567
|
-
before?: string | null;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
448
|
/**
|
|
572
449
|
* The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
573
450
|
* this shape and varies only in Payload.
|
|
@@ -653,68 +530,24 @@ export interface TemplateEventPayload {
|
|
|
653
530
|
whatsapp_template_id?: string;
|
|
654
531
|
}
|
|
655
532
|
|
|
656
|
-
export interface WebhookEventType {
|
|
657
|
-
description?: string | null;
|
|
658
|
-
|
|
659
|
-
display_name?: string;
|
|
660
|
-
|
|
661
|
-
event_type?: string | null;
|
|
662
|
-
|
|
663
|
-
is_active?: boolean;
|
|
664
|
-
|
|
665
|
-
name?: string;
|
|
666
|
-
|
|
667
|
-
sub_types?: Array<WebhookEventType> | null;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
export interface WebhookResponse {
|
|
671
|
-
id?: string;
|
|
672
|
-
|
|
673
|
-
consecutive_failures?: number;
|
|
674
|
-
|
|
675
|
-
created_at?: string;
|
|
676
|
-
|
|
677
|
-
display_name?: string;
|
|
678
|
-
|
|
679
|
-
endpoint_url?: string;
|
|
680
|
-
|
|
681
|
-
event_filters?: { [key: string]: Array<string> } | null;
|
|
682
|
-
|
|
683
|
-
event_types?: Array<string>;
|
|
684
|
-
|
|
685
|
-
is_active?: boolean;
|
|
686
|
-
|
|
687
|
-
last_delivery_attempt_at?: string | null;
|
|
688
|
-
|
|
689
|
-
last_successful_delivery_at?: string | null;
|
|
690
|
-
|
|
691
|
-
retry_count?: number;
|
|
692
|
-
|
|
693
|
-
signing_secret?: string | null;
|
|
694
|
-
|
|
695
|
-
timeout_seconds?: number;
|
|
696
|
-
|
|
697
|
-
updated_at?: string | null;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
533
|
/**
|
|
701
534
|
* Standard API response envelope for all v3 endpoints
|
|
702
535
|
*/
|
|
703
|
-
export interface
|
|
536
|
+
export interface WebhookCreateResponse {
|
|
704
537
|
/**
|
|
705
538
|
* The response data (null if error)
|
|
706
539
|
*/
|
|
707
|
-
data?:
|
|
540
|
+
data?: WebhookCreateResponse.Data | null;
|
|
708
541
|
|
|
709
542
|
/**
|
|
710
543
|
* Error information
|
|
711
544
|
*/
|
|
712
|
-
error?:
|
|
545
|
+
error?: WebhookCreateResponse.Error | null;
|
|
713
546
|
|
|
714
547
|
/**
|
|
715
548
|
* Request and response metadata
|
|
716
549
|
*/
|
|
717
|
-
meta?:
|
|
550
|
+
meta?: WebhookCreateResponse.Meta;
|
|
718
551
|
|
|
719
552
|
/**
|
|
720
553
|
* Indicates whether the request was successful
|
|
@@ -722,72 +555,110 @@ export interface WebhookListResponse {
|
|
|
722
555
|
success?: boolean;
|
|
723
556
|
}
|
|
724
557
|
|
|
725
|
-
export namespace
|
|
558
|
+
export namespace WebhookCreateResponse {
|
|
726
559
|
/**
|
|
727
560
|
* The response data (null if error)
|
|
728
561
|
*/
|
|
729
562
|
export interface Data {
|
|
563
|
+
id?: string;
|
|
564
|
+
|
|
565
|
+
consecutive_failures?: number;
|
|
566
|
+
|
|
567
|
+
created_at?: string;
|
|
568
|
+
|
|
730
569
|
/**
|
|
731
|
-
*
|
|
570
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
571
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
732
572
|
*/
|
|
733
|
-
|
|
573
|
+
customer_id?: string;
|
|
734
574
|
|
|
735
|
-
|
|
736
|
-
}
|
|
737
|
-
}
|
|
575
|
+
display_name?: string;
|
|
738
576
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
577
|
+
endpoint_url?: string;
|
|
578
|
+
|
|
579
|
+
event_filters?: { [key: string]: Array<string> } | null;
|
|
580
|
+
|
|
581
|
+
event_types?: Array<string>;
|
|
582
|
+
|
|
583
|
+
is_active?: boolean;
|
|
584
|
+
|
|
585
|
+
last_delivery_attempt_at?: string | null;
|
|
586
|
+
|
|
587
|
+
last_successful_delivery_at?: string | null;
|
|
588
|
+
|
|
589
|
+
retry_count?: number;
|
|
590
|
+
|
|
591
|
+
signing_secret?: string | null;
|
|
592
|
+
|
|
593
|
+
timeout_seconds?: number;
|
|
594
|
+
|
|
595
|
+
updated_at?: string | null;
|
|
596
|
+
}
|
|
747
597
|
|
|
748
598
|
/**
|
|
749
599
|
* Error information
|
|
750
600
|
*/
|
|
751
|
-
|
|
601
|
+
export interface Error {
|
|
602
|
+
/**
|
|
603
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
604
|
+
*/
|
|
605
|
+
code?: string;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Additional validation error details (field-level errors)
|
|
609
|
+
*/
|
|
610
|
+
details?: { [key: string]: Array<string> } | null;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* URL to documentation about this error
|
|
614
|
+
*/
|
|
615
|
+
doc_url?: string | null;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Human-readable error message
|
|
619
|
+
*/
|
|
620
|
+
message?: string;
|
|
621
|
+
}
|
|
752
622
|
|
|
753
623
|
/**
|
|
754
624
|
* Request and response metadata
|
|
755
625
|
*/
|
|
756
|
-
|
|
626
|
+
export interface Meta {
|
|
627
|
+
/**
|
|
628
|
+
* Unique identifier for this request (for tracing and support)
|
|
629
|
+
*/
|
|
630
|
+
request_id?: string;
|
|
757
631
|
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
}
|
|
632
|
+
/**
|
|
633
|
+
* Server timestamp when the response was generated
|
|
634
|
+
*/
|
|
635
|
+
timestamp?: string;
|
|
763
636
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
export interface Data {
|
|
769
|
-
event_types?: Array<WebhooksAPI.WebhookEventType>;
|
|
637
|
+
/**
|
|
638
|
+
* API version used for this request
|
|
639
|
+
*/
|
|
640
|
+
version?: string;
|
|
770
641
|
}
|
|
771
642
|
}
|
|
772
643
|
|
|
773
644
|
/**
|
|
774
645
|
* Standard API response envelope for all v3 endpoints
|
|
775
646
|
*/
|
|
776
|
-
export interface
|
|
647
|
+
export interface WebhookRetrieveResponse {
|
|
777
648
|
/**
|
|
778
649
|
* The response data (null if error)
|
|
779
650
|
*/
|
|
780
|
-
data?:
|
|
651
|
+
data?: WebhookRetrieveResponse.Data | null;
|
|
781
652
|
|
|
782
653
|
/**
|
|
783
654
|
* Error information
|
|
784
655
|
*/
|
|
785
|
-
error?:
|
|
656
|
+
error?: WebhookRetrieveResponse.Error | null;
|
|
786
657
|
|
|
787
658
|
/**
|
|
788
659
|
* Request and response metadata
|
|
789
660
|
*/
|
|
790
|
-
meta?:
|
|
661
|
+
meta?: WebhookRetrieveResponse.Meta;
|
|
791
662
|
|
|
792
663
|
/**
|
|
793
664
|
* Indicates whether the request was successful
|
|
@@ -795,104 +666,110 @@ export interface WebhookListEventsResponse {
|
|
|
795
666
|
success?: boolean;
|
|
796
667
|
}
|
|
797
668
|
|
|
798
|
-
export namespace
|
|
669
|
+
export namespace WebhookRetrieveResponse {
|
|
799
670
|
/**
|
|
800
671
|
* The response data (null if error)
|
|
801
672
|
*/
|
|
802
673
|
export interface Data {
|
|
803
|
-
|
|
674
|
+
id?: string;
|
|
675
|
+
|
|
676
|
+
consecutive_failures?: number;
|
|
677
|
+
|
|
678
|
+
created_at?: string;
|
|
804
679
|
|
|
805
680
|
/**
|
|
806
|
-
*
|
|
681
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
682
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
807
683
|
*/
|
|
808
|
-
|
|
809
|
-
}
|
|
684
|
+
customer_id?: string;
|
|
810
685
|
|
|
811
|
-
|
|
812
|
-
export interface Event {
|
|
813
|
-
id?: string;
|
|
686
|
+
display_name?: string;
|
|
814
687
|
|
|
815
|
-
|
|
688
|
+
endpoint_url?: string;
|
|
816
689
|
|
|
817
|
-
|
|
690
|
+
event_filters?: { [key: string]: Array<string> } | null;
|
|
818
691
|
|
|
819
|
-
|
|
692
|
+
event_types?: Array<string>;
|
|
820
693
|
|
|
821
|
-
|
|
694
|
+
is_active?: boolean;
|
|
822
695
|
|
|
823
|
-
|
|
824
|
-
* The exact event body that was delivered, or attempted, for this record. One of
|
|
825
|
-
* the three webhook envelopes: a message status change, an inbound message, or a
|
|
826
|
-
* template status change. Read field and event to tell which, the same way your
|
|
827
|
-
* endpoint does.
|
|
828
|
-
*/
|
|
829
|
-
event_data?: WebhooksAPI.MessageEvent | WebhooksAPI.InboundMessageEvent | WebhooksAPI.TemplateEvent;
|
|
696
|
+
last_delivery_attempt_at?: string | null;
|
|
830
697
|
|
|
831
|
-
|
|
698
|
+
last_successful_delivery_at?: string | null;
|
|
832
699
|
|
|
833
|
-
|
|
700
|
+
retry_count?: number;
|
|
834
701
|
|
|
835
|
-
|
|
702
|
+
signing_secret?: string | null;
|
|
836
703
|
|
|
837
|
-
|
|
704
|
+
timeout_seconds?: number;
|
|
838
705
|
|
|
839
|
-
|
|
840
|
-
}
|
|
706
|
+
updated_at?: string | null;
|
|
841
707
|
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* Standard API response envelope for all v3 endpoints
|
|
846
|
-
*/
|
|
847
|
-
export interface WebhookRotateSecretResponse {
|
|
848
|
-
/**
|
|
849
|
-
* The response data (null if error)
|
|
850
|
-
*/
|
|
851
|
-
data?: WebhookRotateSecretResponse.Data | null;
|
|
852
708
|
|
|
853
709
|
/**
|
|
854
710
|
* Error information
|
|
855
711
|
*/
|
|
856
|
-
|
|
712
|
+
export interface Error {
|
|
713
|
+
/**
|
|
714
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
715
|
+
*/
|
|
716
|
+
code?: string;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Additional validation error details (field-level errors)
|
|
720
|
+
*/
|
|
721
|
+
details?: { [key: string]: Array<string> } | null;
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* URL to documentation about this error
|
|
725
|
+
*/
|
|
726
|
+
doc_url?: string | null;
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Human-readable error message
|
|
730
|
+
*/
|
|
731
|
+
message?: string;
|
|
732
|
+
}
|
|
857
733
|
|
|
858
734
|
/**
|
|
859
735
|
* Request and response metadata
|
|
860
736
|
*/
|
|
861
|
-
|
|
737
|
+
export interface Meta {
|
|
738
|
+
/**
|
|
739
|
+
* Unique identifier for this request (for tracing and support)
|
|
740
|
+
*/
|
|
741
|
+
request_id?: string;
|
|
862
742
|
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
}
|
|
743
|
+
/**
|
|
744
|
+
* Server timestamp when the response was generated
|
|
745
|
+
*/
|
|
746
|
+
timestamp?: string;
|
|
868
747
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
export interface Data {
|
|
874
|
-
signing_secret?: string;
|
|
748
|
+
/**
|
|
749
|
+
* API version used for this request
|
|
750
|
+
*/
|
|
751
|
+
version?: string;
|
|
875
752
|
}
|
|
876
753
|
}
|
|
877
754
|
|
|
878
755
|
/**
|
|
879
756
|
* Standard API response envelope for all v3 endpoints
|
|
880
757
|
*/
|
|
881
|
-
export interface
|
|
758
|
+
export interface WebhookUpdateResponse {
|
|
882
759
|
/**
|
|
883
760
|
* The response data (null if error)
|
|
884
761
|
*/
|
|
885
|
-
data?:
|
|
762
|
+
data?: WebhookUpdateResponse.Data | null;
|
|
886
763
|
|
|
887
764
|
/**
|
|
888
765
|
* Error information
|
|
889
766
|
*/
|
|
890
|
-
error?:
|
|
767
|
+
error?: WebhookUpdateResponse.Error | null;
|
|
891
768
|
|
|
892
769
|
/**
|
|
893
770
|
* Request and response metadata
|
|
894
771
|
*/
|
|
895
|
-
meta?:
|
|
772
|
+
meta?: WebhookUpdateResponse.Meta;
|
|
896
773
|
|
|
897
774
|
/**
|
|
898
775
|
* Indicates whether the request was successful
|
|
@@ -900,14 +777,863 @@ export interface WebhookTestResponse {
|
|
|
900
777
|
success?: boolean;
|
|
901
778
|
}
|
|
902
779
|
|
|
903
|
-
export namespace
|
|
780
|
+
export namespace WebhookUpdateResponse {
|
|
904
781
|
/**
|
|
905
782
|
* The response data (null if error)
|
|
906
783
|
*/
|
|
907
784
|
export interface Data {
|
|
908
|
-
|
|
785
|
+
id?: string;
|
|
909
786
|
|
|
910
|
-
|
|
787
|
+
consecutive_failures?: number;
|
|
788
|
+
|
|
789
|
+
created_at?: string;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
793
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
794
|
+
*/
|
|
795
|
+
customer_id?: string;
|
|
796
|
+
|
|
797
|
+
display_name?: string;
|
|
798
|
+
|
|
799
|
+
endpoint_url?: string;
|
|
800
|
+
|
|
801
|
+
event_filters?: { [key: string]: Array<string> } | null;
|
|
802
|
+
|
|
803
|
+
event_types?: Array<string>;
|
|
804
|
+
|
|
805
|
+
is_active?: boolean;
|
|
806
|
+
|
|
807
|
+
last_delivery_attempt_at?: string | null;
|
|
808
|
+
|
|
809
|
+
last_successful_delivery_at?: string | null;
|
|
810
|
+
|
|
811
|
+
retry_count?: number;
|
|
812
|
+
|
|
813
|
+
signing_secret?: string | null;
|
|
814
|
+
|
|
815
|
+
timeout_seconds?: number;
|
|
816
|
+
|
|
817
|
+
updated_at?: string | null;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Error information
|
|
822
|
+
*/
|
|
823
|
+
export interface Error {
|
|
824
|
+
/**
|
|
825
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
826
|
+
*/
|
|
827
|
+
code?: string;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Additional validation error details (field-level errors)
|
|
831
|
+
*/
|
|
832
|
+
details?: { [key: string]: Array<string> } | null;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* URL to documentation about this error
|
|
836
|
+
*/
|
|
837
|
+
doc_url?: string | null;
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Human-readable error message
|
|
841
|
+
*/
|
|
842
|
+
message?: string;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Request and response metadata
|
|
847
|
+
*/
|
|
848
|
+
export interface Meta {
|
|
849
|
+
/**
|
|
850
|
+
* Unique identifier for this request (for tracing and support)
|
|
851
|
+
*/
|
|
852
|
+
request_id?: string;
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Server timestamp when the response was generated
|
|
856
|
+
*/
|
|
857
|
+
timestamp?: string;
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* API version used for this request
|
|
861
|
+
*/
|
|
862
|
+
version?: string;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* Standard API response envelope for all v3 endpoints
|
|
868
|
+
*/
|
|
869
|
+
export interface WebhookListResponse {
|
|
870
|
+
/**
|
|
871
|
+
* A paginated list of webhooks.
|
|
872
|
+
*/
|
|
873
|
+
data?: WebhookListResponse.Data | null;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Error information
|
|
877
|
+
*/
|
|
878
|
+
error?: WebhookListResponse.Error | null;
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* Request and response metadata
|
|
882
|
+
*/
|
|
883
|
+
meta?: WebhookListResponse.Meta;
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* Indicates whether the request was successful
|
|
887
|
+
*/
|
|
888
|
+
success?: boolean;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
export namespace WebhookListResponse {
|
|
892
|
+
/**
|
|
893
|
+
* A paginated list of webhooks.
|
|
894
|
+
*/
|
|
895
|
+
export interface Data {
|
|
896
|
+
/**
|
|
897
|
+
* Pagination metadata for list responses
|
|
898
|
+
*/
|
|
899
|
+
pagination?: Data.Pagination;
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* The webhooks on this page.
|
|
903
|
+
*/
|
|
904
|
+
webhooks?: Array<Data.Webhook>;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
export namespace Data {
|
|
908
|
+
/**
|
|
909
|
+
* Pagination metadata for list responses
|
|
910
|
+
*/
|
|
911
|
+
export interface Pagination {
|
|
912
|
+
/**
|
|
913
|
+
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
914
|
+
*/
|
|
915
|
+
cursors?: Pagination.Cursors | null;
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Whether there are more pages after this one
|
|
919
|
+
*/
|
|
920
|
+
has_more?: boolean;
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Current page number (1-indexed)
|
|
924
|
+
*/
|
|
925
|
+
page?: number;
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Number of items per page
|
|
929
|
+
*/
|
|
930
|
+
page_size?: number;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Total number of items across all pages
|
|
934
|
+
*/
|
|
935
|
+
total_count?: number;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Total number of pages
|
|
939
|
+
*/
|
|
940
|
+
total_pages?: number;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
export namespace Pagination {
|
|
944
|
+
/**
|
|
945
|
+
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
946
|
+
*/
|
|
947
|
+
export interface Cursors {
|
|
948
|
+
/**
|
|
949
|
+
* Cursor to fetch the next page.
|
|
950
|
+
*/
|
|
951
|
+
after?: string | null;
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* Cursor to fetch the previous page.
|
|
955
|
+
*/
|
|
956
|
+
before?: string | null;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
export interface Webhook {
|
|
961
|
+
id?: string;
|
|
962
|
+
|
|
963
|
+
consecutive_failures?: number;
|
|
964
|
+
|
|
965
|
+
created_at?: string;
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
969
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
970
|
+
*/
|
|
971
|
+
customer_id?: string;
|
|
972
|
+
|
|
973
|
+
display_name?: string;
|
|
974
|
+
|
|
975
|
+
endpoint_url?: string;
|
|
976
|
+
|
|
977
|
+
event_filters?: { [key: string]: Array<string> } | null;
|
|
978
|
+
|
|
979
|
+
event_types?: Array<string>;
|
|
980
|
+
|
|
981
|
+
is_active?: boolean;
|
|
982
|
+
|
|
983
|
+
last_delivery_attempt_at?: string | null;
|
|
984
|
+
|
|
985
|
+
last_successful_delivery_at?: string | null;
|
|
986
|
+
|
|
987
|
+
retry_count?: number;
|
|
988
|
+
|
|
989
|
+
signing_secret?: string | null;
|
|
990
|
+
|
|
991
|
+
timeout_seconds?: number;
|
|
992
|
+
|
|
993
|
+
updated_at?: string | null;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Error information
|
|
999
|
+
*/
|
|
1000
|
+
export interface Error {
|
|
1001
|
+
/**
|
|
1002
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
1003
|
+
*/
|
|
1004
|
+
code?: string;
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Additional validation error details (field-level errors)
|
|
1008
|
+
*/
|
|
1009
|
+
details?: { [key: string]: Array<string> } | null;
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* URL to documentation about this error
|
|
1013
|
+
*/
|
|
1014
|
+
doc_url?: string | null;
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Human-readable error message
|
|
1018
|
+
*/
|
|
1019
|
+
message?: string;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* Request and response metadata
|
|
1024
|
+
*/
|
|
1025
|
+
export interface Meta {
|
|
1026
|
+
/**
|
|
1027
|
+
* Unique identifier for this request (for tracing and support)
|
|
1028
|
+
*/
|
|
1029
|
+
request_id?: string;
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Server timestamp when the response was generated
|
|
1033
|
+
*/
|
|
1034
|
+
timestamp?: string;
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* API version used for this request
|
|
1038
|
+
*/
|
|
1039
|
+
version?: string;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* Standard API response envelope for all v3 endpoints
|
|
1045
|
+
*/
|
|
1046
|
+
export interface WebhookListEventTypesResponse {
|
|
1047
|
+
/**
|
|
1048
|
+
* The webhook event types a customer can subscribe to.
|
|
1049
|
+
*/
|
|
1050
|
+
data?: WebhookListEventTypesResponse.Data | null;
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Error information
|
|
1054
|
+
*/
|
|
1055
|
+
error?: WebhookListEventTypesResponse.Error | null;
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Request and response metadata
|
|
1059
|
+
*/
|
|
1060
|
+
meta?: WebhookListEventTypesResponse.Meta;
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Indicates whether the request was successful
|
|
1064
|
+
*/
|
|
1065
|
+
success?: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
export namespace WebhookListEventTypesResponse {
|
|
1069
|
+
/**
|
|
1070
|
+
* The webhook event types a customer can subscribe to.
|
|
1071
|
+
*/
|
|
1072
|
+
export interface Data {
|
|
1073
|
+
/**
|
|
1074
|
+
* The event_types on this page.
|
|
1075
|
+
*/
|
|
1076
|
+
event_types?: Array<Data.EventType>;
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* Pagination metadata for list responses
|
|
1080
|
+
*/
|
|
1081
|
+
pagination?: Data.Pagination;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
export namespace Data {
|
|
1085
|
+
export interface EventType {
|
|
1086
|
+
description?: string | null;
|
|
1087
|
+
|
|
1088
|
+
display_name?: string;
|
|
1089
|
+
|
|
1090
|
+
event_type?: string | null;
|
|
1091
|
+
|
|
1092
|
+
is_active?: boolean;
|
|
1093
|
+
|
|
1094
|
+
name?: string;
|
|
1095
|
+
|
|
1096
|
+
sub_types?: Array<unknown> | null;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Pagination metadata for list responses
|
|
1101
|
+
*/
|
|
1102
|
+
export interface Pagination {
|
|
1103
|
+
/**
|
|
1104
|
+
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
1105
|
+
*/
|
|
1106
|
+
cursors?: Pagination.Cursors | null;
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* Whether there are more pages after this one
|
|
1110
|
+
*/
|
|
1111
|
+
has_more?: boolean;
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* Current page number (1-indexed)
|
|
1115
|
+
*/
|
|
1116
|
+
page?: number;
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* Number of items per page
|
|
1120
|
+
*/
|
|
1121
|
+
page_size?: number;
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* Total number of items across all pages
|
|
1125
|
+
*/
|
|
1126
|
+
total_count?: number;
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Total number of pages
|
|
1130
|
+
*/
|
|
1131
|
+
total_pages?: number;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
export namespace Pagination {
|
|
1135
|
+
/**
|
|
1136
|
+
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
1137
|
+
*/
|
|
1138
|
+
export interface Cursors {
|
|
1139
|
+
/**
|
|
1140
|
+
* Cursor to fetch the next page.
|
|
1141
|
+
*/
|
|
1142
|
+
after?: string | null;
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* Cursor to fetch the previous page.
|
|
1146
|
+
*/
|
|
1147
|
+
before?: string | null;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Error information
|
|
1154
|
+
*/
|
|
1155
|
+
export interface Error {
|
|
1156
|
+
/**
|
|
1157
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
1158
|
+
*/
|
|
1159
|
+
code?: string;
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* Additional validation error details (field-level errors)
|
|
1163
|
+
*/
|
|
1164
|
+
details?: { [key: string]: Array<string> } | null;
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* URL to documentation about this error
|
|
1168
|
+
*/
|
|
1169
|
+
doc_url?: string | null;
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* Human-readable error message
|
|
1173
|
+
*/
|
|
1174
|
+
message?: string;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* Request and response metadata
|
|
1179
|
+
*/
|
|
1180
|
+
export interface Meta {
|
|
1181
|
+
/**
|
|
1182
|
+
* Unique identifier for this request (for tracing and support)
|
|
1183
|
+
*/
|
|
1184
|
+
request_id?: string;
|
|
1185
|
+
|
|
1186
|
+
/**
|
|
1187
|
+
* Server timestamp when the response was generated
|
|
1188
|
+
*/
|
|
1189
|
+
timestamp?: string;
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* API version used for this request
|
|
1193
|
+
*/
|
|
1194
|
+
version?: string;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Standard API response envelope for all v3 endpoints
|
|
1200
|
+
*/
|
|
1201
|
+
export interface WebhookListEventsResponse {
|
|
1202
|
+
/**
|
|
1203
|
+
* A paginated list of webhook delivery records.
|
|
1204
|
+
*/
|
|
1205
|
+
data?: WebhookListEventsResponse.Data | null;
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* Error information
|
|
1209
|
+
*/
|
|
1210
|
+
error?: WebhookListEventsResponse.Error | null;
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Request and response metadata
|
|
1214
|
+
*/
|
|
1215
|
+
meta?: WebhookListEventsResponse.Meta;
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Indicates whether the request was successful
|
|
1219
|
+
*/
|
|
1220
|
+
success?: boolean;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
export namespace WebhookListEventsResponse {
|
|
1224
|
+
/**
|
|
1225
|
+
* A paginated list of webhook delivery records.
|
|
1226
|
+
*/
|
|
1227
|
+
export interface Data {
|
|
1228
|
+
/**
|
|
1229
|
+
* The events on this page.
|
|
1230
|
+
*/
|
|
1231
|
+
events?: Array<Data.Event>;
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* Pagination metadata for list responses
|
|
1235
|
+
*/
|
|
1236
|
+
pagination?: Data.Pagination;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
export namespace Data {
|
|
1240
|
+
export interface Event {
|
|
1241
|
+
id?: string;
|
|
1242
|
+
|
|
1243
|
+
created_at?: string;
|
|
1244
|
+
|
|
1245
|
+
delivery_attempts?: number;
|
|
1246
|
+
|
|
1247
|
+
delivery_status?: string;
|
|
1248
|
+
|
|
1249
|
+
error_message?: string | null;
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* The exact event body that was delivered, or attempted, for this record. One of
|
|
1253
|
+
* the three webhook envelopes: a message status change, an inbound message, or a
|
|
1254
|
+
* template status change. Read field and event to tell which, the same way your
|
|
1255
|
+
* endpoint does.
|
|
1256
|
+
*/
|
|
1257
|
+
event_data?: WebhooksAPI.MessageEvent | WebhooksAPI.InboundMessageEvent | WebhooksAPI.TemplateEvent;
|
|
1258
|
+
|
|
1259
|
+
event_type?: string;
|
|
1260
|
+
|
|
1261
|
+
http_status_code?: number | null;
|
|
1262
|
+
|
|
1263
|
+
processing_completed_at?: string | null;
|
|
1264
|
+
|
|
1265
|
+
processing_started_at?: string | null;
|
|
1266
|
+
|
|
1267
|
+
response_body?: string | null;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Pagination metadata for list responses
|
|
1272
|
+
*/
|
|
1273
|
+
export interface Pagination {
|
|
1274
|
+
/**
|
|
1275
|
+
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
1276
|
+
*/
|
|
1277
|
+
cursors?: Pagination.Cursors | null;
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* Whether there are more pages after this one
|
|
1281
|
+
*/
|
|
1282
|
+
has_more?: boolean;
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Current page number (1-indexed)
|
|
1286
|
+
*/
|
|
1287
|
+
page?: number;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Number of items per page
|
|
1291
|
+
*/
|
|
1292
|
+
page_size?: number;
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* Total number of items across all pages
|
|
1296
|
+
*/
|
|
1297
|
+
total_count?: number;
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Total number of pages
|
|
1301
|
+
*/
|
|
1302
|
+
total_pages?: number;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
export namespace Pagination {
|
|
1306
|
+
/**
|
|
1307
|
+
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
1308
|
+
*/
|
|
1309
|
+
export interface Cursors {
|
|
1310
|
+
/**
|
|
1311
|
+
* Cursor to fetch the next page.
|
|
1312
|
+
*/
|
|
1313
|
+
after?: string | null;
|
|
1314
|
+
|
|
1315
|
+
/**
|
|
1316
|
+
* Cursor to fetch the previous page.
|
|
1317
|
+
*/
|
|
1318
|
+
before?: string | null;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* Error information
|
|
1325
|
+
*/
|
|
1326
|
+
export interface Error {
|
|
1327
|
+
/**
|
|
1328
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
1329
|
+
*/
|
|
1330
|
+
code?: string;
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Additional validation error details (field-level errors)
|
|
1334
|
+
*/
|
|
1335
|
+
details?: { [key: string]: Array<string> } | null;
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* URL to documentation about this error
|
|
1339
|
+
*/
|
|
1340
|
+
doc_url?: string | null;
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* Human-readable error message
|
|
1344
|
+
*/
|
|
1345
|
+
message?: string;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Request and response metadata
|
|
1350
|
+
*/
|
|
1351
|
+
export interface Meta {
|
|
1352
|
+
/**
|
|
1353
|
+
* Unique identifier for this request (for tracing and support)
|
|
1354
|
+
*/
|
|
1355
|
+
request_id?: string;
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* Server timestamp when the response was generated
|
|
1359
|
+
*/
|
|
1360
|
+
timestamp?: string;
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* API version used for this request
|
|
1364
|
+
*/
|
|
1365
|
+
version?: string;
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* Standard API response envelope for all v3 endpoints
|
|
1371
|
+
*/
|
|
1372
|
+
export interface WebhookRotateSecretResponse {
|
|
1373
|
+
/**
|
|
1374
|
+
* The response data (null if error)
|
|
1375
|
+
*/
|
|
1376
|
+
data?: WebhookRotateSecretResponse.Data | null;
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* Error information
|
|
1380
|
+
*/
|
|
1381
|
+
error?: WebhookRotateSecretResponse.Error | null;
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Request and response metadata
|
|
1385
|
+
*/
|
|
1386
|
+
meta?: WebhookRotateSecretResponse.Meta;
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Indicates whether the request was successful
|
|
1390
|
+
*/
|
|
1391
|
+
success?: boolean;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
export namespace WebhookRotateSecretResponse {
|
|
1395
|
+
/**
|
|
1396
|
+
* The response data (null if error)
|
|
1397
|
+
*/
|
|
1398
|
+
export interface Data {
|
|
1399
|
+
signing_secret?: string;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* Error information
|
|
1404
|
+
*/
|
|
1405
|
+
export interface Error {
|
|
1406
|
+
/**
|
|
1407
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
1408
|
+
*/
|
|
1409
|
+
code?: string;
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Additional validation error details (field-level errors)
|
|
1413
|
+
*/
|
|
1414
|
+
details?: { [key: string]: Array<string> } | null;
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* URL to documentation about this error
|
|
1418
|
+
*/
|
|
1419
|
+
doc_url?: string | null;
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Human-readable error message
|
|
1423
|
+
*/
|
|
1424
|
+
message?: string;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* Request and response metadata
|
|
1429
|
+
*/
|
|
1430
|
+
export interface Meta {
|
|
1431
|
+
/**
|
|
1432
|
+
* Unique identifier for this request (for tracing and support)
|
|
1433
|
+
*/
|
|
1434
|
+
request_id?: string;
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* Server timestamp when the response was generated
|
|
1438
|
+
*/
|
|
1439
|
+
timestamp?: string;
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* API version used for this request
|
|
1443
|
+
*/
|
|
1444
|
+
version?: string;
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
/**
|
|
1449
|
+
* Standard API response envelope for all v3 endpoints
|
|
1450
|
+
*/
|
|
1451
|
+
export interface WebhookTestResponse {
|
|
1452
|
+
/**
|
|
1453
|
+
* The response data (null if error)
|
|
1454
|
+
*/
|
|
1455
|
+
data?: WebhookTestResponse.Data | null;
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* Error information
|
|
1459
|
+
*/
|
|
1460
|
+
error?: WebhookTestResponse.Error | null;
|
|
1461
|
+
|
|
1462
|
+
/**
|
|
1463
|
+
* Request and response metadata
|
|
1464
|
+
*/
|
|
1465
|
+
meta?: WebhookTestResponse.Meta;
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Indicates whether the request was successful
|
|
1469
|
+
*/
|
|
1470
|
+
success?: boolean;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
export namespace WebhookTestResponse {
|
|
1474
|
+
/**
|
|
1475
|
+
* The response data (null if error)
|
|
1476
|
+
*/
|
|
1477
|
+
export interface Data {
|
|
1478
|
+
message?: string;
|
|
1479
|
+
|
|
1480
|
+
success?: boolean;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* Error information
|
|
1485
|
+
*/
|
|
1486
|
+
export interface Error {
|
|
1487
|
+
/**
|
|
1488
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
1489
|
+
*/
|
|
1490
|
+
code?: string;
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* Additional validation error details (field-level errors)
|
|
1494
|
+
*/
|
|
1495
|
+
details?: { [key: string]: Array<string> } | null;
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* URL to documentation about this error
|
|
1499
|
+
*/
|
|
1500
|
+
doc_url?: string | null;
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* Human-readable error message
|
|
1504
|
+
*/
|
|
1505
|
+
message?: string;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* Request and response metadata
|
|
1510
|
+
*/
|
|
1511
|
+
export interface Meta {
|
|
1512
|
+
/**
|
|
1513
|
+
* Unique identifier for this request (for tracing and support)
|
|
1514
|
+
*/
|
|
1515
|
+
request_id?: string;
|
|
1516
|
+
|
|
1517
|
+
/**
|
|
1518
|
+
* Server timestamp when the response was generated
|
|
1519
|
+
*/
|
|
1520
|
+
timestamp?: string;
|
|
1521
|
+
|
|
1522
|
+
/**
|
|
1523
|
+
* API version used for this request
|
|
1524
|
+
*/
|
|
1525
|
+
version?: string;
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
/**
|
|
1530
|
+
* Standard API response envelope for all v3 endpoints
|
|
1531
|
+
*/
|
|
1532
|
+
export interface WebhookToggleStatusResponse {
|
|
1533
|
+
/**
|
|
1534
|
+
* The response data (null if error)
|
|
1535
|
+
*/
|
|
1536
|
+
data?: WebhookToggleStatusResponse.Data | null;
|
|
1537
|
+
|
|
1538
|
+
/**
|
|
1539
|
+
* Error information
|
|
1540
|
+
*/
|
|
1541
|
+
error?: WebhookToggleStatusResponse.Error | null;
|
|
1542
|
+
|
|
1543
|
+
/**
|
|
1544
|
+
* Request and response metadata
|
|
1545
|
+
*/
|
|
1546
|
+
meta?: WebhookToggleStatusResponse.Meta;
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* Indicates whether the request was successful
|
|
1550
|
+
*/
|
|
1551
|
+
success?: boolean;
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
export namespace WebhookToggleStatusResponse {
|
|
1555
|
+
/**
|
|
1556
|
+
* The response data (null if error)
|
|
1557
|
+
*/
|
|
1558
|
+
export interface Data {
|
|
1559
|
+
id?: string;
|
|
1560
|
+
|
|
1561
|
+
consecutive_failures?: number;
|
|
1562
|
+
|
|
1563
|
+
created_at?: string;
|
|
1564
|
+
|
|
1565
|
+
/**
|
|
1566
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
1567
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
1568
|
+
*/
|
|
1569
|
+
customer_id?: string;
|
|
1570
|
+
|
|
1571
|
+
display_name?: string;
|
|
1572
|
+
|
|
1573
|
+
endpoint_url?: string;
|
|
1574
|
+
|
|
1575
|
+
event_filters?: { [key: string]: Array<string> } | null;
|
|
1576
|
+
|
|
1577
|
+
event_types?: Array<string>;
|
|
1578
|
+
|
|
1579
|
+
is_active?: boolean;
|
|
1580
|
+
|
|
1581
|
+
last_delivery_attempt_at?: string | null;
|
|
1582
|
+
|
|
1583
|
+
last_successful_delivery_at?: string | null;
|
|
1584
|
+
|
|
1585
|
+
retry_count?: number;
|
|
1586
|
+
|
|
1587
|
+
signing_secret?: string | null;
|
|
1588
|
+
|
|
1589
|
+
timeout_seconds?: number;
|
|
1590
|
+
|
|
1591
|
+
updated_at?: string | null;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* Error information
|
|
1596
|
+
*/
|
|
1597
|
+
export interface Error {
|
|
1598
|
+
/**
|
|
1599
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
1600
|
+
*/
|
|
1601
|
+
code?: string;
|
|
1602
|
+
|
|
1603
|
+
/**
|
|
1604
|
+
* Additional validation error details (field-level errors)
|
|
1605
|
+
*/
|
|
1606
|
+
details?: { [key: string]: Array<string> } | null;
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* URL to documentation about this error
|
|
1610
|
+
*/
|
|
1611
|
+
doc_url?: string | null;
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* Human-readable error message
|
|
1615
|
+
*/
|
|
1616
|
+
message?: string;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* Request and response metadata
|
|
1621
|
+
*/
|
|
1622
|
+
export interface Meta {
|
|
1623
|
+
/**
|
|
1624
|
+
* Unique identifier for this request (for tracing and support)
|
|
1625
|
+
*/
|
|
1626
|
+
request_id?: string;
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* Server timestamp when the response was generated
|
|
1630
|
+
*/
|
|
1631
|
+
timestamp?: string;
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* API version used for this request
|
|
1635
|
+
*/
|
|
1636
|
+
version?: string;
|
|
911
1637
|
}
|
|
912
1638
|
}
|
|
913
1639
|
|
|
@@ -1170,24 +1896,21 @@ export interface WebhookToggleStatusParams {
|
|
|
1170
1896
|
|
|
1171
1897
|
export declare namespace Webhooks {
|
|
1172
1898
|
export {
|
|
1173
|
-
type APIMeta as APIMeta,
|
|
1174
|
-
type APIResponseWebhook as APIResponseWebhook,
|
|
1175
|
-
type ErrorDetail as ErrorDetail,
|
|
1176
1899
|
type InboundMessageEvent as InboundMessageEvent,
|
|
1177
1900
|
type InboundMessageEventPayload as InboundMessageEventPayload,
|
|
1178
1901
|
type MessageEvent as MessageEvent,
|
|
1179
1902
|
type MessageEventPayload as MessageEventPayload,
|
|
1180
|
-
type MutationRequest as MutationRequest,
|
|
1181
|
-
type PaginationMeta as PaginationMeta,
|
|
1182
1903
|
type TemplateEvent as TemplateEvent,
|
|
1183
1904
|
type TemplateEventPayload as TemplateEventPayload,
|
|
1184
|
-
type
|
|
1185
|
-
type
|
|
1905
|
+
type WebhookCreateResponse as WebhookCreateResponse,
|
|
1906
|
+
type WebhookRetrieveResponse as WebhookRetrieveResponse,
|
|
1907
|
+
type WebhookUpdateResponse as WebhookUpdateResponse,
|
|
1186
1908
|
type WebhookListResponse as WebhookListResponse,
|
|
1187
1909
|
type WebhookListEventTypesResponse as WebhookListEventTypesResponse,
|
|
1188
1910
|
type WebhookListEventsResponse as WebhookListEventsResponse,
|
|
1189
1911
|
type WebhookRotateSecretResponse as WebhookRotateSecretResponse,
|
|
1190
1912
|
type WebhookTestResponse as WebhookTestResponse,
|
|
1913
|
+
type WebhookToggleStatusResponse as WebhookToggleStatusResponse,
|
|
1191
1914
|
type WebhookCreateParams as WebhookCreateParams,
|
|
1192
1915
|
type WebhookRetrieveParams as WebhookRetrieveParams,
|
|
1193
1916
|
type WebhookUpdateParams as WebhookUpdateParams,
|