getricky 0.1.5 → 0.1.6

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.
@@ -2054,6 +2054,113 @@ export type ResolutionsReport = {
2054
2054
  */
2055
2055
  generated_at: string;
2056
2056
  };
2057
+ /**
2058
+ * The result of checking a template draft without submitting it.
2059
+ */
2060
+ export type TemplateValidation = {
2061
+ /**
2062
+ * Whether `POST /templates` would submit this draft to Meta.
2063
+ */
2064
+ valid: boolean;
2065
+ /**
2066
+ * Every problem found; empty when the draft is valid.
2067
+ */
2068
+ errors: Array<{
2069
+ /**
2070
+ * The request field the problem is in.
2071
+ */
2072
+ param: string;
2073
+ /**
2074
+ * What to change.
2075
+ */
2076
+ message: string;
2077
+ }>;
2078
+ /**
2079
+ * The components Ricky would submit, in the WhatsApp Cloud API format; null when the draft is invalid.
2080
+ */
2081
+ components: Array<{
2082
+ [key: string]: unknown;
2083
+ }> | null;
2084
+ };
2085
+ /**
2086
+ * A template Meta deleted.
2087
+ */
2088
+ export type DeletedTemplate = {
2089
+ /**
2090
+ * Template ID at Meta.
2091
+ */
2092
+ id: string;
2093
+ deleted: true;
2094
+ };
2095
+ /**
2096
+ * A WhatsApp number, with its status, quality and messaging limit at Meta.
2097
+ */
2098
+ export type WhatsAppNumber = {
2099
+ /**
2100
+ * Channel ID.
2101
+ */
2102
+ id: string;
2103
+ /**
2104
+ * Name shown in Ricky.
2105
+ */
2106
+ name: string;
2107
+ /**
2108
+ * Phone in E.164.
2109
+ */
2110
+ phone_number: string | null;
2111
+ /**
2112
+ * Business name Meta approved for the number.
2113
+ */
2114
+ verified_name: string | null;
2115
+ /**
2116
+ * Phone number ID at Meta.
2117
+ */
2118
+ phone_number_id: string | null;
2119
+ /**
2120
+ * WhatsApp Business Account that owns the number.
2121
+ */
2122
+ whatsapp_business_account_id: string | null;
2123
+ /**
2124
+ * `coexistence` when the number also stays on the WhatsApp Business app; `dedicated` otherwise.
2125
+ */
2126
+ connection_mode: 'dedicated' | 'coexistence' | null;
2127
+ /**
2128
+ * Status of the number at Meta, as Meta reports it, for example `CONNECTED`.
2129
+ */
2130
+ status: string | null;
2131
+ /**
2132
+ * When the number was disconnected from Ricky; null while connected.
2133
+ */
2134
+ disconnected_at: string | null;
2135
+ /**
2136
+ * Whether Meta lets the number send: `available`, `limited` or `blocked`.
2137
+ */
2138
+ messaging_health: 'available' | 'limited' | 'blocked';
2139
+ /**
2140
+ * Quality rating at Meta: `GREEN`, `YELLOW`, `RED` or `UNKNOWN`.
2141
+ */
2142
+ quality_rating: string | null;
2143
+ /**
2144
+ * Messaging limit tier at Meta, for example `TIER_1K` or `TIER_UNLIMITED`.
2145
+ */
2146
+ messaging_limit: string | null;
2147
+ /**
2148
+ * Whether Ricky receives the messages sent to the number.
2149
+ */
2150
+ inbound_processing_enabled: boolean | null;
2151
+ /**
2152
+ * Whether customers can call the number and reach the AI agent.
2153
+ */
2154
+ calls_enabled: boolean | null;
2155
+ /**
2156
+ * When it was connected.
2157
+ */
2158
+ connected_at: string | null;
2159
+ /**
2160
+ * When Ricky last read its details from Meta.
2161
+ */
2162
+ last_synced_at: string | null;
2163
+ };
2057
2164
  /**
2058
2165
  * An automation Ricky runs for the organization.
2059
2166
  */
@@ -3147,6 +3254,245 @@ export type UpdateKnowledgeFile = {
3147
3254
  */
3148
3255
  send_enabled?: boolean;
3149
3256
  };
3257
+ /**
3258
+ * A template draft. Ricky checks it as `POST /templates/validate` does, then submits it.
3259
+ */
3260
+ export type CreateTemplate = {
3261
+ /**
3262
+ * WhatsApp channel whose business account will own the template.
3263
+ */
3264
+ channel_id: string;
3265
+ /**
3266
+ * Lowercase letters, digits and underscores, starting with a letter.
3267
+ */
3268
+ name: string;
3269
+ /**
3270
+ * Language code, for example `es` or `en_US`.
3271
+ */
3272
+ language: string;
3273
+ /**
3274
+ * `UTILITY` for updates on something the customer asked for; `MARKETING` otherwise.
3275
+ */
3276
+ category: 'MARKETING' | 'UTILITY';
3277
+ /**
3278
+ * How variables are written: `{{first_name}}` or `{{1}}`. It cannot change later.
3279
+ */
3280
+ parameter_format?: 'NAMED' | 'POSITIONAL';
3281
+ /**
3282
+ * `TEXT` or `LOCATION`. Send `null` for no header.
3283
+ */
3284
+ header?: {
3285
+ type: 'TEXT';
3286
+ /**
3287
+ * Header text; at most one variable.
3288
+ */
3289
+ text: string;
3290
+ /**
3291
+ * Example value of the header variable; required when it has one.
3292
+ */
3293
+ example?: string;
3294
+ } | {
3295
+ type: 'LOCATION';
3296
+ } | null;
3297
+ /**
3298
+ * The message text.
3299
+ */
3300
+ body: {
3301
+ /**
3302
+ * Body text. Variables are `{{1}}`, `{{2}}`… for `POSITIONAL` and `{{first_name}}` for `NAMED`; not at the very start or end.
3303
+ */
3304
+ text: string;
3305
+ /**
3306
+ * An example value for every variable, keyed by its number or name without braces. Meta reviews them.
3307
+ */
3308
+ examples?: {
3309
+ [key: string]: string;
3310
+ };
3311
+ };
3312
+ /**
3313
+ * Footer text, without variables.
3314
+ */
3315
+ footer?: string | null;
3316
+ /**
3317
+ * Quick replies, at most two links and one phone. Quick replies cannot sit between the other buttons.
3318
+ */
3319
+ buttons?: Array<{
3320
+ type: 'QUICK_REPLY';
3321
+ text: string;
3322
+ } | {
3323
+ type: 'URL';
3324
+ text: string;
3325
+ /**
3326
+ * Link the button opens; it may end in the variable `{{1}}`.
3327
+ */
3328
+ url: string;
3329
+ /**
3330
+ * Example URL for a link with `{{1}}`; required when it has one.
3331
+ */
3332
+ example?: string;
3333
+ } | {
3334
+ type: 'PHONE_NUMBER';
3335
+ text: string;
3336
+ /**
3337
+ * Phone the button calls, with country code.
3338
+ */
3339
+ phone_number: string;
3340
+ }>;
3341
+ };
3342
+ /**
3343
+ * The body of `POST /templates`; `channel_id` is optional here.
3344
+ */
3345
+ export type ValidateTemplate = {
3346
+ /**
3347
+ * WhatsApp channel whose business account will own the template.
3348
+ */
3349
+ channel_id?: string;
3350
+ /**
3351
+ * Lowercase letters, digits and underscores, starting with a letter.
3352
+ */
3353
+ name: string;
3354
+ /**
3355
+ * Language code, for example `es` or `en_US`.
3356
+ */
3357
+ language: string;
3358
+ /**
3359
+ * `UTILITY` for updates on something the customer asked for; `MARKETING` otherwise.
3360
+ */
3361
+ category: 'MARKETING' | 'UTILITY';
3362
+ /**
3363
+ * How variables are written: `{{first_name}}` or `{{1}}`. It cannot change later.
3364
+ */
3365
+ parameter_format?: 'NAMED' | 'POSITIONAL';
3366
+ /**
3367
+ * `TEXT` or `LOCATION`. Send `null` for no header.
3368
+ */
3369
+ header?: {
3370
+ type: 'TEXT';
3371
+ /**
3372
+ * Header text; at most one variable.
3373
+ */
3374
+ text: string;
3375
+ /**
3376
+ * Example value of the header variable; required when it has one.
3377
+ */
3378
+ example?: string;
3379
+ } | {
3380
+ type: 'LOCATION';
3381
+ } | null;
3382
+ /**
3383
+ * The message text.
3384
+ */
3385
+ body: {
3386
+ /**
3387
+ * Body text. Variables are `{{1}}`, `{{2}}`… for `POSITIONAL` and `{{first_name}}` for `NAMED`; not at the very start or end.
3388
+ */
3389
+ text: string;
3390
+ /**
3391
+ * An example value for every variable, keyed by its number or name without braces. Meta reviews them.
3392
+ */
3393
+ examples?: {
3394
+ [key: string]: string;
3395
+ };
3396
+ };
3397
+ /**
3398
+ * Footer text, without variables.
3399
+ */
3400
+ footer?: string | null;
3401
+ /**
3402
+ * Quick replies, at most two links and one phone. Quick replies cannot sit between the other buttons.
3403
+ */
3404
+ buttons?: Array<{
3405
+ type: 'QUICK_REPLY';
3406
+ text: string;
3407
+ } | {
3408
+ type: 'URL';
3409
+ text: string;
3410
+ /**
3411
+ * Link the button opens; it may end in the variable `{{1}}`.
3412
+ */
3413
+ url: string;
3414
+ /**
3415
+ * Example URL for a link with `{{1}}`; required when it has one.
3416
+ */
3417
+ example?: string;
3418
+ } | {
3419
+ type: 'PHONE_NUMBER';
3420
+ text: string;
3421
+ /**
3422
+ * Phone the button calls, with country code.
3423
+ */
3424
+ phone_number: string;
3425
+ }>;
3426
+ };
3427
+ /**
3428
+ * Only the parts you send change; `buttons` replaces every button. Name, language and `parameter_format` cannot change.
3429
+ */
3430
+ export type UpdateTemplate = {
3431
+ /**
3432
+ * `UTILITY` for updates on something the customer asked for; `MARKETING` otherwise.
3433
+ */
3434
+ category?: 'MARKETING' | 'UTILITY';
3435
+ /**
3436
+ * `TEXT` or `LOCATION`. Send `null` for no header.
3437
+ */
3438
+ header?: {
3439
+ type: 'TEXT';
3440
+ /**
3441
+ * Header text; at most one variable.
3442
+ */
3443
+ text: string;
3444
+ /**
3445
+ * Example value of the header variable; required when it has one.
3446
+ */
3447
+ example?: string;
3448
+ } | {
3449
+ type: 'LOCATION';
3450
+ } | null;
3451
+ /**
3452
+ * The message text.
3453
+ */
3454
+ body?: {
3455
+ /**
3456
+ * Body text. Variables are `{{1}}`, `{{2}}`… for `POSITIONAL` and `{{first_name}}` for `NAMED`; not at the very start or end.
3457
+ */
3458
+ text: string;
3459
+ /**
3460
+ * An example value for every variable, keyed by its number or name without braces. Meta reviews them.
3461
+ */
3462
+ examples?: {
3463
+ [key: string]: string;
3464
+ };
3465
+ };
3466
+ /**
3467
+ * Footer text, without variables.
3468
+ */
3469
+ footer?: string | null;
3470
+ /**
3471
+ * Quick replies, at most two links and one phone. Quick replies cannot sit between the other buttons.
3472
+ */
3473
+ buttons?: Array<{
3474
+ type: 'QUICK_REPLY';
3475
+ text: string;
3476
+ } | {
3477
+ type: 'URL';
3478
+ text: string;
3479
+ /**
3480
+ * Link the button opens; it may end in the variable `{{1}}`.
3481
+ */
3482
+ url: string;
3483
+ /**
3484
+ * Example URL for a link with `{{1}}`; required when it has one.
3485
+ */
3486
+ example?: string;
3487
+ } | {
3488
+ type: 'PHONE_NUMBER';
3489
+ text: string;
3490
+ /**
3491
+ * Phone the button calls, with country code.
3492
+ */
3493
+ phone_number: string;
3494
+ }>;
3495
+ };
3150
3496
  /**
3151
3497
  * Creates a conversation workflow as a `draft`. Activating it is a separate call.
3152
3498
  */
@@ -4816,48 +5162,6 @@ export type CreateTagResponses = {
4816
5162
  };
4817
5163
  };
4818
5164
  export type CreateTagResponse = CreateTagResponses[keyof CreateTagResponses];
4819
- export type ListTemplatesData = {
4820
- body?: never;
4821
- path?: never;
4822
- query?: never;
4823
- url: '/templates';
4824
- };
4825
- export type ListTemplatesErrors = {
4826
- /**
4827
- * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
4828
- */
4829
- 401: Error;
4830
- /**
4831
- * `insufficient_scope`: The key lacks the scope this operation requires.
4832
- */
4833
- 403: Error;
4834
- /**
4835
- * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
4836
- */
4837
- 429: Error;
4838
- /**
4839
- * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
4840
- */
4841
- 500: Error;
4842
- /**
4843
- * `upstream_error`: The messaging provider failed. Retry later.
4844
- */
4845
- 502: Error;
4846
- };
4847
- export type ListTemplatesError = ListTemplatesErrors[keyof ListTemplatesErrors];
4848
- export type ListTemplatesResponses = {
4849
- /**
4850
- * Success.
4851
- */
4852
- 200: {
4853
- data: Array<Template>;
4854
- /**
4855
- * Pass as `cursor` for the next page; null on the last page.
4856
- */
4857
- next_cursor: string | null;
4858
- };
4859
- };
4860
- export type ListTemplatesResponse = ListTemplatesResponses[keyof ListTemplatesResponses];
4861
5165
  export type ListWebhooksData = {
4862
5166
  body?: never;
4863
5167
  path?: never;
@@ -8003,6 +8307,456 @@ export type UpdateQuickReplyResponses = {
8003
8307
  };
8004
8308
  };
8005
8309
  export type UpdateQuickReplyResponse = UpdateQuickReplyResponses[keyof UpdateQuickReplyResponses];
8310
+ export type ListTemplatesData = {
8311
+ body?: never;
8312
+ path?: never;
8313
+ query?: never;
8314
+ url: '/templates';
8315
+ };
8316
+ export type ListTemplatesErrors = {
8317
+ /**
8318
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8319
+ */
8320
+ 401: Error;
8321
+ /**
8322
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8323
+ */
8324
+ 403: Error;
8325
+ /**
8326
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8327
+ */
8328
+ 429: Error;
8329
+ /**
8330
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8331
+ */
8332
+ 500: Error;
8333
+ /**
8334
+ * `upstream_error`: The messaging provider failed. Retry later.
8335
+ */
8336
+ 502: Error;
8337
+ };
8338
+ export type ListTemplatesError = ListTemplatesErrors[keyof ListTemplatesErrors];
8339
+ export type ListTemplatesResponses = {
8340
+ /**
8341
+ * Success.
8342
+ */
8343
+ 200: {
8344
+ data: Array<Template>;
8345
+ /**
8346
+ * Pass as `cursor` for the next page; null on the last page.
8347
+ */
8348
+ next_cursor: string | null;
8349
+ };
8350
+ };
8351
+ export type ListTemplatesResponse = ListTemplatesResponses[keyof ListTemplatesResponses];
8352
+ export type CreateTemplateData = {
8353
+ body: CreateTemplate;
8354
+ headers?: {
8355
+ /**
8356
+ * 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.
8357
+ */
8358
+ 'Idempotency-Key'?: string;
8359
+ };
8360
+ path?: never;
8361
+ query?: never;
8362
+ url: '/templates';
8363
+ };
8364
+ export type CreateTemplateErrors = {
8365
+ /**
8366
+ * `invalid_json`: The body is not valid JSON.
8367
+ *
8368
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
8369
+ */
8370
+ 400: Error;
8371
+ /**
8372
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8373
+ */
8374
+ 401: Error;
8375
+ /**
8376
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8377
+ */
8378
+ 403: Error;
8379
+ /**
8380
+ * `not_found`: The resource does not exist in this organization.
8381
+ */
8382
+ 404: Error;
8383
+ /**
8384
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
8385
+ *
8386
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
8387
+ */
8388
+ 409: Error;
8389
+ /**
8390
+ * `body_too_large`: The JSON body exceeds 64 KiB.
8391
+ */
8392
+ 413: Error;
8393
+ /**
8394
+ * `unsupported_media_type`: The body must be `application/json`.
8395
+ */
8396
+ 415: Error;
8397
+ /**
8398
+ * `rule_violation`: The request breaks a business rule; `message` says which.
8399
+ */
8400
+ 422: Error;
8401
+ /**
8402
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8403
+ */
8404
+ 429: Error;
8405
+ /**
8406
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8407
+ */
8408
+ 500: Error;
8409
+ /**
8410
+ * `upstream_error`: The messaging provider failed. Retry later.
8411
+ */
8412
+ 502: Error;
8413
+ };
8414
+ export type CreateTemplateError = CreateTemplateErrors[keyof CreateTemplateErrors];
8415
+ export type CreateTemplateResponses = {
8416
+ /**
8417
+ * Success.
8418
+ */
8419
+ 201: {
8420
+ data: Template;
8421
+ };
8422
+ };
8423
+ export type CreateTemplateResponse = CreateTemplateResponses[keyof CreateTemplateResponses];
8424
+ export type DeleteTemplateData = {
8425
+ body?: never;
8426
+ headers?: {
8427
+ /**
8428
+ * 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.
8429
+ */
8430
+ 'Idempotency-Key'?: string;
8431
+ };
8432
+ path: {
8433
+ /**
8434
+ * Template ID.
8435
+ */
8436
+ template_id: string;
8437
+ };
8438
+ query?: never;
8439
+ url: '/templates/{template_id}';
8440
+ };
8441
+ export type DeleteTemplateErrors = {
8442
+ /**
8443
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
8444
+ */
8445
+ 400: Error;
8446
+ /**
8447
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8448
+ */
8449
+ 401: Error;
8450
+ /**
8451
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8452
+ */
8453
+ 403: Error;
8454
+ /**
8455
+ * `not_found`: The resource does not exist in this organization.
8456
+ */
8457
+ 404: Error;
8458
+ /**
8459
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
8460
+ *
8461
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
8462
+ *
8463
+ * `conflict`: The resource changed in a way that prevents the operation.
8464
+ */
8465
+ 409: Error;
8466
+ /**
8467
+ * `rule_violation`: The request breaks a business rule; `message` says which.
8468
+ */
8469
+ 422: Error;
8470
+ /**
8471
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8472
+ */
8473
+ 429: Error;
8474
+ /**
8475
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8476
+ */
8477
+ 500: Error;
8478
+ /**
8479
+ * `upstream_error`: The messaging provider failed. Retry later.
8480
+ */
8481
+ 502: Error;
8482
+ };
8483
+ export type DeleteTemplateError = DeleteTemplateErrors[keyof DeleteTemplateErrors];
8484
+ export type DeleteTemplateResponses = {
8485
+ /**
8486
+ * Success.
8487
+ */
8488
+ 200: {
8489
+ data: DeletedTemplate;
8490
+ };
8491
+ };
8492
+ export type DeleteTemplateResponse = DeleteTemplateResponses[keyof DeleteTemplateResponses];
8493
+ export type GetTemplateData = {
8494
+ body?: never;
8495
+ path: {
8496
+ /**
8497
+ * Template ID.
8498
+ */
8499
+ template_id: string;
8500
+ };
8501
+ query?: never;
8502
+ url: '/templates/{template_id}';
8503
+ };
8504
+ export type GetTemplateErrors = {
8505
+ /**
8506
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
8507
+ */
8508
+ 400: Error;
8509
+ /**
8510
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8511
+ */
8512
+ 401: Error;
8513
+ /**
8514
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8515
+ */
8516
+ 403: Error;
8517
+ /**
8518
+ * `not_found`: The resource does not exist in this organization.
8519
+ */
8520
+ 404: Error;
8521
+ /**
8522
+ * `conflict`: The resource changed in a way that prevents the operation.
8523
+ */
8524
+ 409: Error;
8525
+ /**
8526
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8527
+ */
8528
+ 429: Error;
8529
+ /**
8530
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8531
+ */
8532
+ 500: Error;
8533
+ /**
8534
+ * `upstream_error`: The messaging provider failed. Retry later.
8535
+ */
8536
+ 502: Error;
8537
+ };
8538
+ export type GetTemplateError = GetTemplateErrors[keyof GetTemplateErrors];
8539
+ export type GetTemplateResponses = {
8540
+ /**
8541
+ * Success.
8542
+ */
8543
+ 200: {
8544
+ data: Template;
8545
+ };
8546
+ };
8547
+ export type GetTemplateResponse = GetTemplateResponses[keyof GetTemplateResponses];
8548
+ export type UpdateTemplateData = {
8549
+ body: UpdateTemplate;
8550
+ headers?: {
8551
+ /**
8552
+ * 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.
8553
+ */
8554
+ 'Idempotency-Key'?: string;
8555
+ };
8556
+ path: {
8557
+ /**
8558
+ * Template ID.
8559
+ */
8560
+ template_id: string;
8561
+ };
8562
+ query?: never;
8563
+ url: '/templates/{template_id}';
8564
+ };
8565
+ export type UpdateTemplateErrors = {
8566
+ /**
8567
+ * `invalid_json`: The body is not valid JSON.
8568
+ *
8569
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
8570
+ */
8571
+ 400: Error;
8572
+ /**
8573
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8574
+ */
8575
+ 401: Error;
8576
+ /**
8577
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8578
+ */
8579
+ 403: Error;
8580
+ /**
8581
+ * `not_found`: The resource does not exist in this organization.
8582
+ */
8583
+ 404: Error;
8584
+ /**
8585
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
8586
+ *
8587
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
8588
+ *
8589
+ * `conflict`: The resource changed in a way that prevents the operation.
8590
+ */
8591
+ 409: Error;
8592
+ /**
8593
+ * `body_too_large`: The JSON body exceeds 64 KiB.
8594
+ */
8595
+ 413: Error;
8596
+ /**
8597
+ * `unsupported_media_type`: The body must be `application/json`.
8598
+ */
8599
+ 415: Error;
8600
+ /**
8601
+ * `rule_violation`: The request breaks a business rule; `message` says which.
8602
+ */
8603
+ 422: Error;
8604
+ /**
8605
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8606
+ */
8607
+ 429: Error;
8608
+ /**
8609
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8610
+ */
8611
+ 500: Error;
8612
+ /**
8613
+ * `upstream_error`: The messaging provider failed. Retry later.
8614
+ */
8615
+ 502: Error;
8616
+ };
8617
+ export type UpdateTemplateError = UpdateTemplateErrors[keyof UpdateTemplateErrors];
8618
+ export type UpdateTemplateResponses = {
8619
+ /**
8620
+ * Success.
8621
+ */
8622
+ 200: {
8623
+ data: Template;
8624
+ };
8625
+ };
8626
+ export type UpdateTemplateResponse = UpdateTemplateResponses[keyof UpdateTemplateResponses];
8627
+ export type ValidateTemplateData = {
8628
+ body: ValidateTemplate;
8629
+ path?: never;
8630
+ query?: never;
8631
+ url: '/templates/validate';
8632
+ };
8633
+ export type ValidateTemplateErrors = {
8634
+ /**
8635
+ * `invalid_json`: The body is not valid JSON.
8636
+ *
8637
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
8638
+ */
8639
+ 400: Error;
8640
+ /**
8641
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8642
+ */
8643
+ 401: Error;
8644
+ /**
8645
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8646
+ */
8647
+ 403: Error;
8648
+ /**
8649
+ * `body_too_large`: The JSON body exceeds 64 KiB.
8650
+ */
8651
+ 413: Error;
8652
+ /**
8653
+ * `unsupported_media_type`: The body must be `application/json`.
8654
+ */
8655
+ 415: Error;
8656
+ /**
8657
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8658
+ */
8659
+ 429: Error;
8660
+ /**
8661
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8662
+ */
8663
+ 500: Error;
8664
+ };
8665
+ export type ValidateTemplateError = ValidateTemplateErrors[keyof ValidateTemplateErrors];
8666
+ export type ValidateTemplateResponses = {
8667
+ /**
8668
+ * Success.
8669
+ */
8670
+ 200: {
8671
+ data: TemplateValidation;
8672
+ };
8673
+ };
8674
+ export type ValidateTemplateResponse = ValidateTemplateResponses[keyof ValidateTemplateResponses];
8675
+ export type ListWhatsAppNumbersData = {
8676
+ body?: never;
8677
+ path?: never;
8678
+ query?: never;
8679
+ url: '/whatsapp-numbers';
8680
+ };
8681
+ export type ListWhatsAppNumbersErrors = {
8682
+ /**
8683
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8684
+ */
8685
+ 401: Error;
8686
+ /**
8687
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8688
+ */
8689
+ 403: Error;
8690
+ /**
8691
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8692
+ */
8693
+ 429: Error;
8694
+ /**
8695
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8696
+ */
8697
+ 500: Error;
8698
+ };
8699
+ export type ListWhatsAppNumbersError = ListWhatsAppNumbersErrors[keyof ListWhatsAppNumbersErrors];
8700
+ export type ListWhatsAppNumbersResponses = {
8701
+ /**
8702
+ * Success.
8703
+ */
8704
+ 200: {
8705
+ data: Array<WhatsAppNumber>;
8706
+ /**
8707
+ * Pass as `cursor` for the next page; null on the last page.
8708
+ */
8709
+ next_cursor: string | null;
8710
+ };
8711
+ };
8712
+ export type ListWhatsAppNumbersResponse = ListWhatsAppNumbersResponses[keyof ListWhatsAppNumbersResponses];
8713
+ export type GetWhatsAppNumberData = {
8714
+ body?: never;
8715
+ path: {
8716
+ /**
8717
+ * Channel ID.
8718
+ */
8719
+ channel_id: string;
8720
+ };
8721
+ query?: never;
8722
+ url: '/whatsapp-numbers/{channel_id}';
8723
+ };
8724
+ export type GetWhatsAppNumberErrors = {
8725
+ /**
8726
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
8727
+ */
8728
+ 400: Error;
8729
+ /**
8730
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8731
+ */
8732
+ 401: Error;
8733
+ /**
8734
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8735
+ */
8736
+ 403: Error;
8737
+ /**
8738
+ * `not_found`: The resource does not exist in this organization.
8739
+ */
8740
+ 404: Error;
8741
+ /**
8742
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8743
+ */
8744
+ 429: Error;
8745
+ /**
8746
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8747
+ */
8748
+ 500: Error;
8749
+ };
8750
+ export type GetWhatsAppNumberError = GetWhatsAppNumberErrors[keyof GetWhatsAppNumberErrors];
8751
+ export type GetWhatsAppNumberResponses = {
8752
+ /**
8753
+ * Success.
8754
+ */
8755
+ 200: {
8756
+ data: WhatsAppNumber;
8757
+ };
8758
+ };
8759
+ export type GetWhatsAppNumberResponse = GetWhatsAppNumberResponses[keyof GetWhatsAppNumberResponses];
8006
8760
  export type WebhookMessageReceivedWebhookPayload = WebhookEvent;
8007
8761
  export type WebhookMessageReceivedWebhookRequest = {
8008
8762
  body: WebhookMessageReceivedWebhookPayload;