getricky 0.1.6 → 0.1.7
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/dist/cjs/generated/idempotency.gen.js +2 -0
- package/dist/cjs/generated/index.d.ts +1 -1
- package/dist/cjs/generated/sdk.gen.d.ts +41 -1
- package/dist/cjs/generated/sdk.gen.js +79 -0
- package/dist/cjs/generated/types.gen.d.ts +473 -0
- package/dist/esm/generated/idempotency.gen.js +2 -0
- package/dist/esm/generated/index.d.ts +1 -1
- package/dist/esm/generated/sdk.gen.d.ts +41 -1
- package/dist/esm/generated/sdk.gen.js +79 -0
- package/dist/esm/generated/types.gen.d.ts +473 -0
- package/package.json +1 -1
|
@@ -1470,4 +1470,83 @@ export class RickyApi extends HeyApiClient {
|
|
|
1470
1470
|
...options
|
|
1471
1471
|
});
|
|
1472
1472
|
}
|
|
1473
|
+
/**
|
|
1474
|
+
* List broadcasts
|
|
1475
|
+
*
|
|
1476
|
+
* Newest first, with how many recipients are in each delivery status.
|
|
1477
|
+
*
|
|
1478
|
+
* Scope: `broadcasts:read`.
|
|
1479
|
+
*/
|
|
1480
|
+
listBroadcasts(options) {
|
|
1481
|
+
return (options?.client ?? this.client).get({
|
|
1482
|
+
responseStyle: 'data',
|
|
1483
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1484
|
+
url: '/broadcasts',
|
|
1485
|
+
...options
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Create a broadcast
|
|
1490
|
+
*
|
|
1491
|
+
* Sends an approved WhatsApp template to an audience, now or at `scheduled_at`. Ricky fixes the recipient list now and sends through each number’s conversation, as a template sent from the inbox; variables the template maps to contact fields in Ricky are filled per contact. Answers `201` with the broadcast `queued` or `scheduled`; follow it with `GET /broadcasts/{broadcast_id}`. An audience without any WhatsApp number answers `422 rule_violation`.
|
|
1492
|
+
*
|
|
1493
|
+
* Scope: `broadcasts:write`.
|
|
1494
|
+
*/
|
|
1495
|
+
createBroadcast(options) {
|
|
1496
|
+
return (options.client ?? this.client).post({
|
|
1497
|
+
responseStyle: 'data',
|
|
1498
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1499
|
+
url: '/broadcasts',
|
|
1500
|
+
...options,
|
|
1501
|
+
headers: {
|
|
1502
|
+
'Content-Type': 'application/json',
|
|
1503
|
+
...options.headers
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Get a broadcast
|
|
1509
|
+
*
|
|
1510
|
+
* One broadcast with how many recipients are in each delivery status.
|
|
1511
|
+
*
|
|
1512
|
+
* Scope: `broadcasts:read`.
|
|
1513
|
+
*/
|
|
1514
|
+
getBroadcast(options) {
|
|
1515
|
+
return (options.client ?? this.client).get({
|
|
1516
|
+
responseStyle: 'data',
|
|
1517
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1518
|
+
url: '/broadcasts/{broadcast_id}',
|
|
1519
|
+
...options
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Cancel a scheduled broadcast
|
|
1524
|
+
*
|
|
1525
|
+
* Cancels a `scheduled` broadcast before it starts; nothing is sent. Once it is `queued` or sending, or already canceled, it answers `409 conflict`. Send no body.
|
|
1526
|
+
*
|
|
1527
|
+
* Scope: `broadcasts:write`.
|
|
1528
|
+
*/
|
|
1529
|
+
cancelBroadcast(options) {
|
|
1530
|
+
return (options.client ?? this.client).post({
|
|
1531
|
+
responseStyle: 'data',
|
|
1532
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1533
|
+
url: '/broadcasts/{broadcast_id}/cancel',
|
|
1534
|
+
...options
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* List broadcast recipients
|
|
1539
|
+
*
|
|
1540
|
+
* Each number of the broadcast and where its message stands, in number order. Statuses change as WhatsApp reports them.
|
|
1541
|
+
*
|
|
1542
|
+
* Scope: `broadcasts:read`.
|
|
1543
|
+
*/
|
|
1544
|
+
listBroadcastRecipients(options) {
|
|
1545
|
+
return (options.client ?? this.client).get({
|
|
1546
|
+
responseStyle: 'data',
|
|
1547
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
1548
|
+
url: '/broadcasts/{broadcast_id}/recipients',
|
|
1549
|
+
...options
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1473
1552
|
}
|
|
@@ -562,6 +562,140 @@ export type Template = {
|
|
|
562
562
|
[key: string]: unknown;
|
|
563
563
|
}>;
|
|
564
564
|
};
|
|
565
|
+
/**
|
|
566
|
+
* One approved WhatsApp template sent to many numbers.
|
|
567
|
+
*/
|
|
568
|
+
export type Broadcast = {
|
|
569
|
+
/**
|
|
570
|
+
* Broadcast ID.
|
|
571
|
+
*/
|
|
572
|
+
id: string;
|
|
573
|
+
/**
|
|
574
|
+
* WhatsApp channel it is sent from.
|
|
575
|
+
*/
|
|
576
|
+
channel_id: string;
|
|
577
|
+
/**
|
|
578
|
+
* The approved template every recipient receives.
|
|
579
|
+
*/
|
|
580
|
+
template: {
|
|
581
|
+
/**
|
|
582
|
+
* Template ID at Meta.
|
|
583
|
+
*/
|
|
584
|
+
id: string;
|
|
585
|
+
/**
|
|
586
|
+
* Template name.
|
|
587
|
+
*/
|
|
588
|
+
name: string;
|
|
589
|
+
/**
|
|
590
|
+
* Language code.
|
|
591
|
+
*/
|
|
592
|
+
language: string;
|
|
593
|
+
};
|
|
594
|
+
/**
|
|
595
|
+
* How the recipient list was built: a contact filter, chosen contacts, or phone numbers. The list itself is fixed when the broadcast is created.
|
|
596
|
+
*/
|
|
597
|
+
audience: {
|
|
598
|
+
type: 'filter';
|
|
599
|
+
tag_id: string | null;
|
|
600
|
+
/**
|
|
601
|
+
* Only contacts at this stage; null for any.
|
|
602
|
+
*/
|
|
603
|
+
lifecycle_stage: string | null;
|
|
604
|
+
/**
|
|
605
|
+
* Only contacts whose name, phone, email or company contains it.
|
|
606
|
+
*/
|
|
607
|
+
query: string | null;
|
|
608
|
+
} | {
|
|
609
|
+
type: 'contacts';
|
|
610
|
+
} | {
|
|
611
|
+
type: 'phones';
|
|
612
|
+
};
|
|
613
|
+
/**
|
|
614
|
+
* `scheduled` waits for `scheduled_at`; `queued` and `sending` are on their way; `completed` once every message was handed to WhatsApp; `canceled` before it started.
|
|
615
|
+
*/
|
|
616
|
+
status: 'scheduled' | 'queued' | 'sending' | 'completed' | 'canceled';
|
|
617
|
+
/**
|
|
618
|
+
* Recipients in each delivery status. Each recipient counts once, in its current one.
|
|
619
|
+
*/
|
|
620
|
+
counts: {
|
|
621
|
+
/**
|
|
622
|
+
* Numbers the broadcast goes to.
|
|
623
|
+
*/
|
|
624
|
+
recipients: number;
|
|
625
|
+
/**
|
|
626
|
+
* Not sent yet, or WhatsApp has not answered yet.
|
|
627
|
+
*/
|
|
628
|
+
pending: number;
|
|
629
|
+
/**
|
|
630
|
+
* Accepted by WhatsApp, not yet delivered.
|
|
631
|
+
*/
|
|
632
|
+
sent: number;
|
|
633
|
+
/**
|
|
634
|
+
* Delivered to the phone, not yet read.
|
|
635
|
+
*/
|
|
636
|
+
delivered: number;
|
|
637
|
+
/**
|
|
638
|
+
* Read by the recipient.
|
|
639
|
+
*/
|
|
640
|
+
read: number;
|
|
641
|
+
/**
|
|
642
|
+
* Not delivered; each recipient says why.
|
|
643
|
+
*/
|
|
644
|
+
failed: number;
|
|
645
|
+
};
|
|
646
|
+
/**
|
|
647
|
+
* When it starts sending; null if it was sent at once.
|
|
648
|
+
*/
|
|
649
|
+
scheduled_at: string | null;
|
|
650
|
+
/**
|
|
651
|
+
* When it was canceled; null otherwise.
|
|
652
|
+
*/
|
|
653
|
+
canceled_at: string | null;
|
|
654
|
+
/**
|
|
655
|
+
* When the last message was handed to WhatsApp.
|
|
656
|
+
*/
|
|
657
|
+
completed_at: string | null;
|
|
658
|
+
/**
|
|
659
|
+
* Member who created it, or who created the API key.
|
|
660
|
+
*/
|
|
661
|
+
created_by_user_id: string;
|
|
662
|
+
/**
|
|
663
|
+
* When it was created.
|
|
664
|
+
*/
|
|
665
|
+
created_at: string;
|
|
666
|
+
};
|
|
667
|
+
/**
|
|
668
|
+
* One number of a broadcast and where its message stands.
|
|
669
|
+
*/
|
|
670
|
+
export type BroadcastRecipient = {
|
|
671
|
+
/**
|
|
672
|
+
* Recipient ID.
|
|
673
|
+
*/
|
|
674
|
+
id: string;
|
|
675
|
+
/**
|
|
676
|
+
* Number in E.164.
|
|
677
|
+
*/
|
|
678
|
+
phone: string;
|
|
679
|
+
contact_id: string | null;
|
|
680
|
+
/**
|
|
681
|
+
* `pending` until WhatsApp accepts or refuses the message; then `sent`, `delivered` and `read` as WhatsApp reports them, or `failed`.
|
|
682
|
+
*/
|
|
683
|
+
status: 'pending' | 'sent' | 'delivered' | 'read' | 'failed';
|
|
684
|
+
/**
|
|
685
|
+
* Why it failed; null unless `failed`.
|
|
686
|
+
*/
|
|
687
|
+
failure_reason: string | null;
|
|
688
|
+
conversation_id: string | null;
|
|
689
|
+
message_id: string | null;
|
|
690
|
+
/**
|
|
691
|
+
* When the broadcast handed the message to WhatsApp or recorded why it could not.
|
|
692
|
+
*/
|
|
693
|
+
processed_at: string | null;
|
|
694
|
+
/**
|
|
695
|
+
* When WhatsApp reported the latest status of the message; null before.
|
|
696
|
+
*/
|
|
697
|
+
status_updated_at: string | null;
|
|
698
|
+
};
|
|
565
699
|
/**
|
|
566
700
|
* A webhook subscription.
|
|
567
701
|
*/
|
|
@@ -2896,6 +3030,50 @@ export type RotateWebhookSecret = {
|
|
|
2896
3030
|
*/
|
|
2897
3031
|
expire_previous_after_hours?: number;
|
|
2898
3032
|
};
|
|
3033
|
+
/**
|
|
3034
|
+
* Sends an approved template to many numbers, now or at a set time.
|
|
3035
|
+
*/
|
|
3036
|
+
export type CreateBroadcast = {
|
|
3037
|
+
/**
|
|
3038
|
+
* WhatsApp channel to send from. See `GET /channels`.
|
|
3039
|
+
*/
|
|
3040
|
+
channel_id: string;
|
|
3041
|
+
template: TemplateMessage;
|
|
3042
|
+
/**
|
|
3043
|
+
* Who receives it. `filter` takes every contact matching all the filters you send (no filter: every contact); `contacts` and `phones` take the ones you list. Ricky uses each contact’s phone, or its WhatsApp number, skips contacts without one and sends once per number, up to 5,000.
|
|
3044
|
+
*/
|
|
3045
|
+
audience: {
|
|
3046
|
+
type: 'filter';
|
|
3047
|
+
/**
|
|
3048
|
+
* Only contacts with this tag.
|
|
3049
|
+
*/
|
|
3050
|
+
tag_id?: string;
|
|
3051
|
+
/**
|
|
3052
|
+
* Only contacts at this stage.
|
|
3053
|
+
*/
|
|
3054
|
+
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other';
|
|
3055
|
+
/**
|
|
3056
|
+
* Only contacts whose name, phone, email or company contains it.
|
|
3057
|
+
*/
|
|
3058
|
+
query?: string;
|
|
3059
|
+
} | {
|
|
3060
|
+
type: 'contacts';
|
|
3061
|
+
/**
|
|
3062
|
+
* Contacts of the organization.
|
|
3063
|
+
*/
|
|
3064
|
+
contact_ids: Array<string>;
|
|
3065
|
+
} | {
|
|
3066
|
+
type: 'phones';
|
|
3067
|
+
/**
|
|
3068
|
+
* Numbers with country code, for example `+50760001234`.
|
|
3069
|
+
*/
|
|
3070
|
+
phones: Array<string>;
|
|
3071
|
+
};
|
|
3072
|
+
/**
|
|
3073
|
+
* When to start sending, up to 7 days ahead. Omit it to send now.
|
|
3074
|
+
*/
|
|
3075
|
+
scheduled_at?: string;
|
|
3076
|
+
};
|
|
2899
3077
|
/**
|
|
2900
3078
|
* Adds and removes the same tags on many contacts. Their other tags stay.
|
|
2901
3079
|
*/
|
|
@@ -8757,6 +8935,301 @@ export type GetWhatsAppNumberResponses = {
|
|
|
8757
8935
|
};
|
|
8758
8936
|
};
|
|
8759
8937
|
export type GetWhatsAppNumberResponse = GetWhatsAppNumberResponses[keyof GetWhatsAppNumberResponses];
|
|
8938
|
+
export type ListBroadcastsData = {
|
|
8939
|
+
body?: never;
|
|
8940
|
+
path?: never;
|
|
8941
|
+
query?: {
|
|
8942
|
+
/**
|
|
8943
|
+
* Items per page.
|
|
8944
|
+
*/
|
|
8945
|
+
page_size?: number;
|
|
8946
|
+
/**
|
|
8947
|
+
* `next_cursor` from the previous page. Use it unchanged.
|
|
8948
|
+
*/
|
|
8949
|
+
cursor?: string;
|
|
8950
|
+
};
|
|
8951
|
+
url: '/broadcasts';
|
|
8952
|
+
};
|
|
8953
|
+
export type ListBroadcastsErrors = {
|
|
8954
|
+
/**
|
|
8955
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
8956
|
+
*/
|
|
8957
|
+
400: Error;
|
|
8958
|
+
/**
|
|
8959
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
8960
|
+
*/
|
|
8961
|
+
401: Error;
|
|
8962
|
+
/**
|
|
8963
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
8964
|
+
*/
|
|
8965
|
+
403: Error;
|
|
8966
|
+
/**
|
|
8967
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
8968
|
+
*/
|
|
8969
|
+
429: Error;
|
|
8970
|
+
/**
|
|
8971
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
8972
|
+
*/
|
|
8973
|
+
500: Error;
|
|
8974
|
+
};
|
|
8975
|
+
export type ListBroadcastsError = ListBroadcastsErrors[keyof ListBroadcastsErrors];
|
|
8976
|
+
export type ListBroadcastsResponses = {
|
|
8977
|
+
/**
|
|
8978
|
+
* Success.
|
|
8979
|
+
*/
|
|
8980
|
+
200: {
|
|
8981
|
+
data: Array<Broadcast>;
|
|
8982
|
+
/**
|
|
8983
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
8984
|
+
*/
|
|
8985
|
+
next_cursor: string | null;
|
|
8986
|
+
};
|
|
8987
|
+
};
|
|
8988
|
+
export type ListBroadcastsResponse = ListBroadcastsResponses[keyof ListBroadcastsResponses];
|
|
8989
|
+
export type CreateBroadcastData = {
|
|
8990
|
+
body: CreateBroadcast;
|
|
8991
|
+
headers?: {
|
|
8992
|
+
/**
|
|
8993
|
+
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
8994
|
+
*/
|
|
8995
|
+
'Idempotency-Key'?: string;
|
|
8996
|
+
};
|
|
8997
|
+
path?: never;
|
|
8998
|
+
query?: never;
|
|
8999
|
+
url: '/broadcasts';
|
|
9000
|
+
};
|
|
9001
|
+
export type CreateBroadcastErrors = {
|
|
9002
|
+
/**
|
|
9003
|
+
* `invalid_json`: The body is not valid JSON.
|
|
9004
|
+
*
|
|
9005
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
9006
|
+
*/
|
|
9007
|
+
400: Error;
|
|
9008
|
+
/**
|
|
9009
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
9010
|
+
*/
|
|
9011
|
+
401: Error;
|
|
9012
|
+
/**
|
|
9013
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
9014
|
+
*/
|
|
9015
|
+
403: Error;
|
|
9016
|
+
/**
|
|
9017
|
+
* `not_found`: The resource does not exist in this organization.
|
|
9018
|
+
*/
|
|
9019
|
+
404: Error;
|
|
9020
|
+
/**
|
|
9021
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
9022
|
+
*
|
|
9023
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
9024
|
+
*/
|
|
9025
|
+
409: Error;
|
|
9026
|
+
/**
|
|
9027
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
9028
|
+
*/
|
|
9029
|
+
413: Error;
|
|
9030
|
+
/**
|
|
9031
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
9032
|
+
*/
|
|
9033
|
+
415: Error;
|
|
9034
|
+
/**
|
|
9035
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
9036
|
+
*/
|
|
9037
|
+
422: Error;
|
|
9038
|
+
/**
|
|
9039
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
9040
|
+
*/
|
|
9041
|
+
429: Error;
|
|
9042
|
+
/**
|
|
9043
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
9044
|
+
*/
|
|
9045
|
+
500: Error;
|
|
9046
|
+
/**
|
|
9047
|
+
* `upstream_error`: The messaging provider failed. Retry later.
|
|
9048
|
+
*/
|
|
9049
|
+
502: Error;
|
|
9050
|
+
};
|
|
9051
|
+
export type CreateBroadcastError = CreateBroadcastErrors[keyof CreateBroadcastErrors];
|
|
9052
|
+
export type CreateBroadcastResponses = {
|
|
9053
|
+
/**
|
|
9054
|
+
* Success.
|
|
9055
|
+
*/
|
|
9056
|
+
201: {
|
|
9057
|
+
data: Broadcast;
|
|
9058
|
+
};
|
|
9059
|
+
};
|
|
9060
|
+
export type CreateBroadcastResponse = CreateBroadcastResponses[keyof CreateBroadcastResponses];
|
|
9061
|
+
export type GetBroadcastData = {
|
|
9062
|
+
body?: never;
|
|
9063
|
+
path: {
|
|
9064
|
+
/**
|
|
9065
|
+
* Broadcast ID.
|
|
9066
|
+
*/
|
|
9067
|
+
broadcast_id: string;
|
|
9068
|
+
};
|
|
9069
|
+
query?: never;
|
|
9070
|
+
url: '/broadcasts/{broadcast_id}';
|
|
9071
|
+
};
|
|
9072
|
+
export type GetBroadcastErrors = {
|
|
9073
|
+
/**
|
|
9074
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
9075
|
+
*/
|
|
9076
|
+
400: Error;
|
|
9077
|
+
/**
|
|
9078
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
9079
|
+
*/
|
|
9080
|
+
401: Error;
|
|
9081
|
+
/**
|
|
9082
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
9083
|
+
*/
|
|
9084
|
+
403: Error;
|
|
9085
|
+
/**
|
|
9086
|
+
* `not_found`: The resource does not exist in this organization.
|
|
9087
|
+
*/
|
|
9088
|
+
404: Error;
|
|
9089
|
+
/**
|
|
9090
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
9091
|
+
*/
|
|
9092
|
+
429: Error;
|
|
9093
|
+
/**
|
|
9094
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
9095
|
+
*/
|
|
9096
|
+
500: Error;
|
|
9097
|
+
};
|
|
9098
|
+
export type GetBroadcastError = GetBroadcastErrors[keyof GetBroadcastErrors];
|
|
9099
|
+
export type GetBroadcastResponses = {
|
|
9100
|
+
/**
|
|
9101
|
+
* Success.
|
|
9102
|
+
*/
|
|
9103
|
+
200: {
|
|
9104
|
+
data: Broadcast;
|
|
9105
|
+
};
|
|
9106
|
+
};
|
|
9107
|
+
export type GetBroadcastResponse = GetBroadcastResponses[keyof GetBroadcastResponses];
|
|
9108
|
+
export type CancelBroadcastData = {
|
|
9109
|
+
body?: never;
|
|
9110
|
+
headers?: {
|
|
9111
|
+
/**
|
|
9112
|
+
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
9113
|
+
*/
|
|
9114
|
+
'Idempotency-Key'?: string;
|
|
9115
|
+
};
|
|
9116
|
+
path: {
|
|
9117
|
+
/**
|
|
9118
|
+
* Broadcast ID.
|
|
9119
|
+
*/
|
|
9120
|
+
broadcast_id: string;
|
|
9121
|
+
};
|
|
9122
|
+
query?: never;
|
|
9123
|
+
url: '/broadcasts/{broadcast_id}/cancel';
|
|
9124
|
+
};
|
|
9125
|
+
export type CancelBroadcastErrors = {
|
|
9126
|
+
/**
|
|
9127
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
9128
|
+
*/
|
|
9129
|
+
400: Error;
|
|
9130
|
+
/**
|
|
9131
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
9132
|
+
*/
|
|
9133
|
+
401: Error;
|
|
9134
|
+
/**
|
|
9135
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
9136
|
+
*/
|
|
9137
|
+
403: Error;
|
|
9138
|
+
/**
|
|
9139
|
+
* `not_found`: The resource does not exist in this organization.
|
|
9140
|
+
*/
|
|
9141
|
+
404: Error;
|
|
9142
|
+
/**
|
|
9143
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
9144
|
+
*
|
|
9145
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
9146
|
+
*
|
|
9147
|
+
* `conflict`: The resource changed in a way that prevents the operation.
|
|
9148
|
+
*/
|
|
9149
|
+
409: Error;
|
|
9150
|
+
/**
|
|
9151
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
9152
|
+
*/
|
|
9153
|
+
429: Error;
|
|
9154
|
+
/**
|
|
9155
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
9156
|
+
*/
|
|
9157
|
+
500: Error;
|
|
9158
|
+
};
|
|
9159
|
+
export type CancelBroadcastError = CancelBroadcastErrors[keyof CancelBroadcastErrors];
|
|
9160
|
+
export type CancelBroadcastResponses = {
|
|
9161
|
+
/**
|
|
9162
|
+
* Success.
|
|
9163
|
+
*/
|
|
9164
|
+
200: {
|
|
9165
|
+
data: Broadcast;
|
|
9166
|
+
};
|
|
9167
|
+
};
|
|
9168
|
+
export type CancelBroadcastResponse = CancelBroadcastResponses[keyof CancelBroadcastResponses];
|
|
9169
|
+
export type ListBroadcastRecipientsData = {
|
|
9170
|
+
body?: never;
|
|
9171
|
+
path: {
|
|
9172
|
+
/**
|
|
9173
|
+
* Broadcast ID.
|
|
9174
|
+
*/
|
|
9175
|
+
broadcast_id: string;
|
|
9176
|
+
};
|
|
9177
|
+
query?: {
|
|
9178
|
+
/**
|
|
9179
|
+
* Items per page.
|
|
9180
|
+
*/
|
|
9181
|
+
page_size?: number;
|
|
9182
|
+
/**
|
|
9183
|
+
* `next_cursor` from the previous page. Use it unchanged.
|
|
9184
|
+
*/
|
|
9185
|
+
cursor?: string;
|
|
9186
|
+
/**
|
|
9187
|
+
* Only recipients in this delivery status.
|
|
9188
|
+
*/
|
|
9189
|
+
status?: 'pending' | 'sent' | 'delivered' | 'read' | 'failed';
|
|
9190
|
+
};
|
|
9191
|
+
url: '/broadcasts/{broadcast_id}/recipients';
|
|
9192
|
+
};
|
|
9193
|
+
export type ListBroadcastRecipientsErrors = {
|
|
9194
|
+
/**
|
|
9195
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
9196
|
+
*/
|
|
9197
|
+
400: Error;
|
|
9198
|
+
/**
|
|
9199
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
9200
|
+
*/
|
|
9201
|
+
401: Error;
|
|
9202
|
+
/**
|
|
9203
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
9204
|
+
*/
|
|
9205
|
+
403: Error;
|
|
9206
|
+
/**
|
|
9207
|
+
* `not_found`: The resource does not exist in this organization.
|
|
9208
|
+
*/
|
|
9209
|
+
404: Error;
|
|
9210
|
+
/**
|
|
9211
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
9212
|
+
*/
|
|
9213
|
+
429: Error;
|
|
9214
|
+
/**
|
|
9215
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
9216
|
+
*/
|
|
9217
|
+
500: Error;
|
|
9218
|
+
};
|
|
9219
|
+
export type ListBroadcastRecipientsError = ListBroadcastRecipientsErrors[keyof ListBroadcastRecipientsErrors];
|
|
9220
|
+
export type ListBroadcastRecipientsResponses = {
|
|
9221
|
+
/**
|
|
9222
|
+
* Success.
|
|
9223
|
+
*/
|
|
9224
|
+
200: {
|
|
9225
|
+
data: Array<BroadcastRecipient>;
|
|
9226
|
+
/**
|
|
9227
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
9228
|
+
*/
|
|
9229
|
+
next_cursor: string | null;
|
|
9230
|
+
};
|
|
9231
|
+
};
|
|
9232
|
+
export type ListBroadcastRecipientsResponse = ListBroadcastRecipientsResponses[keyof ListBroadcastRecipientsResponses];
|
|
8760
9233
|
export type WebhookMessageReceivedWebhookPayload = WebhookEvent;
|
|
8761
9234
|
export type WebhookMessageReceivedWebhookRequest = {
|
|
8762
9235
|
body: WebhookMessageReceivedWebhookPayload;
|