getricky 0.1.11 → 0.1.12

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.
@@ -2741,6 +2741,96 @@ export type WorkflowExecution = {
2741
2741
  */
2742
2742
  processed_at: string | null;
2743
2743
  };
2744
+ /**
2745
+ * Where to put the bytes of a file Ricky forwards to Meta.
2746
+ */
2747
+ export type MediaUpload = {
2748
+ /**
2749
+ * Where the bytes wait in Ricky; send it to the `complete` operation.
2750
+ */
2751
+ upload_path: string;
2752
+ /**
2753
+ * Signed URL valid for two hours. `PUT` the file bytes to it with `Content-Type` set to `mime_type`, then call the `complete` operation. Ricky deletes the file once it completes, whether or not Meta takes it.
2754
+ */
2755
+ upload_url: string;
2756
+ };
2757
+ /**
2758
+ * A header sample Meta holds for a template review.
2759
+ */
2760
+ export type TemplateMedia = {
2761
+ /**
2762
+ * Meta’s handle for the sample. Send it as `header.handle` of `POST /templates` or `PATCH /templates/{template_id}`.
2763
+ */
2764
+ handle: string;
2765
+ };
2766
+ /**
2767
+ * The contact fields that fill a template’s variables when Ricky sends it to a contact. They apply to the template’s name and language in its business account.
2768
+ */
2769
+ export type TemplateFieldMappings = {
2770
+ /**
2771
+ * Template ID at Meta.
2772
+ */
2773
+ template_id: string;
2774
+ /**
2775
+ * Every variable a contact field can fill: those of the header and the body, and each copy-code button or link that ends in a variable.
2776
+ */
2777
+ variables: Array<{
2778
+ /**
2779
+ * Where the variable is.
2780
+ */
2781
+ component: 'header' | 'body' | 'button';
2782
+ /**
2783
+ * The variable: its number or name, or the button position from `0` for a button.
2784
+ */
2785
+ key: string;
2786
+ /**
2787
+ * The variable as the template writes it, for example `{{1}}`; for a button, its text.
2788
+ */
2789
+ name: string | null;
2790
+ }>;
2791
+ /**
2792
+ * The variables that have a contact field; the others are filled by hand.
2793
+ */
2794
+ mappings: Array<{
2795
+ /**
2796
+ * Where the variable is.
2797
+ */
2798
+ component: 'header' | 'body' | 'button';
2799
+ /**
2800
+ * The variable it fills.
2801
+ */
2802
+ key: string;
2803
+ /**
2804
+ * The contact field whose value fills the variable.
2805
+ */
2806
+ source: {
2807
+ kind: 'native';
2808
+ /**
2809
+ * A field every contact has.
2810
+ */
2811
+ field: 'first_name' | 'last_name' | 'primary_phone' | 'primary_email' | 'company' | 'job_title' | 'birthday' | 'street_address' | 'city' | 'region' | 'postal_code' | 'country' | 'website_url' | 'linkedin_url' | 'lifecycle_stage' | 'lead_status' | 'source' | 'notes';
2812
+ } | {
2813
+ kind: 'custom';
2814
+ /**
2815
+ * A custom field, from `GET /contact-fields`.
2816
+ */
2817
+ field_id: string;
2818
+ };
2819
+ }>;
2820
+ };
2821
+ /**
2822
+ * A display name change Meta is reviewing.
2823
+ */
2824
+ export type DisplayNameRequest = {
2825
+ /**
2826
+ * The name sent to Meta for review.
2827
+ */
2828
+ requested_display_name: string;
2829
+ /**
2830
+ * Meta reviews the name. When Meta approves it, the number’s `verified_name` and `name_status` change; `POST /whatsapp-numbers/{channel_id}/refresh` reads them.
2831
+ */
2832
+ status: 'pending_review';
2833
+ };
2744
2834
  /**
2745
2835
  * The result of checking a template draft without submitting it.
2746
2836
  */
@@ -2847,6 +2937,43 @@ export type WhatsAppNumber = {
2847
2937
  * When Ricky last read its details from Meta.
2848
2938
  */
2849
2939
  last_synced_at: string | null;
2940
+ /**
2941
+ * Review status of the display name at Meta, in lowercase: for example `approved`, `pending_review` or `declined`.
2942
+ */
2943
+ name_status: string | null;
2944
+ /**
2945
+ * The business profile customers see on WhatsApp, as Ricky last read it from Meta.
2946
+ */
2947
+ business_profile: {
2948
+ /**
2949
+ * Short text under the business name.
2950
+ */
2951
+ about: string | null;
2952
+ /**
2953
+ * Description of the business.
2954
+ */
2955
+ description: string | null;
2956
+ /**
2957
+ * Address of the business.
2958
+ */
2959
+ address: string | null;
2960
+ /**
2961
+ * Contact email.
2962
+ */
2963
+ email: string | null;
2964
+ /**
2965
+ * Industry as Meta names it.
2966
+ */
2967
+ vertical: string | null;
2968
+ /**
2969
+ * Website URLs.
2970
+ */
2971
+ websites: Array<string>;
2972
+ /**
2973
+ * Link to the profile photo at Meta; it expires.
2974
+ */
2975
+ profile_picture_url: string | null;
2976
+ };
2850
2977
  };
2851
2978
  /**
2852
2979
  * Only `name` is required; it does not connect the agent to any channel.
@@ -4224,6 +4351,139 @@ export type UpdateWorkflow = {
4224
4351
  };
4225
4352
  };
4226
4353
  };
4354
+ /**
4355
+ * Begins the upload of a header sample. Ricky answers where to `PUT` the bytes.
4356
+ */
4357
+ export type CreateTemplateMediaUpload = {
4358
+ /**
4359
+ * WhatsApp channel whose business account will use the sample.
4360
+ */
4361
+ channel_id: string;
4362
+ /**
4363
+ * JPEG or PNG up to 5 MB for an `IMAGE` header, MP4 or 3GPP up to 16 MB for `VIDEO`, PDF up to 100 MB for `DOCUMENT`.
4364
+ */
4365
+ mime_type: 'image/jpeg' | 'image/png' | 'video/mp4' | 'video/3gpp' | 'application/pdf';
4366
+ /**
4367
+ * Exact size of the file you will upload.
4368
+ */
4369
+ size_bytes: number;
4370
+ };
4371
+ /**
4372
+ * The upload to send to Meta, with the channel it began with.
4373
+ */
4374
+ export type CompleteTemplateMediaUpload = {
4375
+ /**
4376
+ * WhatsApp channel whose business account will use the sample.
4377
+ */
4378
+ channel_id: string;
4379
+ /**
4380
+ * The `upload_path` the upload began with.
4381
+ */
4382
+ upload_path: string;
4383
+ };
4384
+ /**
4385
+ * The contact fields that fill the template’s variables when Ricky sends it.
4386
+ */
4387
+ export type ReplaceTemplateFieldMappings = {
4388
+ /**
4389
+ * Every mapping of the template; the ones not sent are removed. Send `[]` to remove all.
4390
+ */
4391
+ mappings: Array<{
4392
+ /**
4393
+ * Where the variable is: `header`, `body` or a `button`.
4394
+ */
4395
+ component: 'header' | 'body' | 'button';
4396
+ /**
4397
+ * The variable: its number or name without braces, or the button position from `0` for a button.
4398
+ */
4399
+ key: string;
4400
+ /**
4401
+ * The contact field whose value fills the variable.
4402
+ */
4403
+ source: {
4404
+ kind: 'native';
4405
+ /**
4406
+ * A field every contact has.
4407
+ */
4408
+ field: 'first_name' | 'last_name' | 'primary_phone' | 'primary_email' | 'company' | 'job_title' | 'birthday' | 'street_address' | 'city' | 'region' | 'postal_code' | 'country' | 'website_url' | 'linkedin_url' | 'lifecycle_stage' | 'lead_status' | 'source' | 'notes';
4409
+ } | {
4410
+ kind: 'custom';
4411
+ /**
4412
+ * A custom field, from `GET /contact-fields`.
4413
+ */
4414
+ field_id: string;
4415
+ };
4416
+ }>;
4417
+ };
4418
+ /**
4419
+ * The settings of the number that Ricky changes at Meta.
4420
+ */
4421
+ export type UpdateWhatsAppNumber = {
4422
+ /**
4423
+ * Whether customers can call the number and reach the AI agent.
4424
+ */
4425
+ calls_enabled: boolean;
4426
+ };
4427
+ /**
4428
+ * Only the fields you send change; Meta checks the values too.
4429
+ */
4430
+ export type UpdateWhatsAppBusinessProfile = {
4431
+ /**
4432
+ * Short text under the business name, up to 139 characters.
4433
+ */
4434
+ about?: string;
4435
+ /**
4436
+ * Description of the business, up to 512 characters.
4437
+ */
4438
+ description?: string;
4439
+ /**
4440
+ * Address of the business, up to 256 characters.
4441
+ */
4442
+ address?: string;
4443
+ /**
4444
+ * Contact email, up to 128 characters.
4445
+ */
4446
+ email?: string;
4447
+ /**
4448
+ * Industry, in the values Meta accepts; `""` for none.
4449
+ */
4450
+ vertical?: '' | 'ALCOHOL' | 'APPAREL' | 'AUTO' | 'BEAUTY' | 'EDU' | 'ENTERTAIN' | 'EVENT_PLAN' | 'FINANCE' | 'GOVT' | 'GROCERY' | 'HEALTH' | 'HOTEL' | 'NONPROFIT' | 'ONLINE_GAMBLING' | 'OTC_DRUGS' | 'OTHER' | 'PHYSICAL_GAMBLING' | 'PROF_SERVICES' | 'RESTAURANT' | 'RETAIL' | 'TRAVEL';
4451
+ /**
4452
+ * Up to two website URLs; the list replaces the current one.
4453
+ */
4454
+ websites?: Array<string>;
4455
+ };
4456
+ /**
4457
+ * Begins the upload of a profile photo. Ricky answers where to `PUT` the bytes.
4458
+ */
4459
+ export type CreateProfilePhotoUpload = {
4460
+ /**
4461
+ * JPEG or PNG, up to 5 MB.
4462
+ */
4463
+ mime_type: 'image/jpeg' | 'image/png';
4464
+ /**
4465
+ * Exact size of the file you will upload.
4466
+ */
4467
+ size_bytes: number;
4468
+ };
4469
+ /**
4470
+ * The upload to set as the profile photo.
4471
+ */
4472
+ export type CompleteProfilePhotoUpload = {
4473
+ /**
4474
+ * The `upload_path` the upload began with.
4475
+ */
4476
+ upload_path: string;
4477
+ };
4478
+ /**
4479
+ * A new display name for Meta to review.
4480
+ */
4481
+ export type RequestDisplayName = {
4482
+ /**
4483
+ * The business name to show on the number. Meta reviews it against its rules.
4484
+ */
4485
+ display_name: string;
4486
+ };
4227
4487
  /**
4228
4488
  * A template draft. Ricky checks it as `POST /templates/validate` does, then submits it.
4229
4489
  */
@@ -4249,7 +4509,7 @@ export type CreateTemplate = {
4249
4509
  */
4250
4510
  parameter_format?: 'NAMED' | 'POSITIONAL';
4251
4511
  /**
4252
- * `TEXT` or `LOCATION`. Send `null` for no header.
4512
+ * `TEXT`, `IMAGE`, `VIDEO`, `DOCUMENT` or `LOCATION`. Send `null` for no header.
4253
4513
  */
4254
4514
  header?: {
4255
4515
  type: 'TEXT';
@@ -4261,6 +4521,24 @@ export type CreateTemplate = {
4261
4521
  * Example value of the header variable; required when it has one.
4262
4522
  */
4263
4523
  example?: string;
4524
+ } | {
4525
+ type: 'IMAGE';
4526
+ /**
4527
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4528
+ */
4529
+ handle: string;
4530
+ } | {
4531
+ type: 'VIDEO';
4532
+ /**
4533
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4534
+ */
4535
+ handle: string;
4536
+ } | {
4537
+ type: 'DOCUMENT';
4538
+ /**
4539
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4540
+ */
4541
+ handle: string;
4264
4542
  } | {
4265
4543
  type: 'LOCATION';
4266
4544
  } | null;
@@ -4334,7 +4612,7 @@ export type ValidateTemplate = {
4334
4612
  */
4335
4613
  parameter_format?: 'NAMED' | 'POSITIONAL';
4336
4614
  /**
4337
- * `TEXT` or `LOCATION`. Send `null` for no header.
4615
+ * `TEXT`, `IMAGE`, `VIDEO`, `DOCUMENT` or `LOCATION`. Send `null` for no header.
4338
4616
  */
4339
4617
  header?: {
4340
4618
  type: 'TEXT';
@@ -4346,6 +4624,24 @@ export type ValidateTemplate = {
4346
4624
  * Example value of the header variable; required when it has one.
4347
4625
  */
4348
4626
  example?: string;
4627
+ } | {
4628
+ type: 'IMAGE';
4629
+ /**
4630
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4631
+ */
4632
+ handle: string;
4633
+ } | {
4634
+ type: 'VIDEO';
4635
+ /**
4636
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4637
+ */
4638
+ handle: string;
4639
+ } | {
4640
+ type: 'DOCUMENT';
4641
+ /**
4642
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4643
+ */
4644
+ handle: string;
4349
4645
  } | {
4350
4646
  type: 'LOCATION';
4351
4647
  } | null;
@@ -4403,7 +4699,7 @@ export type UpdateTemplate = {
4403
4699
  */
4404
4700
  category?: 'MARKETING' | 'UTILITY';
4405
4701
  /**
4406
- * `TEXT` or `LOCATION`. Send `null` for no header.
4702
+ * `TEXT`, `IMAGE`, `VIDEO`, `DOCUMENT` or `LOCATION`. Send `null` for no header.
4407
4703
  */
4408
4704
  header?: {
4409
4705
  type: 'TEXT';
@@ -4415,6 +4711,24 @@ export type UpdateTemplate = {
4415
4711
  * Example value of the header variable; required when it has one.
4416
4712
  */
4417
4713
  example?: string;
4714
+ } | {
4715
+ type: 'IMAGE';
4716
+ /**
4717
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4718
+ */
4719
+ handle: string;
4720
+ } | {
4721
+ type: 'VIDEO';
4722
+ /**
4723
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4724
+ */
4725
+ handle: string;
4726
+ } | {
4727
+ type: 'DOCUMENT';
4728
+ /**
4729
+ * Handle of the sample file, from `POST /templates/media/complete`. Messages sent with the template carry their own file.
4730
+ */
4731
+ handle: string;
4418
4732
  } | {
4419
4733
  type: 'LOCATION';
4420
4734
  } | null;
@@ -9561,6 +9875,764 @@ export type GetWhatsAppNumberResponses = {
9561
9875
  };
9562
9876
  };
9563
9877
  export type GetWhatsAppNumberResponse = GetWhatsAppNumberResponses[keyof GetWhatsAppNumberResponses];
9878
+ export type UpdateWhatsAppNumberData = {
9879
+ body: UpdateWhatsAppNumber;
9880
+ headers?: {
9881
+ /**
9882
+ * 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.
9883
+ */
9884
+ 'Idempotency-Key'?: string;
9885
+ };
9886
+ path: {
9887
+ /**
9888
+ * Channel ID.
9889
+ */
9890
+ channel_id: string;
9891
+ };
9892
+ query?: never;
9893
+ url: '/whatsapp-numbers/{channel_id}';
9894
+ };
9895
+ export type UpdateWhatsAppNumberErrors = {
9896
+ /**
9897
+ * `invalid_json`: The body is not valid JSON.
9898
+ *
9899
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9900
+ */
9901
+ 400: Error;
9902
+ /**
9903
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9904
+ */
9905
+ 401: Error;
9906
+ /**
9907
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9908
+ */
9909
+ 403: Error;
9910
+ /**
9911
+ * `not_found`: The resource does not exist in this organization.
9912
+ */
9913
+ 404: Error;
9914
+ /**
9915
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9916
+ *
9917
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9918
+ */
9919
+ 409: Error;
9920
+ /**
9921
+ * `body_too_large`: The JSON body exceeds 64 KiB.
9922
+ */
9923
+ 413: Error;
9924
+ /**
9925
+ * `unsupported_media_type`: The body must be `application/json`.
9926
+ */
9927
+ 415: Error;
9928
+ /**
9929
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9930
+ */
9931
+ 422: Error;
9932
+ /**
9933
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9934
+ */
9935
+ 429: Error;
9936
+ /**
9937
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9938
+ */
9939
+ 500: Error;
9940
+ /**
9941
+ * `upstream_error`: The messaging provider failed. Retry later.
9942
+ */
9943
+ 502: Error;
9944
+ /**
9945
+ * `unavailable`: A dependency is temporarily unavailable. Retry later.
9946
+ */
9947
+ 503: Error;
9948
+ };
9949
+ export type UpdateWhatsAppNumberError = UpdateWhatsAppNumberErrors[keyof UpdateWhatsAppNumberErrors];
9950
+ export type UpdateWhatsAppNumberResponses = {
9951
+ /**
9952
+ * Success.
9953
+ */
9954
+ 200: {
9955
+ data: WhatsAppNumber;
9956
+ };
9957
+ };
9958
+ export type UpdateWhatsAppNumberResponse = UpdateWhatsAppNumberResponses[keyof UpdateWhatsAppNumberResponses];
9959
+ export type CreateTemplateMediaUploadData = {
9960
+ body: CreateTemplateMediaUpload;
9961
+ headers?: {
9962
+ /**
9963
+ * 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.
9964
+ */
9965
+ 'Idempotency-Key'?: string;
9966
+ };
9967
+ path?: never;
9968
+ query?: never;
9969
+ url: '/templates/media';
9970
+ };
9971
+ export type CreateTemplateMediaUploadErrors = {
9972
+ /**
9973
+ * `invalid_json`: The body is not valid JSON.
9974
+ *
9975
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9976
+ */
9977
+ 400: Error;
9978
+ /**
9979
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9980
+ */
9981
+ 401: Error;
9982
+ /**
9983
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9984
+ */
9985
+ 403: Error;
9986
+ /**
9987
+ * `not_found`: The resource does not exist in this organization.
9988
+ */
9989
+ 404: Error;
9990
+ /**
9991
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9992
+ *
9993
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9994
+ */
9995
+ 409: Error;
9996
+ /**
9997
+ * `body_too_large`: The JSON body exceeds 64 KiB.
9998
+ */
9999
+ 413: Error;
10000
+ /**
10001
+ * `unsupported_media_type`: The body must be `application/json`.
10002
+ */
10003
+ 415: Error;
10004
+ /**
10005
+ * `rule_violation`: The request breaks a business rule; `message` says which.
10006
+ */
10007
+ 422: Error;
10008
+ /**
10009
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10010
+ */
10011
+ 429: Error;
10012
+ /**
10013
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10014
+ */
10015
+ 500: Error;
10016
+ /**
10017
+ * `upstream_error`: The messaging provider failed. Retry later.
10018
+ */
10019
+ 502: Error;
10020
+ /**
10021
+ * `unavailable`: A dependency is temporarily unavailable. Retry later.
10022
+ */
10023
+ 503: Error;
10024
+ };
10025
+ export type CreateTemplateMediaUploadError = CreateTemplateMediaUploadErrors[keyof CreateTemplateMediaUploadErrors];
10026
+ export type CreateTemplateMediaUploadResponses = {
10027
+ /**
10028
+ * Success.
10029
+ */
10030
+ 201: {
10031
+ data: MediaUpload;
10032
+ };
10033
+ };
10034
+ export type CreateTemplateMediaUploadResponse = CreateTemplateMediaUploadResponses[keyof CreateTemplateMediaUploadResponses];
10035
+ export type CompleteTemplateMediaUploadData = {
10036
+ body: CompleteTemplateMediaUpload;
10037
+ headers?: {
10038
+ /**
10039
+ * 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.
10040
+ */
10041
+ 'Idempotency-Key'?: string;
10042
+ };
10043
+ path?: never;
10044
+ query?: never;
10045
+ url: '/templates/media/complete';
10046
+ };
10047
+ export type CompleteTemplateMediaUploadErrors = {
10048
+ /**
10049
+ * `invalid_json`: The body is not valid JSON.
10050
+ *
10051
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
10052
+ */
10053
+ 400: Error;
10054
+ /**
10055
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
10056
+ */
10057
+ 401: Error;
10058
+ /**
10059
+ * `insufficient_scope`: The key lacks the scope this operation requires.
10060
+ */
10061
+ 403: Error;
10062
+ /**
10063
+ * `not_found`: The resource does not exist in this organization.
10064
+ */
10065
+ 404: Error;
10066
+ /**
10067
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
10068
+ *
10069
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
10070
+ */
10071
+ 409: Error;
10072
+ /**
10073
+ * `body_too_large`: The JSON body exceeds 64 KiB.
10074
+ */
10075
+ 413: Error;
10076
+ /**
10077
+ * `unsupported_media_type`: The body must be `application/json`.
10078
+ */
10079
+ 415: Error;
10080
+ /**
10081
+ * `rule_violation`: The request breaks a business rule; `message` says which.
10082
+ */
10083
+ 422: Error;
10084
+ /**
10085
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10086
+ */
10087
+ 429: Error;
10088
+ /**
10089
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10090
+ */
10091
+ 500: Error;
10092
+ /**
10093
+ * `upstream_error`: The messaging provider failed. Retry later.
10094
+ */
10095
+ 502: Error;
10096
+ /**
10097
+ * `unavailable`: A dependency is temporarily unavailable. Retry later.
10098
+ */
10099
+ 503: Error;
10100
+ };
10101
+ export type CompleteTemplateMediaUploadError = CompleteTemplateMediaUploadErrors[keyof CompleteTemplateMediaUploadErrors];
10102
+ export type CompleteTemplateMediaUploadResponses = {
10103
+ /**
10104
+ * Success.
10105
+ */
10106
+ 200: {
10107
+ data: TemplateMedia;
10108
+ };
10109
+ };
10110
+ export type CompleteTemplateMediaUploadResponse = CompleteTemplateMediaUploadResponses[keyof CompleteTemplateMediaUploadResponses];
10111
+ export type GetTemplateFieldMappingsData = {
10112
+ body?: never;
10113
+ path: {
10114
+ /**
10115
+ * Template ID.
10116
+ */
10117
+ template_id: string;
10118
+ };
10119
+ query?: never;
10120
+ url: '/templates/{template_id}/field-mappings';
10121
+ };
10122
+ export type GetTemplateFieldMappingsErrors = {
10123
+ /**
10124
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
10125
+ */
10126
+ 400: Error;
10127
+ /**
10128
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
10129
+ */
10130
+ 401: Error;
10131
+ /**
10132
+ * `insufficient_scope`: The key lacks the scope this operation requires.
10133
+ */
10134
+ 403: Error;
10135
+ /**
10136
+ * `not_found`: The resource does not exist in this organization.
10137
+ */
10138
+ 404: Error;
10139
+ /**
10140
+ * `conflict`: The resource changed in a way that prevents the operation.
10141
+ */
10142
+ 409: Error;
10143
+ /**
10144
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10145
+ */
10146
+ 429: Error;
10147
+ /**
10148
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10149
+ */
10150
+ 500: Error;
10151
+ /**
10152
+ * `upstream_error`: The messaging provider failed. Retry later.
10153
+ */
10154
+ 502: Error;
10155
+ };
10156
+ export type GetTemplateFieldMappingsError = GetTemplateFieldMappingsErrors[keyof GetTemplateFieldMappingsErrors];
10157
+ export type GetTemplateFieldMappingsResponses = {
10158
+ /**
10159
+ * Success.
10160
+ */
10161
+ 200: {
10162
+ data: TemplateFieldMappings;
10163
+ };
10164
+ };
10165
+ export type GetTemplateFieldMappingsResponse = GetTemplateFieldMappingsResponses[keyof GetTemplateFieldMappingsResponses];
10166
+ export type ReplaceTemplateFieldMappingsData = {
10167
+ body: ReplaceTemplateFieldMappings;
10168
+ headers?: {
10169
+ /**
10170
+ * 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.
10171
+ */
10172
+ 'Idempotency-Key'?: string;
10173
+ };
10174
+ path: {
10175
+ /**
10176
+ * Template ID.
10177
+ */
10178
+ template_id: string;
10179
+ };
10180
+ query?: never;
10181
+ url: '/templates/{template_id}/field-mappings';
10182
+ };
10183
+ export type ReplaceTemplateFieldMappingsErrors = {
10184
+ /**
10185
+ * `invalid_json`: The body is not valid JSON.
10186
+ *
10187
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
10188
+ */
10189
+ 400: Error;
10190
+ /**
10191
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
10192
+ */
10193
+ 401: Error;
10194
+ /**
10195
+ * `insufficient_scope`: The key lacks the scope this operation requires.
10196
+ */
10197
+ 403: Error;
10198
+ /**
10199
+ * `not_found`: The resource does not exist in this organization.
10200
+ */
10201
+ 404: Error;
10202
+ /**
10203
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
10204
+ *
10205
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
10206
+ *
10207
+ * `conflict`: The resource changed in a way that prevents the operation.
10208
+ */
10209
+ 409: Error;
10210
+ /**
10211
+ * `body_too_large`: The JSON body exceeds 64 KiB.
10212
+ */
10213
+ 413: Error;
10214
+ /**
10215
+ * `unsupported_media_type`: The body must be `application/json`.
10216
+ */
10217
+ 415: Error;
10218
+ /**
10219
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10220
+ */
10221
+ 429: Error;
10222
+ /**
10223
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10224
+ */
10225
+ 500: Error;
10226
+ /**
10227
+ * `upstream_error`: The messaging provider failed. Retry later.
10228
+ */
10229
+ 502: Error;
10230
+ };
10231
+ export type ReplaceTemplateFieldMappingsError = ReplaceTemplateFieldMappingsErrors[keyof ReplaceTemplateFieldMappingsErrors];
10232
+ export type ReplaceTemplateFieldMappingsResponses = {
10233
+ /**
10234
+ * Success.
10235
+ */
10236
+ 200: {
10237
+ data: TemplateFieldMappings;
10238
+ };
10239
+ };
10240
+ export type ReplaceTemplateFieldMappingsResponse = ReplaceTemplateFieldMappingsResponses[keyof ReplaceTemplateFieldMappingsResponses];
10241
+ export type UpdateWhatsAppBusinessProfileData = {
10242
+ body: UpdateWhatsAppBusinessProfile;
10243
+ headers?: {
10244
+ /**
10245
+ * 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.
10246
+ */
10247
+ 'Idempotency-Key'?: string;
10248
+ };
10249
+ path: {
10250
+ /**
10251
+ * Channel ID.
10252
+ */
10253
+ channel_id: string;
10254
+ };
10255
+ query?: never;
10256
+ url: '/whatsapp-numbers/{channel_id}/business-profile';
10257
+ };
10258
+ export type UpdateWhatsAppBusinessProfileErrors = {
10259
+ /**
10260
+ * `invalid_json`: The body is not valid JSON.
10261
+ *
10262
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
10263
+ */
10264
+ 400: Error;
10265
+ /**
10266
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
10267
+ */
10268
+ 401: Error;
10269
+ /**
10270
+ * `insufficient_scope`: The key lacks the scope this operation requires.
10271
+ */
10272
+ 403: Error;
10273
+ /**
10274
+ * `not_found`: The resource does not exist in this organization.
10275
+ */
10276
+ 404: Error;
10277
+ /**
10278
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
10279
+ *
10280
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
10281
+ */
10282
+ 409: Error;
10283
+ /**
10284
+ * `body_too_large`: The JSON body exceeds 64 KiB.
10285
+ */
10286
+ 413: Error;
10287
+ /**
10288
+ * `unsupported_media_type`: The body must be `application/json`.
10289
+ */
10290
+ 415: Error;
10291
+ /**
10292
+ * `rule_violation`: The request breaks a business rule; `message` says which.
10293
+ */
10294
+ 422: Error;
10295
+ /**
10296
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10297
+ */
10298
+ 429: Error;
10299
+ /**
10300
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10301
+ */
10302
+ 500: Error;
10303
+ /**
10304
+ * `upstream_error`: The messaging provider failed. Retry later.
10305
+ */
10306
+ 502: Error;
10307
+ /**
10308
+ * `unavailable`: A dependency is temporarily unavailable. Retry later.
10309
+ */
10310
+ 503: Error;
10311
+ };
10312
+ export type UpdateWhatsAppBusinessProfileError = UpdateWhatsAppBusinessProfileErrors[keyof UpdateWhatsAppBusinessProfileErrors];
10313
+ export type UpdateWhatsAppBusinessProfileResponses = {
10314
+ /**
10315
+ * Success.
10316
+ */
10317
+ 200: {
10318
+ data: WhatsAppNumber;
10319
+ };
10320
+ };
10321
+ export type UpdateWhatsAppBusinessProfileResponse = UpdateWhatsAppBusinessProfileResponses[keyof UpdateWhatsAppBusinessProfileResponses];
10322
+ export type CreateProfilePhotoUploadData = {
10323
+ body: CreateProfilePhotoUpload;
10324
+ headers?: {
10325
+ /**
10326
+ * 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.
10327
+ */
10328
+ 'Idempotency-Key'?: string;
10329
+ };
10330
+ path: {
10331
+ /**
10332
+ * Channel ID.
10333
+ */
10334
+ channel_id: string;
10335
+ };
10336
+ query?: never;
10337
+ url: '/whatsapp-numbers/{channel_id}/profile-photo';
10338
+ };
10339
+ export type CreateProfilePhotoUploadErrors = {
10340
+ /**
10341
+ * `invalid_json`: The body is not valid JSON.
10342
+ *
10343
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
10344
+ */
10345
+ 400: Error;
10346
+ /**
10347
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
10348
+ */
10349
+ 401: Error;
10350
+ /**
10351
+ * `insufficient_scope`: The key lacks the scope this operation requires.
10352
+ */
10353
+ 403: Error;
10354
+ /**
10355
+ * `not_found`: The resource does not exist in this organization.
10356
+ */
10357
+ 404: Error;
10358
+ /**
10359
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
10360
+ *
10361
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
10362
+ */
10363
+ 409: Error;
10364
+ /**
10365
+ * `body_too_large`: The JSON body exceeds 64 KiB.
10366
+ */
10367
+ 413: Error;
10368
+ /**
10369
+ * `unsupported_media_type`: The body must be `application/json`.
10370
+ */
10371
+ 415: Error;
10372
+ /**
10373
+ * `rule_violation`: The request breaks a business rule; `message` says which.
10374
+ */
10375
+ 422: Error;
10376
+ /**
10377
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10378
+ */
10379
+ 429: Error;
10380
+ /**
10381
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10382
+ */
10383
+ 500: Error;
10384
+ /**
10385
+ * `upstream_error`: The messaging provider failed. Retry later.
10386
+ */
10387
+ 502: Error;
10388
+ /**
10389
+ * `unavailable`: A dependency is temporarily unavailable. Retry later.
10390
+ */
10391
+ 503: Error;
10392
+ };
10393
+ export type CreateProfilePhotoUploadError = CreateProfilePhotoUploadErrors[keyof CreateProfilePhotoUploadErrors];
10394
+ export type CreateProfilePhotoUploadResponses = {
10395
+ /**
10396
+ * Success.
10397
+ */
10398
+ 201: {
10399
+ data: MediaUpload;
10400
+ };
10401
+ };
10402
+ export type CreateProfilePhotoUploadResponse = CreateProfilePhotoUploadResponses[keyof CreateProfilePhotoUploadResponses];
10403
+ export type CompleteProfilePhotoUploadData = {
10404
+ body: CompleteProfilePhotoUpload;
10405
+ headers?: {
10406
+ /**
10407
+ * 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.
10408
+ */
10409
+ 'Idempotency-Key'?: string;
10410
+ };
10411
+ path: {
10412
+ /**
10413
+ * Channel ID.
10414
+ */
10415
+ channel_id: string;
10416
+ };
10417
+ query?: never;
10418
+ url: '/whatsapp-numbers/{channel_id}/profile-photo/complete';
10419
+ };
10420
+ export type CompleteProfilePhotoUploadErrors = {
10421
+ /**
10422
+ * `invalid_json`: The body is not valid JSON.
10423
+ *
10424
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
10425
+ */
10426
+ 400: Error;
10427
+ /**
10428
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
10429
+ */
10430
+ 401: Error;
10431
+ /**
10432
+ * `insufficient_scope`: The key lacks the scope this operation requires.
10433
+ */
10434
+ 403: Error;
10435
+ /**
10436
+ * `not_found`: The resource does not exist in this organization.
10437
+ */
10438
+ 404: Error;
10439
+ /**
10440
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
10441
+ *
10442
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
10443
+ */
10444
+ 409: Error;
10445
+ /**
10446
+ * `body_too_large`: The JSON body exceeds 64 KiB.
10447
+ */
10448
+ 413: Error;
10449
+ /**
10450
+ * `unsupported_media_type`: The body must be `application/json`.
10451
+ */
10452
+ 415: Error;
10453
+ /**
10454
+ * `rule_violation`: The request breaks a business rule; `message` says which.
10455
+ */
10456
+ 422: Error;
10457
+ /**
10458
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10459
+ */
10460
+ 429: Error;
10461
+ /**
10462
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10463
+ */
10464
+ 500: Error;
10465
+ /**
10466
+ * `upstream_error`: The messaging provider failed. Retry later.
10467
+ */
10468
+ 502: Error;
10469
+ /**
10470
+ * `unavailable`: A dependency is temporarily unavailable. Retry later.
10471
+ */
10472
+ 503: Error;
10473
+ };
10474
+ export type CompleteProfilePhotoUploadError = CompleteProfilePhotoUploadErrors[keyof CompleteProfilePhotoUploadErrors];
10475
+ export type CompleteProfilePhotoUploadResponses = {
10476
+ /**
10477
+ * Success.
10478
+ */
10479
+ 200: {
10480
+ data: WhatsAppNumber;
10481
+ };
10482
+ };
10483
+ export type CompleteProfilePhotoUploadResponse = CompleteProfilePhotoUploadResponses[keyof CompleteProfilePhotoUploadResponses];
10484
+ export type RequestWhatsAppDisplayNameData = {
10485
+ body: RequestDisplayName;
10486
+ headers?: {
10487
+ /**
10488
+ * 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.
10489
+ */
10490
+ 'Idempotency-Key'?: string;
10491
+ };
10492
+ path: {
10493
+ /**
10494
+ * Channel ID.
10495
+ */
10496
+ channel_id: string;
10497
+ };
10498
+ query?: never;
10499
+ url: '/whatsapp-numbers/{channel_id}/display-name';
10500
+ };
10501
+ export type RequestWhatsAppDisplayNameErrors = {
10502
+ /**
10503
+ * `invalid_json`: The body is not valid JSON.
10504
+ *
10505
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
10506
+ */
10507
+ 400: Error;
10508
+ /**
10509
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
10510
+ */
10511
+ 401: Error;
10512
+ /**
10513
+ * `insufficient_scope`: The key lacks the scope this operation requires.
10514
+ */
10515
+ 403: Error;
10516
+ /**
10517
+ * `not_found`: The resource does not exist in this organization.
10518
+ */
10519
+ 404: Error;
10520
+ /**
10521
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
10522
+ *
10523
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
10524
+ */
10525
+ 409: Error;
10526
+ /**
10527
+ * `body_too_large`: The JSON body exceeds 64 KiB.
10528
+ */
10529
+ 413: Error;
10530
+ /**
10531
+ * `unsupported_media_type`: The body must be `application/json`.
10532
+ */
10533
+ 415: Error;
10534
+ /**
10535
+ * `rule_violation`: The request breaks a business rule; `message` says which.
10536
+ */
10537
+ 422: Error;
10538
+ /**
10539
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10540
+ */
10541
+ 429: Error;
10542
+ /**
10543
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10544
+ */
10545
+ 500: Error;
10546
+ /**
10547
+ * `upstream_error`: The messaging provider failed. Retry later.
10548
+ */
10549
+ 502: Error;
10550
+ /**
10551
+ * `unavailable`: A dependency is temporarily unavailable. Retry later.
10552
+ */
10553
+ 503: Error;
10554
+ };
10555
+ export type RequestWhatsAppDisplayNameError = RequestWhatsAppDisplayNameErrors[keyof RequestWhatsAppDisplayNameErrors];
10556
+ export type RequestWhatsAppDisplayNameResponses = {
10557
+ /**
10558
+ * Accepted.
10559
+ */
10560
+ 202: {
10561
+ data: DisplayNameRequest;
10562
+ };
10563
+ };
10564
+ export type RequestWhatsAppDisplayNameResponse = RequestWhatsAppDisplayNameResponses[keyof RequestWhatsAppDisplayNameResponses];
10565
+ export type RefreshWhatsAppNumberData = {
10566
+ body?: never;
10567
+ headers?: {
10568
+ /**
10569
+ * 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.
10570
+ */
10571
+ 'Idempotency-Key'?: string;
10572
+ };
10573
+ path: {
10574
+ /**
10575
+ * Channel ID.
10576
+ */
10577
+ channel_id: string;
10578
+ };
10579
+ query?: never;
10580
+ url: '/whatsapp-numbers/{channel_id}/refresh';
10581
+ };
10582
+ export type RefreshWhatsAppNumberErrors = {
10583
+ /**
10584
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
10585
+ */
10586
+ 400: Error;
10587
+ /**
10588
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
10589
+ */
10590
+ 401: Error;
10591
+ /**
10592
+ * `insufficient_scope`: The key lacks the scope this operation requires.
10593
+ */
10594
+ 403: Error;
10595
+ /**
10596
+ * `not_found`: The resource does not exist in this organization.
10597
+ */
10598
+ 404: Error;
10599
+ /**
10600
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
10601
+ *
10602
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
10603
+ */
10604
+ 409: Error;
10605
+ /**
10606
+ * `rule_violation`: The request breaks a business rule; `message` says which.
10607
+ */
10608
+ 422: Error;
10609
+ /**
10610
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
10611
+ */
10612
+ 429: Error;
10613
+ /**
10614
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
10615
+ */
10616
+ 500: Error;
10617
+ /**
10618
+ * `upstream_error`: The messaging provider failed. Retry later.
10619
+ */
10620
+ 502: Error;
10621
+ /**
10622
+ * `unavailable`: A dependency is temporarily unavailable. Retry later.
10623
+ */
10624
+ 503: Error;
10625
+ };
10626
+ export type RefreshWhatsAppNumberError = RefreshWhatsAppNumberErrors[keyof RefreshWhatsAppNumberErrors];
10627
+ export type RefreshWhatsAppNumberResponses = {
10628
+ /**
10629
+ * Success.
10630
+ */
10631
+ 200: {
10632
+ data: WhatsAppNumber;
10633
+ };
10634
+ };
10635
+ export type RefreshWhatsAppNumberResponse = RefreshWhatsAppNumberResponses[keyof RefreshWhatsAppNumberResponses];
9564
10636
  export type ListBroadcastsData = {
9565
10637
  body?: never;
9566
10638
  path?: never;