getricky 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +138 -2
- package/dist/cjs/client.d.ts +51 -0
- package/dist/cjs/client.js +124 -0
- package/dist/cjs/errors.d.ts +35 -0
- package/dist/cjs/errors.js +55 -0
- package/dist/cjs/generated/client/client.gen.d.ts +2 -0
- package/dist/cjs/generated/client/client.gen.js +220 -0
- package/dist/cjs/generated/client/index.d.ts +10 -0
- package/dist/cjs/generated/client/index.js +17 -0
- package/dist/cjs/generated/client/types.gen.d.ts +120 -0
- package/dist/cjs/generated/client/types.gen.js +3 -0
- package/dist/cjs/generated/client/utils.gen.d.ts +37 -0
- package/dist/cjs/generated/client/utils.gen.js +239 -0
- package/dist/cjs/generated/client.gen.d.ts +12 -0
- package/dist/cjs/generated/client.gen.js +6 -0
- package/dist/cjs/generated/core/auth.gen.d.ts +25 -0
- package/dist/cjs/generated/core/auth.gen.js +18 -0
- package/dist/cjs/generated/core/bodySerializer.gen.d.ts +25 -0
- package/dist/cjs/generated/core/bodySerializer.gen.js +60 -0
- package/dist/cjs/generated/core/params.gen.d.ts +43 -0
- package/dist/cjs/generated/core/params.gen.js +112 -0
- package/dist/cjs/generated/core/pathSerializer.gen.d.ts +33 -0
- package/dist/cjs/generated/core/pathSerializer.gen.js +115 -0
- package/dist/cjs/generated/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/cjs/generated/core/queryKeySerializer.gen.js +98 -0
- package/dist/cjs/generated/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/cjs/generated/core/serverSentEvents.gen.js +135 -0
- package/dist/cjs/generated/core/types.gen.d.ts +83 -0
- package/dist/cjs/generated/core/types.gen.js +3 -0
- package/dist/cjs/generated/core/utils.gen.d.ts +19 -0
- package/dist/cjs/generated/core/utils.gen.js +93 -0
- package/dist/cjs/generated/idempotency.gen.d.ts +2 -0
- package/dist/cjs/generated/idempotency.gen.js +16 -0
- package/dist/cjs/generated/index.d.ts +2 -0
- package/dist/cjs/generated/index.js +6 -0
- package/dist/cjs/generated/sdk.gen.d.ts +259 -0
- package/dist/cjs/generated/sdk.gen.js +493 -0
- package/dist/cjs/generated/types.gen.d.ts +2557 -0
- package/dist/cjs/generated/types.gen.js +3 -0
- package/dist/cjs/index.d.ts +7 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/webhooks.d.ts +25 -0
- package/dist/cjs/webhooks.js +59 -0
- package/dist/esm/client.d.ts +51 -0
- package/dist/esm/client.js +120 -0
- package/dist/esm/errors.d.ts +35 -0
- package/dist/esm/errors.js +49 -0
- package/dist/esm/generated/client/client.gen.d.ts +2 -0
- package/dist/esm/generated/client/client.gen.js +216 -0
- package/dist/esm/generated/client/index.d.ts +10 -0
- package/dist/esm/generated/client/index.js +6 -0
- package/dist/esm/generated/client/types.gen.d.ts +120 -0
- package/dist/esm/generated/client/types.gen.js +2 -0
- package/dist/esm/generated/client/utils.gen.d.ts +37 -0
- package/dist/esm/generated/client/utils.gen.js +228 -0
- package/dist/esm/generated/client.gen.d.ts +12 -0
- package/dist/esm/generated/client.gen.js +3 -0
- package/dist/esm/generated/core/auth.gen.d.ts +25 -0
- package/dist/esm/generated/core/auth.gen.js +14 -0
- package/dist/esm/generated/core/bodySerializer.gen.d.ts +25 -0
- package/dist/esm/generated/core/bodySerializer.gen.js +57 -0
- package/dist/esm/generated/core/params.gen.d.ts +43 -0
- package/dist/esm/generated/core/params.gen.js +109 -0
- package/dist/esm/generated/core/pathSerializer.gen.d.ts +33 -0
- package/dist/esm/generated/core/pathSerializer.gen.js +106 -0
- package/dist/esm/generated/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/esm/generated/core/queryKeySerializer.gen.js +92 -0
- package/dist/esm/generated/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/esm/generated/core/serverSentEvents.gen.js +132 -0
- package/dist/esm/generated/core/types.gen.d.ts +83 -0
- package/dist/esm/generated/core/types.gen.js +2 -0
- package/dist/esm/generated/core/utils.gen.d.ts +19 -0
- package/dist/esm/generated/core/utils.gen.js +87 -0
- package/dist/esm/generated/idempotency.gen.d.ts +2 -0
- package/dist/esm/generated/idempotency.gen.js +13 -0
- package/dist/esm/generated/index.d.ts +2 -0
- package/dist/esm/generated/index.js +2 -0
- package/dist/esm/generated/sdk.gen.d.ts +259 -0
- package/dist/esm/generated/sdk.gen.js +489 -0
- package/dist/esm/generated/types.gen.d.ts +2557 -0
- package/dist/esm/generated/types.gen.js +2 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/webhooks.d.ts +25 -0
- package/dist/esm/webhooks.js +56 -0
- package/package.json +64 -4
|
@@ -0,0 +1,2557 @@
|
|
|
1
|
+
export type ClientOptions = {
|
|
2
|
+
baseUrl: 'https://getricky.ai/api/v1' | (string & {});
|
|
3
|
+
};
|
|
4
|
+
export type Webhooks = WebhookMessageReceivedWebhookRequest | WebhookMessageSentWebhookRequest | WebhookMessageDeliveredWebhookRequest | WebhookMessageReadWebhookRequest | WebhookMessageFailedWebhookRequest | WebhookConversationOpenedWebhookRequest | WebhookConversationClosedWebhookRequest | WebhookConversationAssignmentChangedWebhookRequest | WebhookContactCreatedWebhookRequest | WebhookContactUpdatedWebhookRequest | WebhookWebhookTestWebhookRequest;
|
|
5
|
+
/**
|
|
6
|
+
* Every non-2xx response.
|
|
7
|
+
*/
|
|
8
|
+
export type Error = {
|
|
9
|
+
error: {
|
|
10
|
+
/**
|
|
11
|
+
* Stable, machine-readable error code.
|
|
12
|
+
*/
|
|
13
|
+
code: 'invalid_input' | 'invalid_json' | 'unauthorized' | 'insufficient_scope' | 'forbidden' | 'not_found' | 'conflict' | 'idempotency_conflict' | 'request_processing' | 'body_too_large' | 'unsupported_media_type' | 'outside_messaging_window' | 'rule_violation' | 'rate_limited' | 'internal_error' | 'upstream_error' | 'unavailable';
|
|
14
|
+
/**
|
|
15
|
+
* Human-readable explanation. Do not parse it.
|
|
16
|
+
*/
|
|
17
|
+
message: string;
|
|
18
|
+
/**
|
|
19
|
+
* The request field or parameter that caused it.
|
|
20
|
+
*/
|
|
21
|
+
param?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Quote it to support. Also in the `X-Request-Id` header.
|
|
24
|
+
*/
|
|
25
|
+
request_id: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A label applied to contacts.
|
|
30
|
+
*/
|
|
31
|
+
export type Tag = {
|
|
32
|
+
/**
|
|
33
|
+
* Tag ID.
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
/**
|
|
37
|
+
* Display name.
|
|
38
|
+
*/
|
|
39
|
+
name: string;
|
|
40
|
+
/**
|
|
41
|
+
* Display color.
|
|
42
|
+
*/
|
|
43
|
+
color: 'gray' | 'red' | 'orange' | 'amber' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'pink';
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* How a contact is reached on one channel.
|
|
47
|
+
*/
|
|
48
|
+
export type ContactIdentity = {
|
|
49
|
+
/**
|
|
50
|
+
* Identity ID.
|
|
51
|
+
*/
|
|
52
|
+
id: string;
|
|
53
|
+
/**
|
|
54
|
+
* Channel this identity belongs to.
|
|
55
|
+
*/
|
|
56
|
+
channel_type: 'whatsapp' | 'instagram' | 'messenger';
|
|
57
|
+
/**
|
|
58
|
+
* Address on that channel: phone digits for WhatsApp, account ID otherwise.
|
|
59
|
+
*/
|
|
60
|
+
external_id: string;
|
|
61
|
+
/**
|
|
62
|
+
* Name the channel reports.
|
|
63
|
+
*/
|
|
64
|
+
display_name: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* Handle on the channel, when it has one.
|
|
67
|
+
*/
|
|
68
|
+
username: string | null;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* A person in the CRM.
|
|
72
|
+
*/
|
|
73
|
+
export type Contact = {
|
|
74
|
+
/**
|
|
75
|
+
* Contact ID.
|
|
76
|
+
*/
|
|
77
|
+
id: string;
|
|
78
|
+
/**
|
|
79
|
+
* First name.
|
|
80
|
+
*/
|
|
81
|
+
first_name: string | null;
|
|
82
|
+
/**
|
|
83
|
+
* Last name.
|
|
84
|
+
*/
|
|
85
|
+
last_name: string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Email, lowercased.
|
|
88
|
+
*/
|
|
89
|
+
primary_email: string | null;
|
|
90
|
+
/**
|
|
91
|
+
* Phone in E.164.
|
|
92
|
+
*/
|
|
93
|
+
primary_phone: string | null;
|
|
94
|
+
/**
|
|
95
|
+
* Company.
|
|
96
|
+
*/
|
|
97
|
+
company: string | null;
|
|
98
|
+
/**
|
|
99
|
+
* Job title.
|
|
100
|
+
*/
|
|
101
|
+
job_title: string | null;
|
|
102
|
+
/**
|
|
103
|
+
* Birthday as `YYYY-MM-DD`.
|
|
104
|
+
*/
|
|
105
|
+
birthday: string | null;
|
|
106
|
+
/**
|
|
107
|
+
* City.
|
|
108
|
+
*/
|
|
109
|
+
city: string | null;
|
|
110
|
+
/**
|
|
111
|
+
* State, province or region.
|
|
112
|
+
*/
|
|
113
|
+
region: string | null;
|
|
114
|
+
/**
|
|
115
|
+
* Country.
|
|
116
|
+
*/
|
|
117
|
+
country: string | null;
|
|
118
|
+
/**
|
|
119
|
+
* Street address.
|
|
120
|
+
*/
|
|
121
|
+
street_address: string | null;
|
|
122
|
+
/**
|
|
123
|
+
* Postal code.
|
|
124
|
+
*/
|
|
125
|
+
postal_code: string | null;
|
|
126
|
+
/**
|
|
127
|
+
* Website URL.
|
|
128
|
+
*/
|
|
129
|
+
website_url: string | null;
|
|
130
|
+
/**
|
|
131
|
+
* LinkedIn profile URL.
|
|
132
|
+
*/
|
|
133
|
+
linkedin_url: string | null;
|
|
134
|
+
/**
|
|
135
|
+
* Where the contact came from.
|
|
136
|
+
*/
|
|
137
|
+
source: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* Free-form notes.
|
|
140
|
+
*/
|
|
141
|
+
notes: string | null;
|
|
142
|
+
owner_user_id: string | null;
|
|
143
|
+
/**
|
|
144
|
+
* Sales lead status.
|
|
145
|
+
*/
|
|
146
|
+
lead_status: 'new' | 'open' | 'in_progress' | 'attempted' | 'connected' | 'unqualified' | 'bad_timing' | null;
|
|
147
|
+
/**
|
|
148
|
+
* Lifecycle stage.
|
|
149
|
+
*/
|
|
150
|
+
lifecycle_stage: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other' | null;
|
|
151
|
+
/**
|
|
152
|
+
* Custom field values keyed by contact field ID. See `GET /contact-fields`.
|
|
153
|
+
*/
|
|
154
|
+
custom_values: {
|
|
155
|
+
[key: string]: string | number | boolean | Array<string> | null;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Channel identities.
|
|
159
|
+
*/
|
|
160
|
+
identities: Array<ContactIdentity>;
|
|
161
|
+
/**
|
|
162
|
+
* Tags applied to the contact.
|
|
163
|
+
*/
|
|
164
|
+
tags: Array<Tag>;
|
|
165
|
+
/**
|
|
166
|
+
* Latest message in any of its conversations.
|
|
167
|
+
*/
|
|
168
|
+
last_activity_at: string | null;
|
|
169
|
+
/**
|
|
170
|
+
* Text of that latest message.
|
|
171
|
+
*/
|
|
172
|
+
last_activity_preview: string | null;
|
|
173
|
+
last_conversation_id: string | null;
|
|
174
|
+
/**
|
|
175
|
+
* Last change to the contact.
|
|
176
|
+
*/
|
|
177
|
+
updated_at: string;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* A custom contact field defined by the organization.
|
|
181
|
+
*/
|
|
182
|
+
export type ContactField = {
|
|
183
|
+
/**
|
|
184
|
+
* Field ID; the key in `custom_values`.
|
|
185
|
+
*/
|
|
186
|
+
id: string;
|
|
187
|
+
/**
|
|
188
|
+
* Display name.
|
|
189
|
+
*/
|
|
190
|
+
name: string;
|
|
191
|
+
/**
|
|
192
|
+
* Value type: `number` takes a number, `boolean` a boolean, `date` `YYYY-MM-DD`, `select` one option, `multi_select` an array of options, the rest a string.
|
|
193
|
+
*/
|
|
194
|
+
type: 'text' | 'long_text' | 'number' | 'boolean' | 'date' | 'select' | 'multi_select';
|
|
195
|
+
/**
|
|
196
|
+
* Allowed values for `select` and `multi_select`.
|
|
197
|
+
*/
|
|
198
|
+
options: Array<string>;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* A connected messaging channel.
|
|
202
|
+
*/
|
|
203
|
+
export type Channel = {
|
|
204
|
+
/**
|
|
205
|
+
* Channel ID.
|
|
206
|
+
*/
|
|
207
|
+
id: string;
|
|
208
|
+
/**
|
|
209
|
+
* Messaging channel.
|
|
210
|
+
*/
|
|
211
|
+
type: 'whatsapp' | 'instagram' | 'messenger';
|
|
212
|
+
/**
|
|
213
|
+
* Name shown in Ricky.
|
|
214
|
+
*/
|
|
215
|
+
name: string;
|
|
216
|
+
/**
|
|
217
|
+
* Phone in E.164 for WhatsApp, account or page name otherwise.
|
|
218
|
+
*/
|
|
219
|
+
address: string | null;
|
|
220
|
+
/**
|
|
221
|
+
* WhatsApp Business Account that owns the number; templates must belong to it.
|
|
222
|
+
*/
|
|
223
|
+
whatsapp_business_account_id: string | null;
|
|
224
|
+
/**
|
|
225
|
+
* When it was connected.
|
|
226
|
+
*/
|
|
227
|
+
connected_at: string | null;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* One contact talking to the organization on one channel.
|
|
231
|
+
*/
|
|
232
|
+
export type Conversation = {
|
|
233
|
+
/**
|
|
234
|
+
* Conversation ID.
|
|
235
|
+
*/
|
|
236
|
+
id: string;
|
|
237
|
+
channel: {
|
|
238
|
+
/**
|
|
239
|
+
* Channel ID.
|
|
240
|
+
*/
|
|
241
|
+
id: string;
|
|
242
|
+
type: 'whatsapp' | 'instagram' | 'messenger';
|
|
243
|
+
};
|
|
244
|
+
contact: {
|
|
245
|
+
id: string | null;
|
|
246
|
+
/**
|
|
247
|
+
* Name on the channel.
|
|
248
|
+
*/
|
|
249
|
+
display_name: string | null;
|
|
250
|
+
/**
|
|
251
|
+
* Address on the channel.
|
|
252
|
+
*/
|
|
253
|
+
external_id: string;
|
|
254
|
+
/**
|
|
255
|
+
* Handle, when the channel has one.
|
|
256
|
+
*/
|
|
257
|
+
username: string | null;
|
|
258
|
+
} | null;
|
|
259
|
+
status: 'open' | 'closed';
|
|
260
|
+
/**
|
|
261
|
+
* Why it was closed; null while open or when closed without one.
|
|
262
|
+
*/
|
|
263
|
+
close_category: 'resolved' | 'sale' | 'no_response' | 'spam' | 'other' | null;
|
|
264
|
+
assigned_user_id: string | null;
|
|
265
|
+
agent_id: string | null;
|
|
266
|
+
/**
|
|
267
|
+
* When it was created.
|
|
268
|
+
*/
|
|
269
|
+
created_at: string;
|
|
270
|
+
/**
|
|
271
|
+
* Start of the current open span.
|
|
272
|
+
*/
|
|
273
|
+
opened_at: string;
|
|
274
|
+
/**
|
|
275
|
+
* When it was closed; null while open.
|
|
276
|
+
*/
|
|
277
|
+
closed_at: string | null;
|
|
278
|
+
/**
|
|
279
|
+
* Latest message.
|
|
280
|
+
*/
|
|
281
|
+
last_activity_at: string | null;
|
|
282
|
+
/**
|
|
283
|
+
* Text of the latest message.
|
|
284
|
+
*/
|
|
285
|
+
last_activity_preview: string | null;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* One message in a conversation.
|
|
289
|
+
*/
|
|
290
|
+
export type Message = {
|
|
291
|
+
/**
|
|
292
|
+
* Message ID.
|
|
293
|
+
*/
|
|
294
|
+
id: string;
|
|
295
|
+
/**
|
|
296
|
+
* Conversation ID.
|
|
297
|
+
*/
|
|
298
|
+
conversation_id: string;
|
|
299
|
+
direction: 'inbound' | 'outbound';
|
|
300
|
+
/**
|
|
301
|
+
* Message type: `text`, `image`, `audio`, `video`, `document`, `template`, …
|
|
302
|
+
*/
|
|
303
|
+
type: string;
|
|
304
|
+
/**
|
|
305
|
+
* Text, caption or rendered template body.
|
|
306
|
+
*/
|
|
307
|
+
text: string | null;
|
|
308
|
+
sender: {
|
|
309
|
+
/**
|
|
310
|
+
* `contact`; a `member` in Ricky; an AI `agent`; an `automation`; or `channel_app`, sent from the channel's own app outside Ricky.
|
|
311
|
+
*/
|
|
312
|
+
type: 'contact' | 'member' | 'agent' | 'automation' | 'channel_app';
|
|
313
|
+
/**
|
|
314
|
+
* Member, agent or workflow name; null for the contact and `channel_app`.
|
|
315
|
+
*/
|
|
316
|
+
name: string | null;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* Provider delivery status: `sent`, `delivered`, `read`, `failed`, …
|
|
320
|
+
*/
|
|
321
|
+
status: string;
|
|
322
|
+
media: {
|
|
323
|
+
/**
|
|
324
|
+
* `image`, `audio`, `video`, `document` or `sticker`.
|
|
325
|
+
*/
|
|
326
|
+
kind: string;
|
|
327
|
+
/**
|
|
328
|
+
* MIME type.
|
|
329
|
+
*/
|
|
330
|
+
mime_type: string | null;
|
|
331
|
+
/**
|
|
332
|
+
* File name, for documents.
|
|
333
|
+
*/
|
|
334
|
+
filename: string | null;
|
|
335
|
+
byte_size: number | null;
|
|
336
|
+
/**
|
|
337
|
+
* Transcript of a voice note.
|
|
338
|
+
*/
|
|
339
|
+
transcript: string | null;
|
|
340
|
+
/**
|
|
341
|
+
* Signed download URL, valid for one hour; null until downloaded.
|
|
342
|
+
*/
|
|
343
|
+
url: string | null;
|
|
344
|
+
} | null;
|
|
345
|
+
/**
|
|
346
|
+
* Message ID at the provider.
|
|
347
|
+
*/
|
|
348
|
+
provider_message_id: string | null;
|
|
349
|
+
/**
|
|
350
|
+
* When Ricky recorded it.
|
|
351
|
+
*/
|
|
352
|
+
created_at: string;
|
|
353
|
+
/**
|
|
354
|
+
* When the provider accepted it.
|
|
355
|
+
*/
|
|
356
|
+
sent_at: string | null;
|
|
357
|
+
/**
|
|
358
|
+
* When it reached the device.
|
|
359
|
+
*/
|
|
360
|
+
delivered_at: string | null;
|
|
361
|
+
/**
|
|
362
|
+
* When the recipient read it.
|
|
363
|
+
*/
|
|
364
|
+
read_at: string | null;
|
|
365
|
+
/**
|
|
366
|
+
* When delivery failed.
|
|
367
|
+
*/
|
|
368
|
+
failed_at: string | null;
|
|
369
|
+
/**
|
|
370
|
+
* When the sender edited it.
|
|
371
|
+
*/
|
|
372
|
+
edited_at: string | null;
|
|
373
|
+
/**
|
|
374
|
+
* When the sender deleted it.
|
|
375
|
+
*/
|
|
376
|
+
deleted_at: string | null;
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* An outbound message Ricky accepted and is delivering.
|
|
380
|
+
*/
|
|
381
|
+
export type Send = {
|
|
382
|
+
/**
|
|
383
|
+
* Send ID. Poll `GET /sends/{send_id}` with it.
|
|
384
|
+
*/
|
|
385
|
+
id: string;
|
|
386
|
+
/**
|
|
387
|
+
* Conversation the message goes to.
|
|
388
|
+
*/
|
|
389
|
+
conversation_id: string;
|
|
390
|
+
/**
|
|
391
|
+
* `sent` once the provider accepted the message; `failed` for good, with the reason; `queued` otherwise, while Ricky retries.
|
|
392
|
+
*/
|
|
393
|
+
status: 'queued' | 'sent' | 'failed';
|
|
394
|
+
message_id: string | null;
|
|
395
|
+
/**
|
|
396
|
+
* Why it failed; null unless `failed`.
|
|
397
|
+
*/
|
|
398
|
+
failure_reason: string | null;
|
|
399
|
+
/**
|
|
400
|
+
* When Ricky accepted it.
|
|
401
|
+
*/
|
|
402
|
+
created_at: string;
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* A person in the organization.
|
|
406
|
+
*/
|
|
407
|
+
export type Member = {
|
|
408
|
+
/**
|
|
409
|
+
* User ID.
|
|
410
|
+
*/
|
|
411
|
+
id: string;
|
|
412
|
+
/**
|
|
413
|
+
* Full name.
|
|
414
|
+
*/
|
|
415
|
+
name: string | null;
|
|
416
|
+
/**
|
|
417
|
+
* Email.
|
|
418
|
+
*/
|
|
419
|
+
email: string;
|
|
420
|
+
role: 'owner' | 'admin' | 'member';
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* A WhatsApp message template.
|
|
424
|
+
*/
|
|
425
|
+
export type Template = {
|
|
426
|
+
/**
|
|
427
|
+
* Template ID at Meta.
|
|
428
|
+
*/
|
|
429
|
+
id: string;
|
|
430
|
+
/**
|
|
431
|
+
* Template name.
|
|
432
|
+
*/
|
|
433
|
+
name: string;
|
|
434
|
+
/**
|
|
435
|
+
* Language code, for example `es` or `en_US`.
|
|
436
|
+
*/
|
|
437
|
+
language: string;
|
|
438
|
+
/**
|
|
439
|
+
* `MARKETING`, `UTILITY` or `AUTHENTICATION`.
|
|
440
|
+
*/
|
|
441
|
+
category: string;
|
|
442
|
+
/**
|
|
443
|
+
* Meta review status. Only `APPROVED` templates can be sent.
|
|
444
|
+
*/
|
|
445
|
+
status: string;
|
|
446
|
+
/**
|
|
447
|
+
* Account that owns it.
|
|
448
|
+
*/
|
|
449
|
+
whatsapp_business_account_id: string;
|
|
450
|
+
/**
|
|
451
|
+
* How variables are named: `{{1}}` or `{{name}}`.
|
|
452
|
+
*/
|
|
453
|
+
parameter_format: 'POSITIONAL' | 'NAMED' | null;
|
|
454
|
+
/**
|
|
455
|
+
* Header, body, footer and buttons, in the WhatsApp Cloud API format.
|
|
456
|
+
*/
|
|
457
|
+
components: Array<{
|
|
458
|
+
[key: string]: unknown;
|
|
459
|
+
}>;
|
|
460
|
+
};
|
|
461
|
+
/**
|
|
462
|
+
* A webhook subscription.
|
|
463
|
+
*/
|
|
464
|
+
export type Webhook = {
|
|
465
|
+
/**
|
|
466
|
+
* Webhook ID.
|
|
467
|
+
*/
|
|
468
|
+
id: string;
|
|
469
|
+
/**
|
|
470
|
+
* HTTPS endpoint Ricky posts to.
|
|
471
|
+
*/
|
|
472
|
+
url: string;
|
|
473
|
+
event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated'>;
|
|
474
|
+
status: 'active' | 'disabled';
|
|
475
|
+
/**
|
|
476
|
+
* When it was created.
|
|
477
|
+
*/
|
|
478
|
+
created_at: string;
|
|
479
|
+
/**
|
|
480
|
+
* When it was disabled.
|
|
481
|
+
*/
|
|
482
|
+
disabled_at: string | null;
|
|
483
|
+
};
|
|
484
|
+
/**
|
|
485
|
+
* A new webhook subscription with its signing secret.
|
|
486
|
+
*/
|
|
487
|
+
export type CreatedWebhook = {
|
|
488
|
+
/**
|
|
489
|
+
* Webhook ID.
|
|
490
|
+
*/
|
|
491
|
+
id: string;
|
|
492
|
+
/**
|
|
493
|
+
* HTTPS endpoint Ricky posts to.
|
|
494
|
+
*/
|
|
495
|
+
url: string;
|
|
496
|
+
event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated'>;
|
|
497
|
+
status: 'active' | 'disabled';
|
|
498
|
+
/**
|
|
499
|
+
* When it was created.
|
|
500
|
+
*/
|
|
501
|
+
created_at: string;
|
|
502
|
+
/**
|
|
503
|
+
* When it was disabled.
|
|
504
|
+
*/
|
|
505
|
+
disabled_at: string | null;
|
|
506
|
+
/**
|
|
507
|
+
* HMAC key for `X-Ricky-Signature`. Returned only here, once.
|
|
508
|
+
*/
|
|
509
|
+
signing_secret: string;
|
|
510
|
+
};
|
|
511
|
+
/**
|
|
512
|
+
* One webhook delivery.
|
|
513
|
+
*/
|
|
514
|
+
export type WebhookDelivery = {
|
|
515
|
+
/**
|
|
516
|
+
* Delivery ID; equals the event `id` and `X-Ricky-Delivery-Id`.
|
|
517
|
+
*/
|
|
518
|
+
id: string;
|
|
519
|
+
event_type: 'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated';
|
|
520
|
+
status: 'pending' | 'processing' | 'delivered' | 'failed';
|
|
521
|
+
/**
|
|
522
|
+
* Delivery attempts so far; Ricky makes at most ten.
|
|
523
|
+
*/
|
|
524
|
+
attempts: number;
|
|
525
|
+
/**
|
|
526
|
+
* HTTP status of the last attempt.
|
|
527
|
+
*/
|
|
528
|
+
last_response_status: number | null;
|
|
529
|
+
/**
|
|
530
|
+
* Why the last attempt failed.
|
|
531
|
+
*/
|
|
532
|
+
last_error: string | null;
|
|
533
|
+
/**
|
|
534
|
+
* When the event happened.
|
|
535
|
+
*/
|
|
536
|
+
created_at: string;
|
|
537
|
+
/**
|
|
538
|
+
* When Ricky tries next, while pending.
|
|
539
|
+
*/
|
|
540
|
+
next_attempt_at: string;
|
|
541
|
+
/**
|
|
542
|
+
* When the endpoint answered 2xx.
|
|
543
|
+
*/
|
|
544
|
+
delivered_at: string | null;
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* The JSON body Ricky posts to a webhook endpoint.
|
|
548
|
+
*/
|
|
549
|
+
export type WebhookEvent = {
|
|
550
|
+
/**
|
|
551
|
+
* Delivery ID. Deduplicate by it.
|
|
552
|
+
*/
|
|
553
|
+
id: string;
|
|
554
|
+
type: 'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated' | 'webhook.test';
|
|
555
|
+
/**
|
|
556
|
+
* When it happened.
|
|
557
|
+
*/
|
|
558
|
+
occurred_at: string;
|
|
559
|
+
/**
|
|
560
|
+
* Organization.
|
|
561
|
+
*/
|
|
562
|
+
organization_id: string;
|
|
563
|
+
data: {
|
|
564
|
+
/**
|
|
565
|
+
* Conversation, for `message.*` and `conversation.*` events.
|
|
566
|
+
*/
|
|
567
|
+
conversation_id?: string;
|
|
568
|
+
/**
|
|
569
|
+
* Message, for `message.*` events.
|
|
570
|
+
*/
|
|
571
|
+
message_id?: string;
|
|
572
|
+
/**
|
|
573
|
+
* Contact, for `contact.*` events.
|
|
574
|
+
*/
|
|
575
|
+
contact_id?: string;
|
|
576
|
+
/**
|
|
577
|
+
* Webhook, for `webhook.test`.
|
|
578
|
+
*/
|
|
579
|
+
webhook_id?: string;
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
/**
|
|
583
|
+
* What the endpoint answered to a `webhook.test` event.
|
|
584
|
+
*/
|
|
585
|
+
export type WebhookTestResult = {
|
|
586
|
+
/**
|
|
587
|
+
* True when the endpoint answered 2xx.
|
|
588
|
+
*/
|
|
589
|
+
delivered: boolean;
|
|
590
|
+
/**
|
|
591
|
+
* HTTP status the endpoint answered; null if none.
|
|
592
|
+
*/
|
|
593
|
+
response_status: number | null;
|
|
594
|
+
/**
|
|
595
|
+
* Why it failed: the HTTP status, a timeout or a refused destination.
|
|
596
|
+
*/
|
|
597
|
+
error: string | null;
|
|
598
|
+
/**
|
|
599
|
+
* Time until the endpoint answered.
|
|
600
|
+
*/
|
|
601
|
+
duration_ms: number;
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* A contact needs at least a name, a phone or an email.
|
|
605
|
+
*/
|
|
606
|
+
export type CreateContact = {
|
|
607
|
+
/**
|
|
608
|
+
* First name.
|
|
609
|
+
*/
|
|
610
|
+
first_name?: string | null;
|
|
611
|
+
/**
|
|
612
|
+
* Last name.
|
|
613
|
+
*/
|
|
614
|
+
last_name?: string | null;
|
|
615
|
+
/**
|
|
616
|
+
* Email.
|
|
617
|
+
*/
|
|
618
|
+
primary_email?: string | null;
|
|
619
|
+
/**
|
|
620
|
+
* Phone with country code, for example `+507 6000-1234`.
|
|
621
|
+
*/
|
|
622
|
+
primary_phone?: string | null;
|
|
623
|
+
/**
|
|
624
|
+
* Company.
|
|
625
|
+
*/
|
|
626
|
+
company?: string | null;
|
|
627
|
+
/**
|
|
628
|
+
* Job title.
|
|
629
|
+
*/
|
|
630
|
+
job_title?: string | null;
|
|
631
|
+
/**
|
|
632
|
+
* Birthday as `YYYY-MM-DD`.
|
|
633
|
+
*/
|
|
634
|
+
birthday?: string | null;
|
|
635
|
+
/**
|
|
636
|
+
* City.
|
|
637
|
+
*/
|
|
638
|
+
city?: string | null;
|
|
639
|
+
/**
|
|
640
|
+
* State, province or region.
|
|
641
|
+
*/
|
|
642
|
+
region?: string | null;
|
|
643
|
+
/**
|
|
644
|
+
* Country.
|
|
645
|
+
*/
|
|
646
|
+
country?: string | null;
|
|
647
|
+
/**
|
|
648
|
+
* Street address.
|
|
649
|
+
*/
|
|
650
|
+
street_address?: string | null;
|
|
651
|
+
/**
|
|
652
|
+
* Postal code.
|
|
653
|
+
*/
|
|
654
|
+
postal_code?: string | null;
|
|
655
|
+
/**
|
|
656
|
+
* Website URL.
|
|
657
|
+
*/
|
|
658
|
+
website_url?: string | null;
|
|
659
|
+
/**
|
|
660
|
+
* LinkedIn profile URL.
|
|
661
|
+
*/
|
|
662
|
+
linkedin_url?: string | null;
|
|
663
|
+
/**
|
|
664
|
+
* Where the contact came from.
|
|
665
|
+
*/
|
|
666
|
+
source?: string | null;
|
|
667
|
+
/**
|
|
668
|
+
* Free-form notes.
|
|
669
|
+
*/
|
|
670
|
+
notes?: string | null;
|
|
671
|
+
/**
|
|
672
|
+
* Member who owns the contact.
|
|
673
|
+
*/
|
|
674
|
+
owner_user_id?: string | null;
|
|
675
|
+
lead_status?: 'new' | 'open' | 'in_progress' | 'attempted' | 'connected' | 'unqualified' | 'bad_timing' | null;
|
|
676
|
+
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other' | null;
|
|
677
|
+
/**
|
|
678
|
+
* Values keyed by contact field ID. Keys you omit keep their value.
|
|
679
|
+
*/
|
|
680
|
+
custom_values?: {
|
|
681
|
+
[key: string]: string | number | boolean | Array<string> | null;
|
|
682
|
+
};
|
|
683
|
+
/**
|
|
684
|
+
* The complete set of tag IDs. Replaces the current tags.
|
|
685
|
+
*/
|
|
686
|
+
tag_ids?: Array<string>;
|
|
687
|
+
};
|
|
688
|
+
/**
|
|
689
|
+
* Only the fields you send change. Send `null` to clear one.
|
|
690
|
+
*/
|
|
691
|
+
export type UpdateContact = {
|
|
692
|
+
/**
|
|
693
|
+
* First name.
|
|
694
|
+
*/
|
|
695
|
+
first_name?: string | null;
|
|
696
|
+
/**
|
|
697
|
+
* Last name.
|
|
698
|
+
*/
|
|
699
|
+
last_name?: string | null;
|
|
700
|
+
/**
|
|
701
|
+
* Email.
|
|
702
|
+
*/
|
|
703
|
+
primary_email?: string | null;
|
|
704
|
+
/**
|
|
705
|
+
* Phone with country code, for example `+507 6000-1234`.
|
|
706
|
+
*/
|
|
707
|
+
primary_phone?: string | null;
|
|
708
|
+
/**
|
|
709
|
+
* Company.
|
|
710
|
+
*/
|
|
711
|
+
company?: string | null;
|
|
712
|
+
/**
|
|
713
|
+
* Job title.
|
|
714
|
+
*/
|
|
715
|
+
job_title?: string | null;
|
|
716
|
+
/**
|
|
717
|
+
* Birthday as `YYYY-MM-DD`.
|
|
718
|
+
*/
|
|
719
|
+
birthday?: string | null;
|
|
720
|
+
/**
|
|
721
|
+
* City.
|
|
722
|
+
*/
|
|
723
|
+
city?: string | null;
|
|
724
|
+
/**
|
|
725
|
+
* State, province or region.
|
|
726
|
+
*/
|
|
727
|
+
region?: string | null;
|
|
728
|
+
/**
|
|
729
|
+
* Country.
|
|
730
|
+
*/
|
|
731
|
+
country?: string | null;
|
|
732
|
+
/**
|
|
733
|
+
* Street address.
|
|
734
|
+
*/
|
|
735
|
+
street_address?: string | null;
|
|
736
|
+
/**
|
|
737
|
+
* Postal code.
|
|
738
|
+
*/
|
|
739
|
+
postal_code?: string | null;
|
|
740
|
+
/**
|
|
741
|
+
* Website URL.
|
|
742
|
+
*/
|
|
743
|
+
website_url?: string | null;
|
|
744
|
+
/**
|
|
745
|
+
* LinkedIn profile URL.
|
|
746
|
+
*/
|
|
747
|
+
linkedin_url?: string | null;
|
|
748
|
+
/**
|
|
749
|
+
* Where the contact came from.
|
|
750
|
+
*/
|
|
751
|
+
source?: string | null;
|
|
752
|
+
/**
|
|
753
|
+
* Free-form notes.
|
|
754
|
+
*/
|
|
755
|
+
notes?: string | null;
|
|
756
|
+
/**
|
|
757
|
+
* Member who owns the contact.
|
|
758
|
+
*/
|
|
759
|
+
owner_user_id?: string | null;
|
|
760
|
+
lead_status?: 'new' | 'open' | 'in_progress' | 'attempted' | 'connected' | 'unqualified' | 'bad_timing' | null;
|
|
761
|
+
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other' | null;
|
|
762
|
+
/**
|
|
763
|
+
* Values keyed by contact field ID. Keys you omit keep their value.
|
|
764
|
+
*/
|
|
765
|
+
custom_values?: {
|
|
766
|
+
[key: string]: string | number | boolean | Array<string> | null;
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* The complete set of tag IDs. Replaces the current tags.
|
|
770
|
+
*/
|
|
771
|
+
tag_ids?: Array<string>;
|
|
772
|
+
};
|
|
773
|
+
/**
|
|
774
|
+
* An approved WhatsApp template and the values of its variables.
|
|
775
|
+
*/
|
|
776
|
+
export type TemplateMessage = {
|
|
777
|
+
/**
|
|
778
|
+
* Approved template ID from `GET /templates`.
|
|
779
|
+
*/
|
|
780
|
+
id: string;
|
|
781
|
+
/**
|
|
782
|
+
* Variable values, in the WhatsApp Cloud API format.
|
|
783
|
+
*/
|
|
784
|
+
components?: Array<{
|
|
785
|
+
type: 'header' | 'body' | 'button';
|
|
786
|
+
sub_type?: 'url' | 'quick_reply';
|
|
787
|
+
/**
|
|
788
|
+
* Button position, from `"0"`.
|
|
789
|
+
*/
|
|
790
|
+
index?: string;
|
|
791
|
+
parameters: Array<{
|
|
792
|
+
type: 'text';
|
|
793
|
+
text: string;
|
|
794
|
+
/**
|
|
795
|
+
* For `NAMED` templates.
|
|
796
|
+
*/
|
|
797
|
+
parameter_name?: string;
|
|
798
|
+
} | {
|
|
799
|
+
type: 'payload';
|
|
800
|
+
payload: string;
|
|
801
|
+
} | {
|
|
802
|
+
type: 'image';
|
|
803
|
+
/**
|
|
804
|
+
* Media file.
|
|
805
|
+
*/
|
|
806
|
+
image: {
|
|
807
|
+
/**
|
|
808
|
+
* Public HTTPS URL of the file.
|
|
809
|
+
*/
|
|
810
|
+
link: string;
|
|
811
|
+
};
|
|
812
|
+
} | {
|
|
813
|
+
type: 'video';
|
|
814
|
+
/**
|
|
815
|
+
* Media file.
|
|
816
|
+
*/
|
|
817
|
+
video: {
|
|
818
|
+
/**
|
|
819
|
+
* Public HTTPS URL of the file.
|
|
820
|
+
*/
|
|
821
|
+
link: string;
|
|
822
|
+
};
|
|
823
|
+
} | {
|
|
824
|
+
type: 'document';
|
|
825
|
+
document: {
|
|
826
|
+
/**
|
|
827
|
+
* Public HTTPS URL of the file.
|
|
828
|
+
*/
|
|
829
|
+
link: string;
|
|
830
|
+
filename?: string;
|
|
831
|
+
};
|
|
832
|
+
} | {
|
|
833
|
+
type: 'currency';
|
|
834
|
+
currency: {
|
|
835
|
+
amount_1000: number;
|
|
836
|
+
code: string;
|
|
837
|
+
fallback_value: string;
|
|
838
|
+
};
|
|
839
|
+
} | {
|
|
840
|
+
type: 'date_time';
|
|
841
|
+
date_time: {
|
|
842
|
+
fallback_value: string;
|
|
843
|
+
};
|
|
844
|
+
}>;
|
|
845
|
+
}>;
|
|
846
|
+
};
|
|
847
|
+
/**
|
|
848
|
+
* A file Ricky downloads and sends. WhatsApp and Instagram only.
|
|
849
|
+
*/
|
|
850
|
+
export type MediaMessage = {
|
|
851
|
+
/**
|
|
852
|
+
* Public HTTPS URL of the file. Ricky downloads it once, without following redirects.
|
|
853
|
+
*/
|
|
854
|
+
url: string;
|
|
855
|
+
/**
|
|
856
|
+
* How the channel shows the file. The file type must match it.
|
|
857
|
+
*/
|
|
858
|
+
kind: 'image' | 'video' | 'audio' | 'document';
|
|
859
|
+
/**
|
|
860
|
+
* Text under an image, video or document. WhatsApp only.
|
|
861
|
+
*/
|
|
862
|
+
caption?: string;
|
|
863
|
+
/**
|
|
864
|
+
* Name the recipient sees for a document. Defaults to the last segment of `url`.
|
|
865
|
+
*/
|
|
866
|
+
filename?: string;
|
|
867
|
+
};
|
|
868
|
+
/**
|
|
869
|
+
* Text and media work inside the channel reply window; a template (WhatsApp only) works any time.
|
|
870
|
+
*/
|
|
871
|
+
export type SendMessage = {
|
|
872
|
+
type: 'text';
|
|
873
|
+
/**
|
|
874
|
+
* Message text.
|
|
875
|
+
*/
|
|
876
|
+
text: string;
|
|
877
|
+
} | {
|
|
878
|
+
type: 'template';
|
|
879
|
+
template: TemplateMessage;
|
|
880
|
+
} | {
|
|
881
|
+
type: 'media';
|
|
882
|
+
media: MediaMessage;
|
|
883
|
+
};
|
|
884
|
+
/**
|
|
885
|
+
* Sends a template to a phone number.
|
|
886
|
+
*/
|
|
887
|
+
export type StartConversation = {
|
|
888
|
+
/**
|
|
889
|
+
* WhatsApp channel to send from. See `GET /channels`.
|
|
890
|
+
*/
|
|
891
|
+
channel_id: string;
|
|
892
|
+
/**
|
|
893
|
+
* Recipient phone with country code, for example `+50760001234`.
|
|
894
|
+
*/
|
|
895
|
+
phone: string;
|
|
896
|
+
template: TemplateMessage;
|
|
897
|
+
};
|
|
898
|
+
export type AssignConversation = {
|
|
899
|
+
/**
|
|
900
|
+
* Member to assign; null unassigns.
|
|
901
|
+
*/
|
|
902
|
+
assigned_user_id: string | null;
|
|
903
|
+
/**
|
|
904
|
+
* Also make that member the contact owner.
|
|
905
|
+
*/
|
|
906
|
+
sync_contact_owner?: boolean;
|
|
907
|
+
};
|
|
908
|
+
export type CloseConversation = {
|
|
909
|
+
/**
|
|
910
|
+
* Why it is closed.
|
|
911
|
+
*/
|
|
912
|
+
category?: 'resolved' | 'sale' | 'no_response' | 'spam' | 'other' | null;
|
|
913
|
+
};
|
|
914
|
+
export type CreateTag = {
|
|
915
|
+
/**
|
|
916
|
+
* Display name, unique in the organization regardless of case.
|
|
917
|
+
*/
|
|
918
|
+
name: string;
|
|
919
|
+
/**
|
|
920
|
+
* Display color.
|
|
921
|
+
*/
|
|
922
|
+
color: 'gray' | 'red' | 'orange' | 'amber' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'pink';
|
|
923
|
+
};
|
|
924
|
+
export type AddContactNote = {
|
|
925
|
+
/**
|
|
926
|
+
* Note text. Ricky adds it after the current notes, separated by a blank line.
|
|
927
|
+
*/
|
|
928
|
+
text: string;
|
|
929
|
+
};
|
|
930
|
+
export type CreateWebhook = {
|
|
931
|
+
/**
|
|
932
|
+
* Public HTTPS endpoint.
|
|
933
|
+
*/
|
|
934
|
+
url: string;
|
|
935
|
+
event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated'>;
|
|
936
|
+
};
|
|
937
|
+
export type RotateWebhookSecret = {
|
|
938
|
+
/**
|
|
939
|
+
* How long deliveries keep the previous signature too, so you can deploy the new secret first. 0 ends the previous secret now.
|
|
940
|
+
*/
|
|
941
|
+
expire_previous_after_hours?: number;
|
|
942
|
+
};
|
|
943
|
+
/**
|
|
944
|
+
* 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.
|
|
945
|
+
*/
|
|
946
|
+
export type IdempotencyKey = string;
|
|
947
|
+
export type ListContactsData = {
|
|
948
|
+
body?: never;
|
|
949
|
+
path?: never;
|
|
950
|
+
query?: {
|
|
951
|
+
/**
|
|
952
|
+
* Items per page.
|
|
953
|
+
*/
|
|
954
|
+
page_size?: number;
|
|
955
|
+
/**
|
|
956
|
+
* `next_cursor` from the previous page. Use it unchanged.
|
|
957
|
+
*/
|
|
958
|
+
cursor?: string;
|
|
959
|
+
/**
|
|
960
|
+
* Text contained in the name, phone, email or company.
|
|
961
|
+
*/
|
|
962
|
+
query?: string;
|
|
963
|
+
/**
|
|
964
|
+
* Only contacts with this tag.
|
|
965
|
+
*/
|
|
966
|
+
tag_id?: string;
|
|
967
|
+
/**
|
|
968
|
+
* Only contacts this member owns.
|
|
969
|
+
*/
|
|
970
|
+
owner_user_id?: string;
|
|
971
|
+
/**
|
|
972
|
+
* Only contacts at this stage.
|
|
973
|
+
*/
|
|
974
|
+
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other';
|
|
975
|
+
/**
|
|
976
|
+
* Only contacts reachable on this channel.
|
|
977
|
+
*/
|
|
978
|
+
channel?: 'whatsapp' | 'instagram' | 'messenger';
|
|
979
|
+
};
|
|
980
|
+
url: '/contacts';
|
|
981
|
+
};
|
|
982
|
+
export type ListContactsErrors = {
|
|
983
|
+
/**
|
|
984
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
985
|
+
*/
|
|
986
|
+
400: Error;
|
|
987
|
+
/**
|
|
988
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
989
|
+
*/
|
|
990
|
+
401: Error;
|
|
991
|
+
/**
|
|
992
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
993
|
+
*/
|
|
994
|
+
403: Error;
|
|
995
|
+
/**
|
|
996
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
997
|
+
*/
|
|
998
|
+
429: Error;
|
|
999
|
+
/**
|
|
1000
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1001
|
+
*/
|
|
1002
|
+
500: Error;
|
|
1003
|
+
};
|
|
1004
|
+
export type ListContactsError = ListContactsErrors[keyof ListContactsErrors];
|
|
1005
|
+
export type ListContactsResponses = {
|
|
1006
|
+
/**
|
|
1007
|
+
* Success.
|
|
1008
|
+
*/
|
|
1009
|
+
200: {
|
|
1010
|
+
data: Array<Contact>;
|
|
1011
|
+
/**
|
|
1012
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
1013
|
+
*/
|
|
1014
|
+
next_cursor: string | null;
|
|
1015
|
+
};
|
|
1016
|
+
};
|
|
1017
|
+
export type ListContactsResponse = ListContactsResponses[keyof ListContactsResponses];
|
|
1018
|
+
export type CreateContactData = {
|
|
1019
|
+
body: CreateContact;
|
|
1020
|
+
headers?: {
|
|
1021
|
+
/**
|
|
1022
|
+
* 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.
|
|
1023
|
+
*/
|
|
1024
|
+
'Idempotency-Key'?: string;
|
|
1025
|
+
};
|
|
1026
|
+
path?: never;
|
|
1027
|
+
query?: never;
|
|
1028
|
+
url: '/contacts';
|
|
1029
|
+
};
|
|
1030
|
+
export type CreateContactErrors = {
|
|
1031
|
+
/**
|
|
1032
|
+
* `invalid_json`: The body is not valid JSON.
|
|
1033
|
+
*
|
|
1034
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1035
|
+
*/
|
|
1036
|
+
400: Error;
|
|
1037
|
+
/**
|
|
1038
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1039
|
+
*/
|
|
1040
|
+
401: Error;
|
|
1041
|
+
/**
|
|
1042
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1043
|
+
*/
|
|
1044
|
+
403: Error;
|
|
1045
|
+
/**
|
|
1046
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1047
|
+
*
|
|
1048
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1049
|
+
*
|
|
1050
|
+
* `conflict`: The resource changed in a way that prevents the operation.
|
|
1051
|
+
*/
|
|
1052
|
+
409: Error;
|
|
1053
|
+
/**
|
|
1054
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1055
|
+
*/
|
|
1056
|
+
413: Error;
|
|
1057
|
+
/**
|
|
1058
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
1059
|
+
*/
|
|
1060
|
+
415: Error;
|
|
1061
|
+
/**
|
|
1062
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1063
|
+
*/
|
|
1064
|
+
429: Error;
|
|
1065
|
+
/**
|
|
1066
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1067
|
+
*/
|
|
1068
|
+
500: Error;
|
|
1069
|
+
};
|
|
1070
|
+
export type CreateContactError = CreateContactErrors[keyof CreateContactErrors];
|
|
1071
|
+
export type CreateContactResponses = {
|
|
1072
|
+
/**
|
|
1073
|
+
* Success.
|
|
1074
|
+
*/
|
|
1075
|
+
201: {
|
|
1076
|
+
data: Contact;
|
|
1077
|
+
};
|
|
1078
|
+
};
|
|
1079
|
+
export type CreateContactResponse = CreateContactResponses[keyof CreateContactResponses];
|
|
1080
|
+
export type GetContactData = {
|
|
1081
|
+
body?: never;
|
|
1082
|
+
path: {
|
|
1083
|
+
/**
|
|
1084
|
+
* Contact ID.
|
|
1085
|
+
*/
|
|
1086
|
+
contact_id: string;
|
|
1087
|
+
};
|
|
1088
|
+
query?: never;
|
|
1089
|
+
url: '/contacts/{contact_id}';
|
|
1090
|
+
};
|
|
1091
|
+
export type GetContactErrors = {
|
|
1092
|
+
/**
|
|
1093
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1094
|
+
*/
|
|
1095
|
+
400: Error;
|
|
1096
|
+
/**
|
|
1097
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1098
|
+
*/
|
|
1099
|
+
401: Error;
|
|
1100
|
+
/**
|
|
1101
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1102
|
+
*/
|
|
1103
|
+
403: Error;
|
|
1104
|
+
/**
|
|
1105
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1106
|
+
*/
|
|
1107
|
+
404: Error;
|
|
1108
|
+
/**
|
|
1109
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1110
|
+
*/
|
|
1111
|
+
429: Error;
|
|
1112
|
+
/**
|
|
1113
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1114
|
+
*/
|
|
1115
|
+
500: Error;
|
|
1116
|
+
};
|
|
1117
|
+
export type GetContactError = GetContactErrors[keyof GetContactErrors];
|
|
1118
|
+
export type GetContactResponses = {
|
|
1119
|
+
/**
|
|
1120
|
+
* Success.
|
|
1121
|
+
*/
|
|
1122
|
+
200: {
|
|
1123
|
+
data: Contact;
|
|
1124
|
+
};
|
|
1125
|
+
};
|
|
1126
|
+
export type GetContactResponse = GetContactResponses[keyof GetContactResponses];
|
|
1127
|
+
export type UpdateContactData = {
|
|
1128
|
+
body: UpdateContact;
|
|
1129
|
+
headers?: {
|
|
1130
|
+
/**
|
|
1131
|
+
* 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.
|
|
1132
|
+
*/
|
|
1133
|
+
'Idempotency-Key'?: string;
|
|
1134
|
+
};
|
|
1135
|
+
path: {
|
|
1136
|
+
/**
|
|
1137
|
+
* Contact ID.
|
|
1138
|
+
*/
|
|
1139
|
+
contact_id: string;
|
|
1140
|
+
};
|
|
1141
|
+
query?: never;
|
|
1142
|
+
url: '/contacts/{contact_id}';
|
|
1143
|
+
};
|
|
1144
|
+
export type UpdateContactErrors = {
|
|
1145
|
+
/**
|
|
1146
|
+
* `invalid_json`: The body is not valid JSON.
|
|
1147
|
+
*
|
|
1148
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1149
|
+
*/
|
|
1150
|
+
400: Error;
|
|
1151
|
+
/**
|
|
1152
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1153
|
+
*/
|
|
1154
|
+
401: Error;
|
|
1155
|
+
/**
|
|
1156
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1157
|
+
*/
|
|
1158
|
+
403: Error;
|
|
1159
|
+
/**
|
|
1160
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1161
|
+
*/
|
|
1162
|
+
404: Error;
|
|
1163
|
+
/**
|
|
1164
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1165
|
+
*
|
|
1166
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1167
|
+
*
|
|
1168
|
+
* `conflict`: The resource changed in a way that prevents the operation.
|
|
1169
|
+
*/
|
|
1170
|
+
409: Error;
|
|
1171
|
+
/**
|
|
1172
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1173
|
+
*/
|
|
1174
|
+
413: Error;
|
|
1175
|
+
/**
|
|
1176
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
1177
|
+
*/
|
|
1178
|
+
415: Error;
|
|
1179
|
+
/**
|
|
1180
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1181
|
+
*/
|
|
1182
|
+
429: Error;
|
|
1183
|
+
/**
|
|
1184
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1185
|
+
*/
|
|
1186
|
+
500: Error;
|
|
1187
|
+
};
|
|
1188
|
+
export type UpdateContactError = UpdateContactErrors[keyof UpdateContactErrors];
|
|
1189
|
+
export type UpdateContactResponses = {
|
|
1190
|
+
/**
|
|
1191
|
+
* Success.
|
|
1192
|
+
*/
|
|
1193
|
+
200: {
|
|
1194
|
+
data: Contact;
|
|
1195
|
+
};
|
|
1196
|
+
};
|
|
1197
|
+
export type UpdateContactResponse = UpdateContactResponses[keyof UpdateContactResponses];
|
|
1198
|
+
export type AddContactNoteData = {
|
|
1199
|
+
body: AddContactNote;
|
|
1200
|
+
headers?: {
|
|
1201
|
+
/**
|
|
1202
|
+
* 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.
|
|
1203
|
+
*/
|
|
1204
|
+
'Idempotency-Key'?: string;
|
|
1205
|
+
};
|
|
1206
|
+
path: {
|
|
1207
|
+
/**
|
|
1208
|
+
* Contact ID.
|
|
1209
|
+
*/
|
|
1210
|
+
contact_id: string;
|
|
1211
|
+
};
|
|
1212
|
+
query?: never;
|
|
1213
|
+
url: '/contacts/{contact_id}/notes';
|
|
1214
|
+
};
|
|
1215
|
+
export type AddContactNoteErrors = {
|
|
1216
|
+
/**
|
|
1217
|
+
* `invalid_json`: The body is not valid JSON.
|
|
1218
|
+
*
|
|
1219
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1220
|
+
*/
|
|
1221
|
+
400: Error;
|
|
1222
|
+
/**
|
|
1223
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1224
|
+
*/
|
|
1225
|
+
401: Error;
|
|
1226
|
+
/**
|
|
1227
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1228
|
+
*/
|
|
1229
|
+
403: Error;
|
|
1230
|
+
/**
|
|
1231
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1232
|
+
*/
|
|
1233
|
+
404: Error;
|
|
1234
|
+
/**
|
|
1235
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1236
|
+
*
|
|
1237
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1238
|
+
*/
|
|
1239
|
+
409: Error;
|
|
1240
|
+
/**
|
|
1241
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1242
|
+
*/
|
|
1243
|
+
413: Error;
|
|
1244
|
+
/**
|
|
1245
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
1246
|
+
*/
|
|
1247
|
+
415: Error;
|
|
1248
|
+
/**
|
|
1249
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1250
|
+
*/
|
|
1251
|
+
429: Error;
|
|
1252
|
+
/**
|
|
1253
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1254
|
+
*/
|
|
1255
|
+
500: Error;
|
|
1256
|
+
};
|
|
1257
|
+
export type AddContactNoteError = AddContactNoteErrors[keyof AddContactNoteErrors];
|
|
1258
|
+
export type AddContactNoteResponses = {
|
|
1259
|
+
/**
|
|
1260
|
+
* Success.
|
|
1261
|
+
*/
|
|
1262
|
+
200: {
|
|
1263
|
+
data: Contact;
|
|
1264
|
+
};
|
|
1265
|
+
};
|
|
1266
|
+
export type AddContactNoteResponse = AddContactNoteResponses[keyof AddContactNoteResponses];
|
|
1267
|
+
export type ListContactFieldsData = {
|
|
1268
|
+
body?: never;
|
|
1269
|
+
path?: never;
|
|
1270
|
+
query?: never;
|
|
1271
|
+
url: '/contact-fields';
|
|
1272
|
+
};
|
|
1273
|
+
export type ListContactFieldsErrors = {
|
|
1274
|
+
/**
|
|
1275
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1276
|
+
*/
|
|
1277
|
+
401: Error;
|
|
1278
|
+
/**
|
|
1279
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1280
|
+
*/
|
|
1281
|
+
403: Error;
|
|
1282
|
+
/**
|
|
1283
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1284
|
+
*/
|
|
1285
|
+
429: Error;
|
|
1286
|
+
/**
|
|
1287
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1288
|
+
*/
|
|
1289
|
+
500: Error;
|
|
1290
|
+
};
|
|
1291
|
+
export type ListContactFieldsError = ListContactFieldsErrors[keyof ListContactFieldsErrors];
|
|
1292
|
+
export type ListContactFieldsResponses = {
|
|
1293
|
+
/**
|
|
1294
|
+
* Success.
|
|
1295
|
+
*/
|
|
1296
|
+
200: {
|
|
1297
|
+
data: Array<ContactField>;
|
|
1298
|
+
/**
|
|
1299
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
1300
|
+
*/
|
|
1301
|
+
next_cursor: string | null;
|
|
1302
|
+
};
|
|
1303
|
+
};
|
|
1304
|
+
export type ListContactFieldsResponse = ListContactFieldsResponses[keyof ListContactFieldsResponses];
|
|
1305
|
+
export type ListConversationsData = {
|
|
1306
|
+
body?: never;
|
|
1307
|
+
path?: never;
|
|
1308
|
+
query?: {
|
|
1309
|
+
/**
|
|
1310
|
+
* Items per page.
|
|
1311
|
+
*/
|
|
1312
|
+
page_size?: number;
|
|
1313
|
+
/**
|
|
1314
|
+
* `next_cursor` from the previous page. Use it unchanged.
|
|
1315
|
+
*/
|
|
1316
|
+
cursor?: string;
|
|
1317
|
+
status?: 'all' | 'open' | 'closed';
|
|
1318
|
+
/**
|
|
1319
|
+
* Only conversations assigned to this member.
|
|
1320
|
+
*/
|
|
1321
|
+
assigned_user_id?: string;
|
|
1322
|
+
};
|
|
1323
|
+
url: '/conversations';
|
|
1324
|
+
};
|
|
1325
|
+
export type ListConversationsErrors = {
|
|
1326
|
+
/**
|
|
1327
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1328
|
+
*/
|
|
1329
|
+
400: Error;
|
|
1330
|
+
/**
|
|
1331
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1332
|
+
*/
|
|
1333
|
+
401: Error;
|
|
1334
|
+
/**
|
|
1335
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1336
|
+
*/
|
|
1337
|
+
403: Error;
|
|
1338
|
+
/**
|
|
1339
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1340
|
+
*/
|
|
1341
|
+
429: Error;
|
|
1342
|
+
/**
|
|
1343
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1344
|
+
*/
|
|
1345
|
+
500: Error;
|
|
1346
|
+
};
|
|
1347
|
+
export type ListConversationsError = ListConversationsErrors[keyof ListConversationsErrors];
|
|
1348
|
+
export type ListConversationsResponses = {
|
|
1349
|
+
/**
|
|
1350
|
+
* Success.
|
|
1351
|
+
*/
|
|
1352
|
+
200: {
|
|
1353
|
+
data: Array<Conversation>;
|
|
1354
|
+
/**
|
|
1355
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
1356
|
+
*/
|
|
1357
|
+
next_cursor: string | null;
|
|
1358
|
+
};
|
|
1359
|
+
};
|
|
1360
|
+
export type ListConversationsResponse = ListConversationsResponses[keyof ListConversationsResponses];
|
|
1361
|
+
export type StartConversationData = {
|
|
1362
|
+
body: StartConversation;
|
|
1363
|
+
headers?: {
|
|
1364
|
+
/**
|
|
1365
|
+
* 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.
|
|
1366
|
+
*/
|
|
1367
|
+
'Idempotency-Key'?: string;
|
|
1368
|
+
};
|
|
1369
|
+
path?: never;
|
|
1370
|
+
query?: never;
|
|
1371
|
+
url: '/conversations';
|
|
1372
|
+
};
|
|
1373
|
+
export type StartConversationErrors = {
|
|
1374
|
+
/**
|
|
1375
|
+
* `invalid_json`: The body is not valid JSON.
|
|
1376
|
+
*
|
|
1377
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1378
|
+
*/
|
|
1379
|
+
400: Error;
|
|
1380
|
+
/**
|
|
1381
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1382
|
+
*/
|
|
1383
|
+
401: Error;
|
|
1384
|
+
/**
|
|
1385
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1386
|
+
*/
|
|
1387
|
+
403: Error;
|
|
1388
|
+
/**
|
|
1389
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1390
|
+
*/
|
|
1391
|
+
404: Error;
|
|
1392
|
+
/**
|
|
1393
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1394
|
+
*
|
|
1395
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1396
|
+
*/
|
|
1397
|
+
409: Error;
|
|
1398
|
+
/**
|
|
1399
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1400
|
+
*/
|
|
1401
|
+
413: Error;
|
|
1402
|
+
/**
|
|
1403
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
1404
|
+
*/
|
|
1405
|
+
415: Error;
|
|
1406
|
+
/**
|
|
1407
|
+
* `outside_messaging_window`: The channel only allows free-form text inside its reply window; send a template.
|
|
1408
|
+
*
|
|
1409
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
1410
|
+
*/
|
|
1411
|
+
422: Error;
|
|
1412
|
+
/**
|
|
1413
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1414
|
+
*/
|
|
1415
|
+
429: Error;
|
|
1416
|
+
/**
|
|
1417
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1418
|
+
*/
|
|
1419
|
+
500: Error;
|
|
1420
|
+
/**
|
|
1421
|
+
* `upstream_error`: The messaging provider failed. Retry later.
|
|
1422
|
+
*/
|
|
1423
|
+
502: Error;
|
|
1424
|
+
/**
|
|
1425
|
+
* `unavailable`: A dependency is temporarily unavailable. Retry later.
|
|
1426
|
+
*/
|
|
1427
|
+
503: Error;
|
|
1428
|
+
};
|
|
1429
|
+
export type StartConversationError = StartConversationErrors[keyof StartConversationErrors];
|
|
1430
|
+
export type StartConversationResponses = {
|
|
1431
|
+
/**
|
|
1432
|
+
* Accepted.
|
|
1433
|
+
*/
|
|
1434
|
+
202: {
|
|
1435
|
+
data: Send;
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
export type StartConversationResponse = StartConversationResponses[keyof StartConversationResponses];
|
|
1439
|
+
export type GetConversationData = {
|
|
1440
|
+
body?: never;
|
|
1441
|
+
path: {
|
|
1442
|
+
/**
|
|
1443
|
+
* Conversation ID.
|
|
1444
|
+
*/
|
|
1445
|
+
conversation_id: string;
|
|
1446
|
+
};
|
|
1447
|
+
query?: never;
|
|
1448
|
+
url: '/conversations/{conversation_id}';
|
|
1449
|
+
};
|
|
1450
|
+
export type GetConversationErrors = {
|
|
1451
|
+
/**
|
|
1452
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1453
|
+
*/
|
|
1454
|
+
400: Error;
|
|
1455
|
+
/**
|
|
1456
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1457
|
+
*/
|
|
1458
|
+
401: Error;
|
|
1459
|
+
/**
|
|
1460
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1461
|
+
*/
|
|
1462
|
+
403: Error;
|
|
1463
|
+
/**
|
|
1464
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1465
|
+
*/
|
|
1466
|
+
404: Error;
|
|
1467
|
+
/**
|
|
1468
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1469
|
+
*/
|
|
1470
|
+
429: Error;
|
|
1471
|
+
/**
|
|
1472
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1473
|
+
*/
|
|
1474
|
+
500: Error;
|
|
1475
|
+
};
|
|
1476
|
+
export type GetConversationError = GetConversationErrors[keyof GetConversationErrors];
|
|
1477
|
+
export type GetConversationResponses = {
|
|
1478
|
+
/**
|
|
1479
|
+
* Success.
|
|
1480
|
+
*/
|
|
1481
|
+
200: {
|
|
1482
|
+
data: Conversation;
|
|
1483
|
+
};
|
|
1484
|
+
};
|
|
1485
|
+
export type GetConversationResponse = GetConversationResponses[keyof GetConversationResponses];
|
|
1486
|
+
export type AssignConversationData = {
|
|
1487
|
+
body: AssignConversation;
|
|
1488
|
+
headers?: {
|
|
1489
|
+
/**
|
|
1490
|
+
* 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.
|
|
1491
|
+
*/
|
|
1492
|
+
'Idempotency-Key'?: string;
|
|
1493
|
+
};
|
|
1494
|
+
path: {
|
|
1495
|
+
/**
|
|
1496
|
+
* Conversation ID.
|
|
1497
|
+
*/
|
|
1498
|
+
conversation_id: string;
|
|
1499
|
+
};
|
|
1500
|
+
query?: never;
|
|
1501
|
+
url: '/conversations/{conversation_id}/assignment';
|
|
1502
|
+
};
|
|
1503
|
+
export type AssignConversationErrors = {
|
|
1504
|
+
/**
|
|
1505
|
+
* `invalid_json`: The body is not valid JSON.
|
|
1506
|
+
*
|
|
1507
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1508
|
+
*/
|
|
1509
|
+
400: Error;
|
|
1510
|
+
/**
|
|
1511
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1512
|
+
*/
|
|
1513
|
+
401: Error;
|
|
1514
|
+
/**
|
|
1515
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1516
|
+
*/
|
|
1517
|
+
403: Error;
|
|
1518
|
+
/**
|
|
1519
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1520
|
+
*/
|
|
1521
|
+
404: Error;
|
|
1522
|
+
/**
|
|
1523
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1524
|
+
*
|
|
1525
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1526
|
+
*/
|
|
1527
|
+
409: Error;
|
|
1528
|
+
/**
|
|
1529
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1530
|
+
*/
|
|
1531
|
+
413: Error;
|
|
1532
|
+
/**
|
|
1533
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
1534
|
+
*/
|
|
1535
|
+
415: Error;
|
|
1536
|
+
/**
|
|
1537
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
1538
|
+
*/
|
|
1539
|
+
422: Error;
|
|
1540
|
+
/**
|
|
1541
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1542
|
+
*/
|
|
1543
|
+
429: Error;
|
|
1544
|
+
/**
|
|
1545
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1546
|
+
*/
|
|
1547
|
+
500: Error;
|
|
1548
|
+
};
|
|
1549
|
+
export type AssignConversationError = AssignConversationErrors[keyof AssignConversationErrors];
|
|
1550
|
+
export type AssignConversationResponses = {
|
|
1551
|
+
/**
|
|
1552
|
+
* Success.
|
|
1553
|
+
*/
|
|
1554
|
+
200: {
|
|
1555
|
+
data: Conversation;
|
|
1556
|
+
};
|
|
1557
|
+
};
|
|
1558
|
+
export type AssignConversationResponse = AssignConversationResponses[keyof AssignConversationResponses];
|
|
1559
|
+
export type CloseConversationData = {
|
|
1560
|
+
body: CloseConversation;
|
|
1561
|
+
headers?: {
|
|
1562
|
+
/**
|
|
1563
|
+
* 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.
|
|
1564
|
+
*/
|
|
1565
|
+
'Idempotency-Key'?: string;
|
|
1566
|
+
};
|
|
1567
|
+
path: {
|
|
1568
|
+
/**
|
|
1569
|
+
* Conversation ID.
|
|
1570
|
+
*/
|
|
1571
|
+
conversation_id: string;
|
|
1572
|
+
};
|
|
1573
|
+
query?: never;
|
|
1574
|
+
url: '/conversations/{conversation_id}/close';
|
|
1575
|
+
};
|
|
1576
|
+
export type CloseConversationErrors = {
|
|
1577
|
+
/**
|
|
1578
|
+
* `invalid_json`: The body is not valid JSON.
|
|
1579
|
+
*
|
|
1580
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1581
|
+
*/
|
|
1582
|
+
400: Error;
|
|
1583
|
+
/**
|
|
1584
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1585
|
+
*/
|
|
1586
|
+
401: Error;
|
|
1587
|
+
/**
|
|
1588
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1589
|
+
*/
|
|
1590
|
+
403: Error;
|
|
1591
|
+
/**
|
|
1592
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1593
|
+
*/
|
|
1594
|
+
404: Error;
|
|
1595
|
+
/**
|
|
1596
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1597
|
+
*
|
|
1598
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1599
|
+
*/
|
|
1600
|
+
409: Error;
|
|
1601
|
+
/**
|
|
1602
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1603
|
+
*/
|
|
1604
|
+
413: Error;
|
|
1605
|
+
/**
|
|
1606
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
1607
|
+
*/
|
|
1608
|
+
415: Error;
|
|
1609
|
+
/**
|
|
1610
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1611
|
+
*/
|
|
1612
|
+
429: Error;
|
|
1613
|
+
/**
|
|
1614
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1615
|
+
*/
|
|
1616
|
+
500: Error;
|
|
1617
|
+
};
|
|
1618
|
+
export type CloseConversationError = CloseConversationErrors[keyof CloseConversationErrors];
|
|
1619
|
+
export type CloseConversationResponses = {
|
|
1620
|
+
/**
|
|
1621
|
+
* Success.
|
|
1622
|
+
*/
|
|
1623
|
+
200: {
|
|
1624
|
+
data: Conversation;
|
|
1625
|
+
};
|
|
1626
|
+
};
|
|
1627
|
+
export type CloseConversationResponse = CloseConversationResponses[keyof CloseConversationResponses];
|
|
1628
|
+
export type ReopenConversationData = {
|
|
1629
|
+
body?: never;
|
|
1630
|
+
headers?: {
|
|
1631
|
+
/**
|
|
1632
|
+
* 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.
|
|
1633
|
+
*/
|
|
1634
|
+
'Idempotency-Key'?: string;
|
|
1635
|
+
};
|
|
1636
|
+
path: {
|
|
1637
|
+
/**
|
|
1638
|
+
* Conversation ID.
|
|
1639
|
+
*/
|
|
1640
|
+
conversation_id: string;
|
|
1641
|
+
};
|
|
1642
|
+
query?: never;
|
|
1643
|
+
url: '/conversations/{conversation_id}/reopen';
|
|
1644
|
+
};
|
|
1645
|
+
export type ReopenConversationErrors = {
|
|
1646
|
+
/**
|
|
1647
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1648
|
+
*/
|
|
1649
|
+
400: Error;
|
|
1650
|
+
/**
|
|
1651
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1652
|
+
*/
|
|
1653
|
+
401: Error;
|
|
1654
|
+
/**
|
|
1655
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1656
|
+
*/
|
|
1657
|
+
403: Error;
|
|
1658
|
+
/**
|
|
1659
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1660
|
+
*/
|
|
1661
|
+
404: Error;
|
|
1662
|
+
/**
|
|
1663
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1664
|
+
*
|
|
1665
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1666
|
+
*/
|
|
1667
|
+
409: Error;
|
|
1668
|
+
/**
|
|
1669
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1670
|
+
*/
|
|
1671
|
+
429: Error;
|
|
1672
|
+
/**
|
|
1673
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1674
|
+
*/
|
|
1675
|
+
500: Error;
|
|
1676
|
+
};
|
|
1677
|
+
export type ReopenConversationError = ReopenConversationErrors[keyof ReopenConversationErrors];
|
|
1678
|
+
export type ReopenConversationResponses = {
|
|
1679
|
+
/**
|
|
1680
|
+
* Success.
|
|
1681
|
+
*/
|
|
1682
|
+
200: {
|
|
1683
|
+
data: Conversation;
|
|
1684
|
+
};
|
|
1685
|
+
};
|
|
1686
|
+
export type ReopenConversationResponse = ReopenConversationResponses[keyof ReopenConversationResponses];
|
|
1687
|
+
export type ListMessagesData = {
|
|
1688
|
+
body?: never;
|
|
1689
|
+
path: {
|
|
1690
|
+
/**
|
|
1691
|
+
* Conversation ID.
|
|
1692
|
+
*/
|
|
1693
|
+
conversation_id: string;
|
|
1694
|
+
};
|
|
1695
|
+
query?: {
|
|
1696
|
+
/**
|
|
1697
|
+
* `next_cursor` from the previous page. Use it unchanged.
|
|
1698
|
+
*/
|
|
1699
|
+
cursor?: string;
|
|
1700
|
+
};
|
|
1701
|
+
url: '/conversations/{conversation_id}/messages';
|
|
1702
|
+
};
|
|
1703
|
+
export type ListMessagesErrors = {
|
|
1704
|
+
/**
|
|
1705
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1706
|
+
*/
|
|
1707
|
+
400: Error;
|
|
1708
|
+
/**
|
|
1709
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1710
|
+
*/
|
|
1711
|
+
401: Error;
|
|
1712
|
+
/**
|
|
1713
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1714
|
+
*/
|
|
1715
|
+
403: Error;
|
|
1716
|
+
/**
|
|
1717
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1718
|
+
*/
|
|
1719
|
+
404: Error;
|
|
1720
|
+
/**
|
|
1721
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1722
|
+
*/
|
|
1723
|
+
429: Error;
|
|
1724
|
+
/**
|
|
1725
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1726
|
+
*/
|
|
1727
|
+
500: Error;
|
|
1728
|
+
};
|
|
1729
|
+
export type ListMessagesError = ListMessagesErrors[keyof ListMessagesErrors];
|
|
1730
|
+
export type ListMessagesResponses = {
|
|
1731
|
+
/**
|
|
1732
|
+
* Success.
|
|
1733
|
+
*/
|
|
1734
|
+
200: {
|
|
1735
|
+
data: Array<Message>;
|
|
1736
|
+
/**
|
|
1737
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
1738
|
+
*/
|
|
1739
|
+
next_cursor: string | null;
|
|
1740
|
+
};
|
|
1741
|
+
};
|
|
1742
|
+
export type ListMessagesResponse = ListMessagesResponses[keyof ListMessagesResponses];
|
|
1743
|
+
export type SendMessageData = {
|
|
1744
|
+
body: SendMessage;
|
|
1745
|
+
headers?: {
|
|
1746
|
+
/**
|
|
1747
|
+
* 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.
|
|
1748
|
+
*/
|
|
1749
|
+
'Idempotency-Key'?: string;
|
|
1750
|
+
};
|
|
1751
|
+
path: {
|
|
1752
|
+
/**
|
|
1753
|
+
* Conversation ID.
|
|
1754
|
+
*/
|
|
1755
|
+
conversation_id: string;
|
|
1756
|
+
};
|
|
1757
|
+
query?: never;
|
|
1758
|
+
url: '/conversations/{conversation_id}/messages';
|
|
1759
|
+
};
|
|
1760
|
+
export type SendMessageErrors = {
|
|
1761
|
+
/**
|
|
1762
|
+
* `invalid_json`: The body is not valid JSON.
|
|
1763
|
+
*
|
|
1764
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1765
|
+
*/
|
|
1766
|
+
400: Error;
|
|
1767
|
+
/**
|
|
1768
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1769
|
+
*/
|
|
1770
|
+
401: Error;
|
|
1771
|
+
/**
|
|
1772
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1773
|
+
*/
|
|
1774
|
+
403: Error;
|
|
1775
|
+
/**
|
|
1776
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1777
|
+
*/
|
|
1778
|
+
404: Error;
|
|
1779
|
+
/**
|
|
1780
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1781
|
+
*
|
|
1782
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1783
|
+
*/
|
|
1784
|
+
409: Error;
|
|
1785
|
+
/**
|
|
1786
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1787
|
+
*/
|
|
1788
|
+
413: Error;
|
|
1789
|
+
/**
|
|
1790
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
1791
|
+
*/
|
|
1792
|
+
415: Error;
|
|
1793
|
+
/**
|
|
1794
|
+
* `outside_messaging_window`: The channel only allows free-form text inside its reply window; send a template.
|
|
1795
|
+
*
|
|
1796
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
1797
|
+
*/
|
|
1798
|
+
422: Error;
|
|
1799
|
+
/**
|
|
1800
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1801
|
+
*/
|
|
1802
|
+
429: Error;
|
|
1803
|
+
/**
|
|
1804
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1805
|
+
*/
|
|
1806
|
+
500: Error;
|
|
1807
|
+
/**
|
|
1808
|
+
* `upstream_error`: The messaging provider failed. Retry later.
|
|
1809
|
+
*/
|
|
1810
|
+
502: Error;
|
|
1811
|
+
/**
|
|
1812
|
+
* `unavailable`: A dependency is temporarily unavailable. Retry later.
|
|
1813
|
+
*/
|
|
1814
|
+
503: Error;
|
|
1815
|
+
};
|
|
1816
|
+
export type SendMessageError = SendMessageErrors[keyof SendMessageErrors];
|
|
1817
|
+
export type SendMessageResponses = {
|
|
1818
|
+
/**
|
|
1819
|
+
* Accepted.
|
|
1820
|
+
*/
|
|
1821
|
+
202: {
|
|
1822
|
+
data: Send;
|
|
1823
|
+
};
|
|
1824
|
+
};
|
|
1825
|
+
export type SendMessageResponse = SendMessageResponses[keyof SendMessageResponses];
|
|
1826
|
+
export type GetMessageData = {
|
|
1827
|
+
body?: never;
|
|
1828
|
+
path: {
|
|
1829
|
+
/**
|
|
1830
|
+
* Conversation ID.
|
|
1831
|
+
*/
|
|
1832
|
+
conversation_id: string;
|
|
1833
|
+
/**
|
|
1834
|
+
* Message ID.
|
|
1835
|
+
*/
|
|
1836
|
+
message_id: string;
|
|
1837
|
+
};
|
|
1838
|
+
query?: never;
|
|
1839
|
+
url: '/conversations/{conversation_id}/messages/{message_id}';
|
|
1840
|
+
};
|
|
1841
|
+
export type GetMessageErrors = {
|
|
1842
|
+
/**
|
|
1843
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1844
|
+
*/
|
|
1845
|
+
400: Error;
|
|
1846
|
+
/**
|
|
1847
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1848
|
+
*/
|
|
1849
|
+
401: Error;
|
|
1850
|
+
/**
|
|
1851
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1852
|
+
*/
|
|
1853
|
+
403: Error;
|
|
1854
|
+
/**
|
|
1855
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1856
|
+
*/
|
|
1857
|
+
404: Error;
|
|
1858
|
+
/**
|
|
1859
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1860
|
+
*/
|
|
1861
|
+
429: Error;
|
|
1862
|
+
/**
|
|
1863
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1864
|
+
*/
|
|
1865
|
+
500: Error;
|
|
1866
|
+
};
|
|
1867
|
+
export type GetMessageError = GetMessageErrors[keyof GetMessageErrors];
|
|
1868
|
+
export type GetMessageResponses = {
|
|
1869
|
+
/**
|
|
1870
|
+
* Success.
|
|
1871
|
+
*/
|
|
1872
|
+
200: {
|
|
1873
|
+
data: Message;
|
|
1874
|
+
};
|
|
1875
|
+
};
|
|
1876
|
+
export type GetMessageResponse = GetMessageResponses[keyof GetMessageResponses];
|
|
1877
|
+
export type GetSendData = {
|
|
1878
|
+
body?: never;
|
|
1879
|
+
path: {
|
|
1880
|
+
/**
|
|
1881
|
+
* Send ID.
|
|
1882
|
+
*/
|
|
1883
|
+
send_id: string;
|
|
1884
|
+
};
|
|
1885
|
+
query?: never;
|
|
1886
|
+
url: '/sends/{send_id}';
|
|
1887
|
+
};
|
|
1888
|
+
export type GetSendErrors = {
|
|
1889
|
+
/**
|
|
1890
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1891
|
+
*/
|
|
1892
|
+
400: Error;
|
|
1893
|
+
/**
|
|
1894
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1895
|
+
*/
|
|
1896
|
+
401: Error;
|
|
1897
|
+
/**
|
|
1898
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1899
|
+
*/
|
|
1900
|
+
403: Error;
|
|
1901
|
+
/**
|
|
1902
|
+
* `not_found`: The resource does not exist in this organization.
|
|
1903
|
+
*/
|
|
1904
|
+
404: Error;
|
|
1905
|
+
/**
|
|
1906
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1907
|
+
*/
|
|
1908
|
+
429: Error;
|
|
1909
|
+
/**
|
|
1910
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1911
|
+
*/
|
|
1912
|
+
500: Error;
|
|
1913
|
+
};
|
|
1914
|
+
export type GetSendError = GetSendErrors[keyof GetSendErrors];
|
|
1915
|
+
export type GetSendResponses = {
|
|
1916
|
+
/**
|
|
1917
|
+
* Success.
|
|
1918
|
+
*/
|
|
1919
|
+
200: {
|
|
1920
|
+
data: Send;
|
|
1921
|
+
};
|
|
1922
|
+
};
|
|
1923
|
+
export type GetSendResponse = GetSendResponses[keyof GetSendResponses];
|
|
1924
|
+
export type ListChannelsData = {
|
|
1925
|
+
body?: never;
|
|
1926
|
+
path?: never;
|
|
1927
|
+
query?: never;
|
|
1928
|
+
url: '/channels';
|
|
1929
|
+
};
|
|
1930
|
+
export type ListChannelsErrors = {
|
|
1931
|
+
/**
|
|
1932
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1933
|
+
*/
|
|
1934
|
+
401: Error;
|
|
1935
|
+
/**
|
|
1936
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1937
|
+
*/
|
|
1938
|
+
403: Error;
|
|
1939
|
+
/**
|
|
1940
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1941
|
+
*/
|
|
1942
|
+
429: Error;
|
|
1943
|
+
/**
|
|
1944
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1945
|
+
*/
|
|
1946
|
+
500: Error;
|
|
1947
|
+
};
|
|
1948
|
+
export type ListChannelsError = ListChannelsErrors[keyof ListChannelsErrors];
|
|
1949
|
+
export type ListChannelsResponses = {
|
|
1950
|
+
/**
|
|
1951
|
+
* Success.
|
|
1952
|
+
*/
|
|
1953
|
+
200: {
|
|
1954
|
+
data: Array<Channel>;
|
|
1955
|
+
/**
|
|
1956
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
1957
|
+
*/
|
|
1958
|
+
next_cursor: string | null;
|
|
1959
|
+
};
|
|
1960
|
+
};
|
|
1961
|
+
export type ListChannelsResponse = ListChannelsResponses[keyof ListChannelsResponses];
|
|
1962
|
+
export type ListMembersData = {
|
|
1963
|
+
body?: never;
|
|
1964
|
+
path?: never;
|
|
1965
|
+
query?: never;
|
|
1966
|
+
url: '/members';
|
|
1967
|
+
};
|
|
1968
|
+
export type ListMembersErrors = {
|
|
1969
|
+
/**
|
|
1970
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1971
|
+
*/
|
|
1972
|
+
401: Error;
|
|
1973
|
+
/**
|
|
1974
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1975
|
+
*/
|
|
1976
|
+
403: Error;
|
|
1977
|
+
/**
|
|
1978
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1979
|
+
*/
|
|
1980
|
+
429: Error;
|
|
1981
|
+
/**
|
|
1982
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1983
|
+
*/
|
|
1984
|
+
500: Error;
|
|
1985
|
+
};
|
|
1986
|
+
export type ListMembersError = ListMembersErrors[keyof ListMembersErrors];
|
|
1987
|
+
export type ListMembersResponses = {
|
|
1988
|
+
/**
|
|
1989
|
+
* Success.
|
|
1990
|
+
*/
|
|
1991
|
+
200: {
|
|
1992
|
+
data: Array<Member>;
|
|
1993
|
+
/**
|
|
1994
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
1995
|
+
*/
|
|
1996
|
+
next_cursor: string | null;
|
|
1997
|
+
};
|
|
1998
|
+
};
|
|
1999
|
+
export type ListMembersResponse = ListMembersResponses[keyof ListMembersResponses];
|
|
2000
|
+
export type ListTagsData = {
|
|
2001
|
+
body?: never;
|
|
2002
|
+
path?: never;
|
|
2003
|
+
query?: never;
|
|
2004
|
+
url: '/tags';
|
|
2005
|
+
};
|
|
2006
|
+
export type ListTagsErrors = {
|
|
2007
|
+
/**
|
|
2008
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2009
|
+
*/
|
|
2010
|
+
401: Error;
|
|
2011
|
+
/**
|
|
2012
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2013
|
+
*/
|
|
2014
|
+
403: Error;
|
|
2015
|
+
/**
|
|
2016
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2017
|
+
*/
|
|
2018
|
+
429: Error;
|
|
2019
|
+
/**
|
|
2020
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2021
|
+
*/
|
|
2022
|
+
500: Error;
|
|
2023
|
+
};
|
|
2024
|
+
export type ListTagsError = ListTagsErrors[keyof ListTagsErrors];
|
|
2025
|
+
export type ListTagsResponses = {
|
|
2026
|
+
/**
|
|
2027
|
+
* Success.
|
|
2028
|
+
*/
|
|
2029
|
+
200: {
|
|
2030
|
+
data: Array<Tag>;
|
|
2031
|
+
/**
|
|
2032
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
2033
|
+
*/
|
|
2034
|
+
next_cursor: string | null;
|
|
2035
|
+
};
|
|
2036
|
+
};
|
|
2037
|
+
export type ListTagsResponse = ListTagsResponses[keyof ListTagsResponses];
|
|
2038
|
+
export type CreateTagData = {
|
|
2039
|
+
body: CreateTag;
|
|
2040
|
+
headers?: {
|
|
2041
|
+
/**
|
|
2042
|
+
* 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.
|
|
2043
|
+
*/
|
|
2044
|
+
'Idempotency-Key'?: string;
|
|
2045
|
+
};
|
|
2046
|
+
path?: never;
|
|
2047
|
+
query?: never;
|
|
2048
|
+
url: '/tags';
|
|
2049
|
+
};
|
|
2050
|
+
export type CreateTagErrors = {
|
|
2051
|
+
/**
|
|
2052
|
+
* `invalid_json`: The body is not valid JSON.
|
|
2053
|
+
*
|
|
2054
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2055
|
+
*/
|
|
2056
|
+
400: Error;
|
|
2057
|
+
/**
|
|
2058
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2059
|
+
*/
|
|
2060
|
+
401: Error;
|
|
2061
|
+
/**
|
|
2062
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2063
|
+
*/
|
|
2064
|
+
403: Error;
|
|
2065
|
+
/**
|
|
2066
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
2067
|
+
*
|
|
2068
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
2069
|
+
*
|
|
2070
|
+
* `conflict`: The resource changed in a way that prevents the operation.
|
|
2071
|
+
*/
|
|
2072
|
+
409: Error;
|
|
2073
|
+
/**
|
|
2074
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
2075
|
+
*/
|
|
2076
|
+
413: Error;
|
|
2077
|
+
/**
|
|
2078
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
2079
|
+
*/
|
|
2080
|
+
415: Error;
|
|
2081
|
+
/**
|
|
2082
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2083
|
+
*/
|
|
2084
|
+
429: Error;
|
|
2085
|
+
/**
|
|
2086
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2087
|
+
*/
|
|
2088
|
+
500: Error;
|
|
2089
|
+
};
|
|
2090
|
+
export type CreateTagError = CreateTagErrors[keyof CreateTagErrors];
|
|
2091
|
+
export type CreateTagResponses = {
|
|
2092
|
+
/**
|
|
2093
|
+
* Success.
|
|
2094
|
+
*/
|
|
2095
|
+
201: {
|
|
2096
|
+
data: Tag;
|
|
2097
|
+
};
|
|
2098
|
+
};
|
|
2099
|
+
export type CreateTagResponse = CreateTagResponses[keyof CreateTagResponses];
|
|
2100
|
+
export type ListTemplatesData = {
|
|
2101
|
+
body?: never;
|
|
2102
|
+
path?: never;
|
|
2103
|
+
query?: never;
|
|
2104
|
+
url: '/templates';
|
|
2105
|
+
};
|
|
2106
|
+
export type ListTemplatesErrors = {
|
|
2107
|
+
/**
|
|
2108
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2109
|
+
*/
|
|
2110
|
+
401: Error;
|
|
2111
|
+
/**
|
|
2112
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2113
|
+
*/
|
|
2114
|
+
403: Error;
|
|
2115
|
+
/**
|
|
2116
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2117
|
+
*/
|
|
2118
|
+
429: Error;
|
|
2119
|
+
/**
|
|
2120
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2121
|
+
*/
|
|
2122
|
+
500: Error;
|
|
2123
|
+
/**
|
|
2124
|
+
* `upstream_error`: The messaging provider failed. Retry later.
|
|
2125
|
+
*/
|
|
2126
|
+
502: Error;
|
|
2127
|
+
};
|
|
2128
|
+
export type ListTemplatesError = ListTemplatesErrors[keyof ListTemplatesErrors];
|
|
2129
|
+
export type ListTemplatesResponses = {
|
|
2130
|
+
/**
|
|
2131
|
+
* Success.
|
|
2132
|
+
*/
|
|
2133
|
+
200: {
|
|
2134
|
+
data: Array<Template>;
|
|
2135
|
+
/**
|
|
2136
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
2137
|
+
*/
|
|
2138
|
+
next_cursor: string | null;
|
|
2139
|
+
};
|
|
2140
|
+
};
|
|
2141
|
+
export type ListTemplatesResponse = ListTemplatesResponses[keyof ListTemplatesResponses];
|
|
2142
|
+
export type ListWebhooksData = {
|
|
2143
|
+
body?: never;
|
|
2144
|
+
path?: never;
|
|
2145
|
+
query?: never;
|
|
2146
|
+
url: '/webhooks';
|
|
2147
|
+
};
|
|
2148
|
+
export type ListWebhooksErrors = {
|
|
2149
|
+
/**
|
|
2150
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2151
|
+
*/
|
|
2152
|
+
401: Error;
|
|
2153
|
+
/**
|
|
2154
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2155
|
+
*/
|
|
2156
|
+
403: Error;
|
|
2157
|
+
/**
|
|
2158
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2159
|
+
*/
|
|
2160
|
+
429: Error;
|
|
2161
|
+
/**
|
|
2162
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2163
|
+
*/
|
|
2164
|
+
500: Error;
|
|
2165
|
+
};
|
|
2166
|
+
export type ListWebhooksError = ListWebhooksErrors[keyof ListWebhooksErrors];
|
|
2167
|
+
export type ListWebhooksResponses = {
|
|
2168
|
+
/**
|
|
2169
|
+
* Success.
|
|
2170
|
+
*/
|
|
2171
|
+
200: {
|
|
2172
|
+
data: Array<Webhook>;
|
|
2173
|
+
/**
|
|
2174
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
2175
|
+
*/
|
|
2176
|
+
next_cursor: string | null;
|
|
2177
|
+
};
|
|
2178
|
+
};
|
|
2179
|
+
export type ListWebhooksResponse = ListWebhooksResponses[keyof ListWebhooksResponses];
|
|
2180
|
+
export type CreateWebhookData = {
|
|
2181
|
+
body: CreateWebhook;
|
|
2182
|
+
path?: never;
|
|
2183
|
+
query?: never;
|
|
2184
|
+
url: '/webhooks';
|
|
2185
|
+
};
|
|
2186
|
+
export type CreateWebhookErrors = {
|
|
2187
|
+
/**
|
|
2188
|
+
* `invalid_json`: The body is not valid JSON.
|
|
2189
|
+
*
|
|
2190
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2191
|
+
*/
|
|
2192
|
+
400: Error;
|
|
2193
|
+
/**
|
|
2194
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2195
|
+
*/
|
|
2196
|
+
401: Error;
|
|
2197
|
+
/**
|
|
2198
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2199
|
+
*/
|
|
2200
|
+
403: Error;
|
|
2201
|
+
/**
|
|
2202
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
2203
|
+
*/
|
|
2204
|
+
413: Error;
|
|
2205
|
+
/**
|
|
2206
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
2207
|
+
*/
|
|
2208
|
+
415: Error;
|
|
2209
|
+
/**
|
|
2210
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2211
|
+
*/
|
|
2212
|
+
429: Error;
|
|
2213
|
+
/**
|
|
2214
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2215
|
+
*/
|
|
2216
|
+
500: Error;
|
|
2217
|
+
};
|
|
2218
|
+
export type CreateWebhookError = CreateWebhookErrors[keyof CreateWebhookErrors];
|
|
2219
|
+
export type CreateWebhookResponses = {
|
|
2220
|
+
/**
|
|
2221
|
+
* Success.
|
|
2222
|
+
*/
|
|
2223
|
+
201: {
|
|
2224
|
+
data: CreatedWebhook;
|
|
2225
|
+
};
|
|
2226
|
+
};
|
|
2227
|
+
export type CreateWebhookResponse = CreateWebhookResponses[keyof CreateWebhookResponses];
|
|
2228
|
+
export type DisableWebhookData = {
|
|
2229
|
+
body?: never;
|
|
2230
|
+
path: {
|
|
2231
|
+
/**
|
|
2232
|
+
* Webhook ID.
|
|
2233
|
+
*/
|
|
2234
|
+
webhook_id: string;
|
|
2235
|
+
};
|
|
2236
|
+
query?: never;
|
|
2237
|
+
url: '/webhooks/{webhook_id}';
|
|
2238
|
+
};
|
|
2239
|
+
export type DisableWebhookErrors = {
|
|
2240
|
+
/**
|
|
2241
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2242
|
+
*/
|
|
2243
|
+
400: Error;
|
|
2244
|
+
/**
|
|
2245
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2246
|
+
*/
|
|
2247
|
+
401: Error;
|
|
2248
|
+
/**
|
|
2249
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2250
|
+
*/
|
|
2251
|
+
403: Error;
|
|
2252
|
+
/**
|
|
2253
|
+
* `not_found`: The resource does not exist in this organization.
|
|
2254
|
+
*/
|
|
2255
|
+
404: Error;
|
|
2256
|
+
/**
|
|
2257
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2258
|
+
*/
|
|
2259
|
+
429: Error;
|
|
2260
|
+
/**
|
|
2261
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2262
|
+
*/
|
|
2263
|
+
500: Error;
|
|
2264
|
+
};
|
|
2265
|
+
export type DisableWebhookError = DisableWebhookErrors[keyof DisableWebhookErrors];
|
|
2266
|
+
export type DisableWebhookResponses = {
|
|
2267
|
+
/**
|
|
2268
|
+
* Success.
|
|
2269
|
+
*/
|
|
2270
|
+
200: {
|
|
2271
|
+
data: Webhook;
|
|
2272
|
+
};
|
|
2273
|
+
};
|
|
2274
|
+
export type DisableWebhookResponse = DisableWebhookResponses[keyof DisableWebhookResponses];
|
|
2275
|
+
export type TestWebhookData = {
|
|
2276
|
+
body?: never;
|
|
2277
|
+
path: {
|
|
2278
|
+
/**
|
|
2279
|
+
* Webhook ID.
|
|
2280
|
+
*/
|
|
2281
|
+
webhook_id: string;
|
|
2282
|
+
};
|
|
2283
|
+
query?: never;
|
|
2284
|
+
url: '/webhooks/{webhook_id}/test';
|
|
2285
|
+
};
|
|
2286
|
+
export type TestWebhookErrors = {
|
|
2287
|
+
/**
|
|
2288
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2289
|
+
*/
|
|
2290
|
+
400: Error;
|
|
2291
|
+
/**
|
|
2292
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2293
|
+
*/
|
|
2294
|
+
401: Error;
|
|
2295
|
+
/**
|
|
2296
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2297
|
+
*/
|
|
2298
|
+
403: Error;
|
|
2299
|
+
/**
|
|
2300
|
+
* `not_found`: The resource does not exist in this organization.
|
|
2301
|
+
*/
|
|
2302
|
+
404: Error;
|
|
2303
|
+
/**
|
|
2304
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2305
|
+
*/
|
|
2306
|
+
429: Error;
|
|
2307
|
+
/**
|
|
2308
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2309
|
+
*/
|
|
2310
|
+
500: Error;
|
|
2311
|
+
};
|
|
2312
|
+
export type TestWebhookError = TestWebhookErrors[keyof TestWebhookErrors];
|
|
2313
|
+
export type TestWebhookResponses = {
|
|
2314
|
+
/**
|
|
2315
|
+
* Success.
|
|
2316
|
+
*/
|
|
2317
|
+
200: {
|
|
2318
|
+
data: WebhookTestResult;
|
|
2319
|
+
};
|
|
2320
|
+
};
|
|
2321
|
+
export type TestWebhookResponse = TestWebhookResponses[keyof TestWebhookResponses];
|
|
2322
|
+
export type RotateWebhookSecretData = {
|
|
2323
|
+
body: RotateWebhookSecret;
|
|
2324
|
+
path: {
|
|
2325
|
+
/**
|
|
2326
|
+
* Webhook ID.
|
|
2327
|
+
*/
|
|
2328
|
+
webhook_id: string;
|
|
2329
|
+
};
|
|
2330
|
+
query?: never;
|
|
2331
|
+
url: '/webhooks/{webhook_id}/rotate-secret';
|
|
2332
|
+
};
|
|
2333
|
+
export type RotateWebhookSecretErrors = {
|
|
2334
|
+
/**
|
|
2335
|
+
* `invalid_json`: The body is not valid JSON.
|
|
2336
|
+
*
|
|
2337
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2338
|
+
*/
|
|
2339
|
+
400: Error;
|
|
2340
|
+
/**
|
|
2341
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2342
|
+
*/
|
|
2343
|
+
401: Error;
|
|
2344
|
+
/**
|
|
2345
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2346
|
+
*/
|
|
2347
|
+
403: Error;
|
|
2348
|
+
/**
|
|
2349
|
+
* `not_found`: The resource does not exist in this organization.
|
|
2350
|
+
*/
|
|
2351
|
+
404: Error;
|
|
2352
|
+
/**
|
|
2353
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
2354
|
+
*/
|
|
2355
|
+
413: Error;
|
|
2356
|
+
/**
|
|
2357
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
2358
|
+
*/
|
|
2359
|
+
415: Error;
|
|
2360
|
+
/**
|
|
2361
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2362
|
+
*/
|
|
2363
|
+
429: Error;
|
|
2364
|
+
/**
|
|
2365
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2366
|
+
*/
|
|
2367
|
+
500: Error;
|
|
2368
|
+
};
|
|
2369
|
+
export type RotateWebhookSecretError = RotateWebhookSecretErrors[keyof RotateWebhookSecretErrors];
|
|
2370
|
+
export type RotateWebhookSecretResponses = {
|
|
2371
|
+
/**
|
|
2372
|
+
* Success.
|
|
2373
|
+
*/
|
|
2374
|
+
200: {
|
|
2375
|
+
data: CreatedWebhook;
|
|
2376
|
+
};
|
|
2377
|
+
};
|
|
2378
|
+
export type RotateWebhookSecretResponse = RotateWebhookSecretResponses[keyof RotateWebhookSecretResponses];
|
|
2379
|
+
export type ListWebhookDeliveriesData = {
|
|
2380
|
+
body?: never;
|
|
2381
|
+
path: {
|
|
2382
|
+
/**
|
|
2383
|
+
* Webhook ID.
|
|
2384
|
+
*/
|
|
2385
|
+
webhook_id: string;
|
|
2386
|
+
};
|
|
2387
|
+
query?: never;
|
|
2388
|
+
url: '/webhooks/{webhook_id}/deliveries';
|
|
2389
|
+
};
|
|
2390
|
+
export type ListWebhookDeliveriesErrors = {
|
|
2391
|
+
/**
|
|
2392
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2393
|
+
*/
|
|
2394
|
+
400: Error;
|
|
2395
|
+
/**
|
|
2396
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2397
|
+
*/
|
|
2398
|
+
401: Error;
|
|
2399
|
+
/**
|
|
2400
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2401
|
+
*/
|
|
2402
|
+
403: Error;
|
|
2403
|
+
/**
|
|
2404
|
+
* `not_found`: The resource does not exist in this organization.
|
|
2405
|
+
*/
|
|
2406
|
+
404: Error;
|
|
2407
|
+
/**
|
|
2408
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2409
|
+
*/
|
|
2410
|
+
429: Error;
|
|
2411
|
+
/**
|
|
2412
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2413
|
+
*/
|
|
2414
|
+
500: Error;
|
|
2415
|
+
};
|
|
2416
|
+
export type ListWebhookDeliveriesError = ListWebhookDeliveriesErrors[keyof ListWebhookDeliveriesErrors];
|
|
2417
|
+
export type ListWebhookDeliveriesResponses = {
|
|
2418
|
+
/**
|
|
2419
|
+
* Success.
|
|
2420
|
+
*/
|
|
2421
|
+
200: {
|
|
2422
|
+
data: Array<WebhookDelivery>;
|
|
2423
|
+
/**
|
|
2424
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
2425
|
+
*/
|
|
2426
|
+
next_cursor: string | null;
|
|
2427
|
+
};
|
|
2428
|
+
};
|
|
2429
|
+
export type ListWebhookDeliveriesResponse = ListWebhookDeliveriesResponses[keyof ListWebhookDeliveriesResponses];
|
|
2430
|
+
export type RetryWebhookDeliveryData = {
|
|
2431
|
+
body?: never;
|
|
2432
|
+
path: {
|
|
2433
|
+
/**
|
|
2434
|
+
* Webhook ID.
|
|
2435
|
+
*/
|
|
2436
|
+
webhook_id: string;
|
|
2437
|
+
/**
|
|
2438
|
+
* Delivery ID.
|
|
2439
|
+
*/
|
|
2440
|
+
delivery_id: string;
|
|
2441
|
+
};
|
|
2442
|
+
query?: never;
|
|
2443
|
+
url: '/webhooks/{webhook_id}/deliveries/{delivery_id}/retry';
|
|
2444
|
+
};
|
|
2445
|
+
export type RetryWebhookDeliveryErrors = {
|
|
2446
|
+
/**
|
|
2447
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2448
|
+
*/
|
|
2449
|
+
400: Error;
|
|
2450
|
+
/**
|
|
2451
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2452
|
+
*/
|
|
2453
|
+
401: Error;
|
|
2454
|
+
/**
|
|
2455
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2456
|
+
*/
|
|
2457
|
+
403: Error;
|
|
2458
|
+
/**
|
|
2459
|
+
* `not_found`: The resource does not exist in this organization.
|
|
2460
|
+
*/
|
|
2461
|
+
404: Error;
|
|
2462
|
+
/**
|
|
2463
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2464
|
+
*/
|
|
2465
|
+
429: Error;
|
|
2466
|
+
/**
|
|
2467
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2468
|
+
*/
|
|
2469
|
+
500: Error;
|
|
2470
|
+
};
|
|
2471
|
+
export type RetryWebhookDeliveryError = RetryWebhookDeliveryErrors[keyof RetryWebhookDeliveryErrors];
|
|
2472
|
+
export type RetryWebhookDeliveryResponses = {
|
|
2473
|
+
/**
|
|
2474
|
+
* Success.
|
|
2475
|
+
*/
|
|
2476
|
+
200: {
|
|
2477
|
+
data: WebhookDelivery;
|
|
2478
|
+
};
|
|
2479
|
+
};
|
|
2480
|
+
export type RetryWebhookDeliveryResponse = RetryWebhookDeliveryResponses[keyof RetryWebhookDeliveryResponses];
|
|
2481
|
+
export type WebhookMessageReceivedWebhookPayload = WebhookEvent;
|
|
2482
|
+
export type WebhookMessageReceivedWebhookRequest = {
|
|
2483
|
+
body: WebhookMessageReceivedWebhookPayload;
|
|
2484
|
+
key: 'message.received';
|
|
2485
|
+
path?: never;
|
|
2486
|
+
query?: never;
|
|
2487
|
+
};
|
|
2488
|
+
export type WebhookMessageSentWebhookPayload = WebhookEvent;
|
|
2489
|
+
export type WebhookMessageSentWebhookRequest = {
|
|
2490
|
+
body: WebhookMessageSentWebhookPayload;
|
|
2491
|
+
key: 'message.sent';
|
|
2492
|
+
path?: never;
|
|
2493
|
+
query?: never;
|
|
2494
|
+
};
|
|
2495
|
+
export type WebhookMessageDeliveredWebhookPayload = WebhookEvent;
|
|
2496
|
+
export type WebhookMessageDeliveredWebhookRequest = {
|
|
2497
|
+
body: WebhookMessageDeliveredWebhookPayload;
|
|
2498
|
+
key: 'message.delivered';
|
|
2499
|
+
path?: never;
|
|
2500
|
+
query?: never;
|
|
2501
|
+
};
|
|
2502
|
+
export type WebhookMessageReadWebhookPayload = WebhookEvent;
|
|
2503
|
+
export type WebhookMessageReadWebhookRequest = {
|
|
2504
|
+
body: WebhookMessageReadWebhookPayload;
|
|
2505
|
+
key: 'message.read';
|
|
2506
|
+
path?: never;
|
|
2507
|
+
query?: never;
|
|
2508
|
+
};
|
|
2509
|
+
export type WebhookMessageFailedWebhookPayload = WebhookEvent;
|
|
2510
|
+
export type WebhookMessageFailedWebhookRequest = {
|
|
2511
|
+
body: WebhookMessageFailedWebhookPayload;
|
|
2512
|
+
key: 'message.failed';
|
|
2513
|
+
path?: never;
|
|
2514
|
+
query?: never;
|
|
2515
|
+
};
|
|
2516
|
+
export type WebhookConversationOpenedWebhookPayload = WebhookEvent;
|
|
2517
|
+
export type WebhookConversationOpenedWebhookRequest = {
|
|
2518
|
+
body: WebhookConversationOpenedWebhookPayload;
|
|
2519
|
+
key: 'conversation.opened';
|
|
2520
|
+
path?: never;
|
|
2521
|
+
query?: never;
|
|
2522
|
+
};
|
|
2523
|
+
export type WebhookConversationClosedWebhookPayload = WebhookEvent;
|
|
2524
|
+
export type WebhookConversationClosedWebhookRequest = {
|
|
2525
|
+
body: WebhookConversationClosedWebhookPayload;
|
|
2526
|
+
key: 'conversation.closed';
|
|
2527
|
+
path?: never;
|
|
2528
|
+
query?: never;
|
|
2529
|
+
};
|
|
2530
|
+
export type WebhookConversationAssignmentChangedWebhookPayload = WebhookEvent;
|
|
2531
|
+
export type WebhookConversationAssignmentChangedWebhookRequest = {
|
|
2532
|
+
body: WebhookConversationAssignmentChangedWebhookPayload;
|
|
2533
|
+
key: 'conversation.assignment_changed';
|
|
2534
|
+
path?: never;
|
|
2535
|
+
query?: never;
|
|
2536
|
+
};
|
|
2537
|
+
export type WebhookContactCreatedWebhookPayload = WebhookEvent;
|
|
2538
|
+
export type WebhookContactCreatedWebhookRequest = {
|
|
2539
|
+
body: WebhookContactCreatedWebhookPayload;
|
|
2540
|
+
key: 'contact.created';
|
|
2541
|
+
path?: never;
|
|
2542
|
+
query?: never;
|
|
2543
|
+
};
|
|
2544
|
+
export type WebhookContactUpdatedWebhookPayload = WebhookEvent;
|
|
2545
|
+
export type WebhookContactUpdatedWebhookRequest = {
|
|
2546
|
+
body: WebhookContactUpdatedWebhookPayload;
|
|
2547
|
+
key: 'contact.updated';
|
|
2548
|
+
path?: never;
|
|
2549
|
+
query?: never;
|
|
2550
|
+
};
|
|
2551
|
+
export type WebhookWebhookTestWebhookPayload = WebhookEvent;
|
|
2552
|
+
export type WebhookWebhookTestWebhookRequest = {
|
|
2553
|
+
body: WebhookWebhookTestWebhookPayload;
|
|
2554
|
+
key: 'webhook.test';
|
|
2555
|
+
path?: never;
|
|
2556
|
+
query?: never;
|
|
2557
|
+
};
|