getricky 0.1.43 → 0.1.46

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.
@@ -15,6 +15,11 @@ export type Error = {
15
15
  * Human-readable explanation. Do not parse it.
16
16
  */
17
17
  message: string;
18
+ current?: {
19
+ revision: string | null;
20
+ head_id: string | null;
21
+ candidate_token: string | null;
22
+ };
18
23
  /**
19
24
  * The request field or parameter that caused it.
20
25
  */
@@ -3446,7 +3451,7 @@ export type Workflow = {
3446
3451
  type: 'conversation' | 'scheduled';
3447
3452
  definition: {
3448
3453
  /**
3449
- * The event that starts the workflow; `condition` decides whether that occurrence runs it. `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message, unless the contact replied first; `conversation_inactive` and `team_message_unanswered` after `inactivity_seconds`. `schedule` runs at each of its `schedule.times` on each conversation assigned then to a member its `condition` names with `assignee` `is`, which it requires. `conversation_assigned` runs when a conversation is assigned to a member; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai`, `turn_off_ai`, `decision` and `end` steps, and only they take `turn_on_ai` and `turn_off_ai`. `call_received` decides who answers a WhatsApp call on the WhatsApp numbers with AI calls on that its `condition` names: its flow takes only `answer_call`, `decline_call` and `decision`s on `channel` and `time`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3454
+ * The event that starts the workflow; `condition` decides whether that occurrence runs it. `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message, unless the contact replied first; `conversation_inactive` and `team_message_unanswered` after `inactivity_seconds`. `schedule` runs at each of its `schedule.times` on each conversation assigned then to a member its `condition` names with `assignee` `is`, which it requires. `conversation_assigned` runs when a conversation is assigned to a member; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai`, `turn_off_ai`, `decision` and `end` steps, and only they take `turn_on_ai` and `turn_off_ai`. `call_received` decides who answers a WhatsApp call on the WhatsApp numbers with AI calls on that its `condition` names: its flow takes only `answer_call`, `decline_call` and `decision`s on `channel` and `time`, and the first active one that reaches a call step, in most recently published order, decides, over whoever holds the conversation.
3450
3455
  */
3451
3456
  trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'conversation_inactive' | 'team_message_unanswered' | 'schedule' | 'conversation_assigned' | 'call_received';
3452
3457
  /**
@@ -3504,6 +3509,28 @@ export type Workflow = {
3504
3509
  * Text sent to the contact.
3505
3510
  */
3506
3511
  text: string;
3512
+ } | {
3513
+ /**
3514
+ * Step ID: letters, digits, `_` or `-`, up to 64.
3515
+ */
3516
+ id: string;
3517
+ /**
3518
+ * Step to run next; null ends the flow.
3519
+ */
3520
+ next: string | null;
3521
+ kind: 'send_whatsapp_template';
3522
+ template: {
3523
+ channel_id: string;
3524
+ template_id: string;
3525
+ template_name: string;
3526
+ language: string;
3527
+ parameters: {
3528
+ [key: string]: string | {
3529
+ text: string;
3530
+ };
3531
+ };
3532
+ has_header_image: boolean;
3533
+ };
3507
3534
  } | {
3508
3535
  /**
3509
3536
  * Step ID: letters, digits, `_` or `-`, up to 64.
@@ -4040,6 +4067,258 @@ export type WhatsAppNumber = {
4040
4067
  profile_picture_url: string | null;
4041
4068
  };
4042
4069
  };
4070
+ export type WorkflowIdentity = {
4071
+ id: string;
4072
+ };
4073
+ export type RenamedWorkflowIdentity = {
4074
+ id: string;
4075
+ name: string;
4076
+ };
4077
+ export type WorkflowDraftCondition = {
4078
+ kind?: 'all' | 'any';
4079
+ conditions?: Array<WorkflowDraftCondition>;
4080
+ } | {
4081
+ kind?: 'compare';
4082
+ field?: 'ai';
4083
+ operator?: 'is' | 'is_not';
4084
+ values?: Array<'on' | 'off'>;
4085
+ } | {
4086
+ kind?: 'compare';
4087
+ field?: 'assignee';
4088
+ operator?: 'is' | 'is_not';
4089
+ values?: Array<{
4090
+ kind?: 'agent';
4091
+ agent_id?: string;
4092
+ } | {
4093
+ kind?: 'person';
4094
+ user_id?: string;
4095
+ } | {
4096
+ kind?: 'nobody';
4097
+ }>;
4098
+ } | {
4099
+ kind?: 'compare';
4100
+ field?: 'channel';
4101
+ operator?: 'is' | 'is_not';
4102
+ values?: Array<string>;
4103
+ } | {
4104
+ kind?: 'compare';
4105
+ field?: 'conversation_status';
4106
+ operator?: 'is' | 'is_not';
4107
+ values?: Array<'open' | 'closed'>;
4108
+ } | {
4109
+ kind?: 'compare';
4110
+ field?: 'message_type';
4111
+ operator?: 'is' | 'is_not';
4112
+ values?: Array<'text' | 'button' | 'image' | 'audio' | 'video' | 'document' | 'location' | 'sticker' | 'other'>;
4113
+ } | {
4114
+ kind?: 'compare';
4115
+ field?: 'message_sender';
4116
+ operator?: 'is' | 'is_not';
4117
+ values?: Array<'person' | 'ai' | 'automation' | 'broadcast' | 'external_app'>;
4118
+ } | {
4119
+ kind?: 'compare';
4120
+ field?: 'message_first';
4121
+ operator?: 'is' | 'is_not';
4122
+ } | {
4123
+ kind?: 'compare';
4124
+ field?: 'time';
4125
+ operator?: 'within' | 'outside';
4126
+ business_hours?: {
4127
+ timezone?: string;
4128
+ closed_dates?: Array<string>;
4129
+ days?: {
4130
+ [key: string]: Array<{
4131
+ start?: string;
4132
+ end?: string;
4133
+ }>;
4134
+ };
4135
+ };
4136
+ } | {
4137
+ kind?: 'compare';
4138
+ field?: 'variable';
4139
+ operator?: 'is' | 'is_not' | 'contains' | 'not_contains' | 'exists' | 'not_exists';
4140
+ name?: string;
4141
+ value?: string;
4142
+ } | {
4143
+ kind?: 'compare';
4144
+ field?: 'message_text';
4145
+ operator?: 'contains' | 'not_contains';
4146
+ value?: string;
4147
+ };
4148
+ export type WorkflowDraftStep = {
4149
+ id?: string;
4150
+ next?: string | null;
4151
+ kind?: 'end' | 'turn_off_ai';
4152
+ } | {
4153
+ id?: string;
4154
+ next?: string | null;
4155
+ kind?: 'send_message' | 'decline_call';
4156
+ text?: string;
4157
+ } | {
4158
+ id?: string;
4159
+ next?: string | null;
4160
+ kind?: 'assign_agent' | 'turn_on_ai' | 'answer_call';
4161
+ agent_id?: string;
4162
+ } | {
4163
+ id?: string;
4164
+ next?: string | null;
4165
+ kind?: 'assign_user';
4166
+ user_id?: string;
4167
+ user_ids?: Array<string>;
4168
+ } | {
4169
+ id?: string;
4170
+ next?: string | null;
4171
+ kind?: 'decision';
4172
+ branches?: Array<{
4173
+ id?: string;
4174
+ name?: string;
4175
+ condition?: WorkflowDraftCondition;
4176
+ next?: string | null;
4177
+ }>;
4178
+ } | {
4179
+ id?: string;
4180
+ next?: string | null;
4181
+ kind?: 'ask_question';
4182
+ text?: string;
4183
+ answer_key?: string;
4184
+ choices?: Array<{
4185
+ id?: string;
4186
+ label?: string;
4187
+ next?: string | null;
4188
+ }>;
4189
+ timeout_seconds?: number;
4190
+ on_invalid?: string | null;
4191
+ on_timeout?: string | null;
4192
+ } | {
4193
+ id?: string;
4194
+ next?: string | null;
4195
+ kind?: 'wait';
4196
+ seconds?: number;
4197
+ } | {
4198
+ id?: string;
4199
+ next?: string | null;
4200
+ kind?: 'close_conversation';
4201
+ only_if_opened_by_send?: boolean;
4202
+ } | {
4203
+ id?: string;
4204
+ next?: string | null;
4205
+ kind?: 'send_whatsapp_template';
4206
+ template?: {
4207
+ id?: string;
4208
+ next?: string | null;
4209
+ kind?: 'send_whatsapp_template';
4210
+ channel_id?: string;
4211
+ template_id?: string;
4212
+ template_name?: string;
4213
+ language?: string;
4214
+ header_media?: {
4215
+ file_name?: string;
4216
+ mime_type?: string;
4217
+ size?: number;
4218
+ attachment_id?: string;
4219
+ };
4220
+ parameters?: {
4221
+ [key: string]: 'appointment_start' | 'branch_name' | 'customer_first_name' | {
4222
+ text?: string;
4223
+ };
4224
+ };
4225
+ };
4226
+ };
4227
+ export type WorkflowDraftDocument = {
4228
+ trigger?: 'call_received' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'schedule' | 'team_message_unanswered';
4229
+ condition?: WorkflowDraftCondition | null;
4230
+ inactivity_seconds?: number;
4231
+ schedule?: {
4232
+ timezone?: string;
4233
+ times?: Array<{
4234
+ time?: string;
4235
+ weekdays?: Array<number>;
4236
+ }>;
4237
+ };
4238
+ flow?: {
4239
+ entry?: string;
4240
+ steps?: Array<WorkflowDraftStep>;
4241
+ };
4242
+ };
4243
+ export type WorkflowDraftCopy = {
4244
+ id: string;
4245
+ name: string;
4246
+ source: 'draft' | 'head' | 'legacy' | 'empty';
4247
+ document: WorkflowDraftDocument;
4248
+ revision: string | null;
4249
+ head_id: string | null;
4250
+ base_version_id: string | null;
4251
+ candidate_token: string | null;
4252
+ unpublished_changes: boolean;
4253
+ };
4254
+ export type WorkflowDraftSummary = {
4255
+ id: string;
4256
+ name: string;
4257
+ head_id: string | null;
4258
+ created_at: string;
4259
+ };
4260
+ export type WorkflowVersionSummary = {
4261
+ id: string;
4262
+ number: number;
4263
+ schema_version: number;
4264
+ created_at: string;
4265
+ origin: 'baseline' | 'publish' | 'legacy_write';
4266
+ via: string;
4267
+ actor_user_id: string | null;
4268
+ actor_api_key_id: string | null;
4269
+ };
4270
+ export type WorkflowVersionDetail = {
4271
+ id: string;
4272
+ number: number;
4273
+ schema_version: number;
4274
+ created_at: string;
4275
+ origin: 'baseline' | 'publish' | 'legacy_write';
4276
+ via: string;
4277
+ actor_user_id: string | null;
4278
+ actor_api_key_id: string | null;
4279
+ definition: {
4280
+ channels: Array<string>;
4281
+ trigger: {
4282
+ kind: 'daily';
4283
+ time: string;
4284
+ timezone: string;
4285
+ };
4286
+ source: {
4287
+ kind: string;
4288
+ days_ahead?: number;
4289
+ appointment_states?: Array<string>;
4290
+ };
4291
+ flow: {
4292
+ entry: string;
4293
+ steps: Array<{
4294
+ id?: string;
4295
+ next?: string | null;
4296
+ kind?: 'send_whatsapp_template';
4297
+ channel_id?: string;
4298
+ template_id?: string;
4299
+ template_name?: string;
4300
+ language?: string;
4301
+ header_media?: {
4302
+ file_name?: string;
4303
+ mime_type?: string;
4304
+ size?: number;
4305
+ attachment_id?: string;
4306
+ };
4307
+ parameters?: {
4308
+ [key: string]: 'appointment_start' | 'branch_name' | 'customer_first_name' | {
4309
+ text?: string;
4310
+ };
4311
+ };
4312
+ }>;
4313
+ };
4314
+ close_after_send?: boolean;
4315
+ } | WorkflowDraftDocument;
4316
+ };
4317
+ export type WorkflowPublication = {
4318
+ head_id: string;
4319
+ number: number;
4320
+ status: 'active' | 'paused';
4321
+ };
4043
4322
  export type WorkflowMutation = Workflow | {
4044
4323
  /**
4045
4324
  * Workflow ID.
@@ -5248,7 +5527,7 @@ export type CreateWorkflow = {
5248
5527
  */
5249
5528
  definition: {
5250
5529
  /**
5251
- * The event that starts the workflow; `condition` decides whether that occurrence runs it. `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message, unless the contact replied first; `conversation_inactive` and `team_message_unanswered` after `inactivity_seconds`. `schedule` runs at each of its `schedule.times` on each conversation assigned then to a member its `condition` names with `assignee` `is`, which it requires. `conversation_assigned` runs when a conversation is assigned to a member; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai`, `turn_off_ai`, `decision` and `end` steps, and only they take `turn_on_ai` and `turn_off_ai`. `call_received` decides who answers a WhatsApp call on the WhatsApp numbers with AI calls on that its `condition` names: its flow takes only `answer_call`, `decline_call` and `decision`s on `channel` and `time`, and the first active one that reaches a call step decides, over whoever holds the conversation. `at_time` is deprecated: read as `schedule`.
5530
+ * The event that starts the workflow; `condition` decides whether that occurrence runs it. `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message, unless the contact replied first; `conversation_inactive` and `team_message_unanswered` after `inactivity_seconds`. `schedule` runs at each of its `schedule.times` on each conversation assigned then to a member its `condition` names with `assignee` `is`, which it requires. `conversation_assigned` runs when a conversation is assigned to a member; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai`, `turn_off_ai`, `decision` and `end` steps, and only they take `turn_on_ai` and `turn_off_ai`. `call_received` decides who answers a WhatsApp call on the WhatsApp numbers with AI calls on that its `condition` names: its flow takes only `answer_call`, `decline_call` and `decision`s on `channel` and `time`, and the first active one that reaches a call step, in most recently published order, decides, over whoever holds the conversation. `at_time` is deprecated: read as `schedule`.
5252
5531
  */
5253
5532
  trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'conversation_inactive' | 'team_message_unanswered' | 'schedule' | 'conversation_assigned' | 'call_received' | 'at_time';
5254
5533
  /**
@@ -5620,7 +5899,7 @@ export type UpdateWorkflow = {
5620
5899
  */
5621
5900
  definition?: {
5622
5901
  /**
5623
- * The event that starts the workflow; `condition` decides whether that occurrence runs it. `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message, unless the contact replied first; `conversation_inactive` and `team_message_unanswered` after `inactivity_seconds`. `schedule` runs at each of its `schedule.times` on each conversation assigned then to a member its `condition` names with `assignee` `is`, which it requires. `conversation_assigned` runs when a conversation is assigned to a member; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai`, `turn_off_ai`, `decision` and `end` steps, and only they take `turn_on_ai` and `turn_off_ai`. `call_received` decides who answers a WhatsApp call on the WhatsApp numbers with AI calls on that its `condition` names: its flow takes only `answer_call`, `decline_call` and `decision`s on `channel` and `time`, and the first active one that reaches a call step decides, over whoever holds the conversation. `at_time` is deprecated: read as `schedule`.
5902
+ * The event that starts the workflow; `condition` decides whether that occurrence runs it. `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message, unless the contact replied first; `conversation_inactive` and `team_message_unanswered` after `inactivity_seconds`. `schedule` runs at each of its `schedule.times` on each conversation assigned then to a member its `condition` names with `assignee` `is`, which it requires. `conversation_assigned` runs when a conversation is assigned to a member; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai`, `turn_off_ai`, `decision` and `end` steps, and only they take `turn_on_ai` and `turn_off_ai`. `call_received` decides who answers a WhatsApp call on the WhatsApp numbers with AI calls on that its `condition` names: its flow takes only `answer_call`, `decline_call` and `decision`s on `channel` and `time`, and the first active one that reaches a call step, in most recently published order, decides, over whoever holds the conversation. `at_time` is deprecated: read as `schedule`.
5624
5903
  */
5625
5904
  trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'conversation_inactive' | 'team_message_unanswered' | 'schedule' | 'conversation_assigned' | 'call_received' | 'at_time';
5626
5905
  /**
@@ -6401,6 +6680,197 @@ export type UpdateTemplate = {
6401
6680
  phone_number: string;
6402
6681
  }>;
6403
6682
  };
6683
+ export type WorkflowDraftConditionInput = {
6684
+ kind?: 'all' | 'any';
6685
+ conditions?: Array<WorkflowDraftConditionInput>;
6686
+ } | {
6687
+ kind?: 'compare';
6688
+ field?: 'ai';
6689
+ operator?: 'is' | 'is_not';
6690
+ values?: Array<'on' | 'off'>;
6691
+ } | {
6692
+ kind?: 'compare';
6693
+ field?: 'assignee';
6694
+ operator?: 'is' | 'is_not';
6695
+ values?: Array<{
6696
+ kind?: 'agent';
6697
+ agent_id?: string;
6698
+ } | {
6699
+ kind?: 'person';
6700
+ user_id?: string;
6701
+ } | {
6702
+ kind?: 'nobody';
6703
+ }>;
6704
+ } | {
6705
+ kind?: 'compare';
6706
+ field?: 'channel';
6707
+ operator?: 'is' | 'is_not';
6708
+ values?: Array<string>;
6709
+ } | {
6710
+ kind?: 'compare';
6711
+ field?: 'conversation_status';
6712
+ operator?: 'is' | 'is_not';
6713
+ values?: Array<'open' | 'closed'>;
6714
+ } | {
6715
+ kind?: 'compare';
6716
+ field?: 'message_type';
6717
+ operator?: 'is' | 'is_not';
6718
+ values?: Array<'text' | 'button' | 'image' | 'audio' | 'video' | 'document' | 'location' | 'sticker' | 'other'>;
6719
+ } | {
6720
+ kind?: 'compare';
6721
+ field?: 'message_sender';
6722
+ operator?: 'is' | 'is_not';
6723
+ values?: Array<'person' | 'ai' | 'automation' | 'broadcast' | 'external_app'>;
6724
+ } | {
6725
+ kind?: 'compare';
6726
+ field?: 'message_first';
6727
+ operator?: 'is' | 'is_not';
6728
+ } | {
6729
+ kind?: 'compare';
6730
+ field?: 'time';
6731
+ operator?: 'within' | 'outside';
6732
+ business_hours?: {
6733
+ timezone?: string;
6734
+ closed_dates?: Array<string>;
6735
+ days?: {
6736
+ [key: string]: Array<{
6737
+ start?: string;
6738
+ end?: string;
6739
+ }>;
6740
+ };
6741
+ };
6742
+ } | {
6743
+ kind?: 'compare';
6744
+ field?: 'variable';
6745
+ operator?: 'is' | 'is_not' | 'contains' | 'not_contains' | 'exists' | 'not_exists';
6746
+ name?: string;
6747
+ value?: string;
6748
+ } | {
6749
+ kind?: 'compare';
6750
+ field?: 'message_text';
6751
+ operator?: 'contains' | 'not_contains';
6752
+ value?: string;
6753
+ };
6754
+ export type WorkflowDraftStepInput = {
6755
+ id?: string;
6756
+ next?: string | null;
6757
+ kind?: 'end' | 'turn_off_ai';
6758
+ } | {
6759
+ id?: string;
6760
+ next?: string | null;
6761
+ kind?: 'send_message' | 'decline_call';
6762
+ text?: string;
6763
+ } | {
6764
+ id?: string;
6765
+ next?: string | null;
6766
+ kind?: 'assign_agent' | 'turn_on_ai' | 'answer_call';
6767
+ agent_id?: string;
6768
+ } | {
6769
+ id?: string;
6770
+ next?: string | null;
6771
+ kind?: 'assign_user';
6772
+ user_id?: string;
6773
+ user_ids?: Array<string>;
6774
+ } | {
6775
+ id?: string;
6776
+ next?: string | null;
6777
+ kind?: 'decision';
6778
+ branches?: Array<{
6779
+ id?: string;
6780
+ name?: string;
6781
+ condition?: WorkflowDraftConditionInput;
6782
+ next?: string | null;
6783
+ }>;
6784
+ } | {
6785
+ id?: string;
6786
+ next?: string | null;
6787
+ kind?: 'ask_question';
6788
+ text?: string;
6789
+ answer_key?: string;
6790
+ choices?: Array<{
6791
+ id?: string;
6792
+ label?: string;
6793
+ next?: string | null;
6794
+ }>;
6795
+ timeout_seconds?: number;
6796
+ on_invalid?: string | null;
6797
+ on_timeout?: string | null;
6798
+ } | {
6799
+ id?: string;
6800
+ next?: string | null;
6801
+ kind?: 'wait';
6802
+ seconds?: number;
6803
+ } | {
6804
+ id?: string;
6805
+ next?: string | null;
6806
+ kind?: 'close_conversation';
6807
+ only_if_opened_by_send?: boolean;
6808
+ } | {
6809
+ id?: string;
6810
+ next?: string | null;
6811
+ kind?: 'send_whatsapp_template';
6812
+ template?: {
6813
+ id?: string;
6814
+ next?: string | null;
6815
+ kind?: 'send_whatsapp_template';
6816
+ channel_id?: string;
6817
+ template_id?: string;
6818
+ template_name?: string;
6819
+ language?: string;
6820
+ header_media?: {
6821
+ file_name?: string;
6822
+ mime_type?: string;
6823
+ size?: number;
6824
+ attachment_id?: string;
6825
+ };
6826
+ parameters?: {
6827
+ [key: string]: 'appointment_start' | 'branch_name' | 'customer_first_name' | {
6828
+ text?: string;
6829
+ };
6830
+ };
6831
+ };
6832
+ };
6833
+ export type WorkflowDraftDocumentInput = {
6834
+ trigger?: 'call_received' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'schedule' | 'team_message_unanswered';
6835
+ condition?: WorkflowDraftConditionInput | null;
6836
+ inactivity_seconds?: number;
6837
+ schedule?: {
6838
+ timezone?: string;
6839
+ times?: Array<{
6840
+ time?: string;
6841
+ weekdays?: Array<number>;
6842
+ }>;
6843
+ };
6844
+ flow?: {
6845
+ entry?: string;
6846
+ steps?: Array<WorkflowDraftStepInput>;
6847
+ };
6848
+ };
6849
+ export type WorkflowExpectedDraftInput = {
6850
+ revision: string | null;
6851
+ head_id: string | null;
6852
+ candidate_token?: string | null;
6853
+ };
6854
+ export type WorkflowCreateDraftBodyInput = {
6855
+ name?: string;
6856
+ document?: WorkflowDraftDocumentInput;
6857
+ };
6858
+ export type WorkflowSaveDraftBodyInput = {
6859
+ expected: WorkflowExpectedDraftInput;
6860
+ document: WorkflowDraftDocumentInput;
6861
+ overwrite?: boolean;
6862
+ };
6863
+ export type WorkflowRenameDraftBodyInput = {
6864
+ name: string;
6865
+ };
6866
+ export type WorkflowPublishDraftBodyInput = {
6867
+ expected: WorkflowExpectedDraftInput;
6868
+ activate?: boolean;
6869
+ confirm_candidate?: boolean;
6870
+ };
6871
+ export type WorkflowRestoreDraftBodyInput = {
6872
+ expected: WorkflowExpectedDraftInput;
6873
+ };
6404
6874
  /**
6405
6875
  * 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.
6406
6876
  */
@@ -6530,7 +7000,7 @@ export type CreateContactErrors = {
6530
7000
  */
6531
7001
  409: Error;
6532
7002
  /**
6533
- * `body_too_large`: The JSON body exceeds 64 KiB.
7003
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
6534
7004
  */
6535
7005
  413: Error;
6536
7006
  /**
@@ -6648,7 +7118,7 @@ export type UpdateContactErrors = {
6648
7118
  */
6649
7119
  409: Error;
6650
7120
  /**
6651
- * `body_too_large`: The JSON body exceeds 64 KiB.
7121
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
6652
7122
  */
6653
7123
  413: Error;
6654
7124
  /**
@@ -6717,7 +7187,7 @@ export type AddContactNoteErrors = {
6717
7187
  */
6718
7188
  409: Error;
6719
7189
  /**
6720
- * `body_too_large`: The JSON body exceeds 64 KiB.
7190
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
6721
7191
  */
6722
7192
  413: Error;
6723
7193
  /**
@@ -6817,7 +7287,7 @@ export type CreateContactFieldErrors = {
6817
7287
  */
6818
7288
  409: Error;
6819
7289
  /**
6820
- * `body_too_large`: The JSON body exceeds 64 KiB.
7290
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
6821
7291
  */
6822
7292
  413: Error;
6823
7293
  /**
@@ -6997,7 +7467,7 @@ export type StartConversationErrors = {
6997
7467
  */
6998
7468
  409: Error;
6999
7469
  /**
7000
- * `body_too_large`: The JSON body exceeds 64 KiB.
7470
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
7001
7471
  */
7002
7472
  413: Error;
7003
7473
  /**
@@ -7127,7 +7597,7 @@ export type AssignConversationErrors = {
7127
7597
  */
7128
7598
  409: Error;
7129
7599
  /**
7130
- * `body_too_large`: The JSON body exceeds 64 KiB.
7600
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
7131
7601
  */
7132
7602
  413: Error;
7133
7603
  /**
@@ -7200,7 +7670,7 @@ export type CloseConversationErrors = {
7200
7670
  */
7201
7671
  409: Error;
7202
7672
  /**
7203
- * `body_too_large`: The JSON body exceeds 64 KiB.
7673
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
7204
7674
  */
7205
7675
  413: Error;
7206
7676
  /**
@@ -7384,7 +7854,7 @@ export type SendMessageErrors = {
7384
7854
  */
7385
7855
  409: Error;
7386
7856
  /**
7387
- * `body_too_large`: The JSON body exceeds 64 KiB.
7857
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
7388
7858
  */
7389
7859
  413: Error;
7390
7860
  /**
@@ -7672,7 +8142,7 @@ export type CreateTagErrors = {
7672
8142
  */
7673
8143
  409: Error;
7674
8144
  /**
7675
- * `body_too_large`: The JSON body exceeds 64 KiB.
8145
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
7676
8146
  */
7677
8147
  413: Error;
7678
8148
  /**
@@ -7758,7 +8228,7 @@ export type CreateWebhookErrors = {
7758
8228
  */
7759
8229
  403: Error;
7760
8230
  /**
7761
- * `body_too_large`: The JSON body exceeds 64 KiB.
8231
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
7762
8232
  */
7763
8233
  413: Error;
7764
8234
  /**
@@ -7909,7 +8379,7 @@ export type RotateWebhookSecretErrors = {
7909
8379
  */
7910
8380
  404: Error;
7911
8381
  /**
7912
- * `body_too_large`: The JSON body exceeds 64 KiB.
8382
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
7913
8383
  */
7914
8384
  413: Error;
7915
8385
  /**
@@ -8109,7 +8579,7 @@ export type CreateWorkflowErrors = {
8109
8579
  */
8110
8580
  409: Error;
8111
8581
  /**
8112
- * `body_too_large`: The JSON body exceeds 64 KiB.
8582
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
8113
8583
  */
8114
8584
  413: Error;
8115
8585
  /**
@@ -8274,7 +8744,7 @@ export type UpdateWorkflowErrors = {
8274
8744
  */
8275
8745
  409: Error;
8276
8746
  /**
8277
- * `body_too_large`: The JSON body exceeds 64 KiB.
8747
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
8278
8748
  */
8279
8749
  413: Error;
8280
8750
  /**
@@ -8462,6 +8932,704 @@ export type ListWorkflowExecutionsResponses = {
8462
8932
  };
8463
8933
  };
8464
8934
  export type ListWorkflowExecutionsResponse = ListWorkflowExecutionsResponses[keyof ListWorkflowExecutionsResponses];
8935
+ export type ListWorkflowDraftsData = {
8936
+ body?: never;
8937
+ path?: never;
8938
+ query?: {
8939
+ /**
8940
+ * Items per page.
8941
+ */
8942
+ page_size?: number;
8943
+ /**
8944
+ * `next_cursor` from the previous page. Use it unchanged.
8945
+ */
8946
+ cursor?: string;
8947
+ };
8948
+ url: '/workflow-drafts';
8949
+ };
8950
+ export type ListWorkflowDraftsErrors = {
8951
+ /**
8952
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
8953
+ */
8954
+ 400: Error;
8955
+ /**
8956
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8957
+ */
8958
+ 401: Error;
8959
+ /**
8960
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8961
+ */
8962
+ 403: Error;
8963
+ /**
8964
+ * `not_found`: The resource does not exist in this organization.
8965
+ */
8966
+ 404: Error;
8967
+ /**
8968
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8969
+ */
8970
+ 429: Error;
8971
+ /**
8972
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8973
+ */
8974
+ 500: Error;
8975
+ };
8976
+ export type ListWorkflowDraftsError = ListWorkflowDraftsErrors[keyof ListWorkflowDraftsErrors];
8977
+ export type ListWorkflowDraftsResponses = {
8978
+ /**
8979
+ * Success.
8980
+ */
8981
+ 200: {
8982
+ data: Array<WorkflowDraftSummary>;
8983
+ /**
8984
+ * Pass as `cursor` for the next page; null on the last page.
8985
+ */
8986
+ next_cursor: string | null;
8987
+ };
8988
+ };
8989
+ export type ListWorkflowDraftsResponse = ListWorkflowDraftsResponses[keyof ListWorkflowDraftsResponses];
8990
+ export type CreateWorkflowDraftData = {
8991
+ body: WorkflowCreateDraftBodyInput;
8992
+ headers?: {
8993
+ /**
8994
+ * 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.
8995
+ */
8996
+ 'Idempotency-Key'?: string;
8997
+ };
8998
+ path?: never;
8999
+ query?: never;
9000
+ url: '/workflow-drafts';
9001
+ };
9002
+ export type CreateWorkflowDraftErrors = {
9003
+ /**
9004
+ * `invalid_json`: The body is not valid JSON.
9005
+ *
9006
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9007
+ */
9008
+ 400: Error;
9009
+ /**
9010
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9011
+ */
9012
+ 401: Error;
9013
+ /**
9014
+ * `forbidden`: The organization does not allow the operation.
9015
+ *
9016
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9017
+ */
9018
+ 403: Error;
9019
+ /**
9020
+ * `not_found`: The resource does not exist in this organization.
9021
+ */
9022
+ 404: Error;
9023
+ /**
9024
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9025
+ *
9026
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9027
+ *
9028
+ * `conflict`: The resource changed in a way that prevents the operation.
9029
+ */
9030
+ 409: Error;
9031
+ /**
9032
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9033
+ */
9034
+ 413: Error;
9035
+ /**
9036
+ * `unsupported_media_type`: The body must be `application/json`.
9037
+ */
9038
+ 415: Error;
9039
+ /**
9040
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9041
+ */
9042
+ 422: Error;
9043
+ /**
9044
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9045
+ */
9046
+ 429: Error;
9047
+ /**
9048
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9049
+ */
9050
+ 500: Error;
9051
+ /**
9052
+ * `upstream_error`: The messaging provider failed. Retry later.
9053
+ */
9054
+ 502: Error;
9055
+ };
9056
+ export type CreateWorkflowDraftError = CreateWorkflowDraftErrors[keyof CreateWorkflowDraftErrors];
9057
+ export type CreateWorkflowDraftResponses = {
9058
+ /**
9059
+ * Success.
9060
+ */
9061
+ 201: {
9062
+ data: WorkflowDraftCopy;
9063
+ };
9064
+ };
9065
+ export type CreateWorkflowDraftResponse = CreateWorkflowDraftResponses[keyof CreateWorkflowDraftResponses];
9066
+ export type GetWorkflowDraftData = {
9067
+ body?: never;
9068
+ path: {
9069
+ /**
9070
+ * Workflow ID.
9071
+ */
9072
+ workflow_id: string;
9073
+ };
9074
+ query?: never;
9075
+ url: '/workflows/{workflow_id}/draft';
9076
+ };
9077
+ export type GetWorkflowDraftErrors = {
9078
+ /**
9079
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9080
+ */
9081
+ 400: Error;
9082
+ /**
9083
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9084
+ */
9085
+ 401: Error;
9086
+ /**
9087
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9088
+ */
9089
+ 403: Error;
9090
+ /**
9091
+ * `not_found`: The resource does not exist in this organization.
9092
+ */
9093
+ 404: Error;
9094
+ /**
9095
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9096
+ */
9097
+ 429: Error;
9098
+ /**
9099
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9100
+ */
9101
+ 500: Error;
9102
+ };
9103
+ export type GetWorkflowDraftError = GetWorkflowDraftErrors[keyof GetWorkflowDraftErrors];
9104
+ export type GetWorkflowDraftResponses = {
9105
+ /**
9106
+ * Success.
9107
+ */
9108
+ 200: {
9109
+ data: WorkflowDraftCopy;
9110
+ };
9111
+ };
9112
+ export type GetWorkflowDraftResponse = GetWorkflowDraftResponses[keyof GetWorkflowDraftResponses];
9113
+ export type SaveWorkflowDraftData = {
9114
+ body: WorkflowSaveDraftBodyInput;
9115
+ headers?: {
9116
+ /**
9117
+ * 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.
9118
+ */
9119
+ 'Idempotency-Key'?: string;
9120
+ };
9121
+ path: {
9122
+ /**
9123
+ * Workflow ID.
9124
+ */
9125
+ workflow_id: string;
9126
+ };
9127
+ query?: never;
9128
+ url: '/workflows/{workflow_id}/draft';
9129
+ };
9130
+ export type SaveWorkflowDraftErrors = {
9131
+ /**
9132
+ * `invalid_json`: The body is not valid JSON.
9133
+ *
9134
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9135
+ */
9136
+ 400: Error;
9137
+ /**
9138
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9139
+ */
9140
+ 401: Error;
9141
+ /**
9142
+ * `forbidden`: The organization does not allow the operation.
9143
+ *
9144
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9145
+ */
9146
+ 403: Error;
9147
+ /**
9148
+ * `not_found`: The resource does not exist in this organization.
9149
+ */
9150
+ 404: Error;
9151
+ /**
9152
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9153
+ *
9154
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9155
+ *
9156
+ * `conflict`: The resource changed in a way that prevents the operation.
9157
+ */
9158
+ 409: Error;
9159
+ /**
9160
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9161
+ */
9162
+ 413: Error;
9163
+ /**
9164
+ * `unsupported_media_type`: The body must be `application/json`.
9165
+ */
9166
+ 415: Error;
9167
+ /**
9168
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9169
+ */
9170
+ 422: Error;
9171
+ /**
9172
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9173
+ */
9174
+ 429: Error;
9175
+ /**
9176
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9177
+ */
9178
+ 500: Error;
9179
+ /**
9180
+ * `upstream_error`: The messaging provider failed. Retry later.
9181
+ */
9182
+ 502: Error;
9183
+ };
9184
+ export type SaveWorkflowDraftError = SaveWorkflowDraftErrors[keyof SaveWorkflowDraftErrors];
9185
+ export type SaveWorkflowDraftResponses = {
9186
+ /**
9187
+ * Success.
9188
+ */
9189
+ 200: {
9190
+ data: WorkflowDraftCopy;
9191
+ };
9192
+ };
9193
+ export type SaveWorkflowDraftResponse = SaveWorkflowDraftResponses[keyof SaveWorkflowDraftResponses];
9194
+ export type DeleteWorkflowDraftData = {
9195
+ body?: never;
9196
+ headers?: {
9197
+ /**
9198
+ * 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.
9199
+ */
9200
+ 'Idempotency-Key'?: string;
9201
+ };
9202
+ path: {
9203
+ /**
9204
+ * Workflow ID.
9205
+ */
9206
+ workflow_id: string;
9207
+ };
9208
+ query?: never;
9209
+ url: '/workflow-drafts/{workflow_id}';
9210
+ };
9211
+ export type DeleteWorkflowDraftErrors = {
9212
+ /**
9213
+ * `invalid_json`: The body is not valid JSON.
9214
+ *
9215
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9216
+ */
9217
+ 400: Error;
9218
+ /**
9219
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9220
+ */
9221
+ 401: Error;
9222
+ /**
9223
+ * `forbidden`: The organization does not allow the operation.
9224
+ *
9225
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9226
+ */
9227
+ 403: Error;
9228
+ /**
9229
+ * `not_found`: The resource does not exist in this organization.
9230
+ */
9231
+ 404: Error;
9232
+ /**
9233
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9234
+ *
9235
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9236
+ *
9237
+ * `conflict`: The resource changed in a way that prevents the operation.
9238
+ */
9239
+ 409: Error;
9240
+ /**
9241
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9242
+ */
9243
+ 413: Error;
9244
+ /**
9245
+ * `unsupported_media_type`: The body must be `application/json`.
9246
+ */
9247
+ 415: Error;
9248
+ /**
9249
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9250
+ */
9251
+ 422: Error;
9252
+ /**
9253
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9254
+ */
9255
+ 429: Error;
9256
+ /**
9257
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9258
+ */
9259
+ 500: Error;
9260
+ /**
9261
+ * `upstream_error`: The messaging provider failed. Retry later.
9262
+ */
9263
+ 502: Error;
9264
+ };
9265
+ export type DeleteWorkflowDraftError = DeleteWorkflowDraftErrors[keyof DeleteWorkflowDraftErrors];
9266
+ export type DeleteWorkflowDraftResponses = {
9267
+ /**
9268
+ * Success.
9269
+ */
9270
+ 200: {
9271
+ data: WorkflowIdentity;
9272
+ };
9273
+ };
9274
+ export type DeleteWorkflowDraftResponse = DeleteWorkflowDraftResponses[keyof DeleteWorkflowDraftResponses];
9275
+ export type RenameWorkflowDraftData = {
9276
+ body: WorkflowRenameDraftBodyInput;
9277
+ headers?: {
9278
+ /**
9279
+ * 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.
9280
+ */
9281
+ 'Idempotency-Key'?: string;
9282
+ };
9283
+ path: {
9284
+ /**
9285
+ * Workflow ID.
9286
+ */
9287
+ workflow_id: string;
9288
+ };
9289
+ query?: never;
9290
+ url: '/workflow-drafts/{workflow_id}';
9291
+ };
9292
+ export type RenameWorkflowDraftErrors = {
9293
+ /**
9294
+ * `invalid_json`: The body is not valid JSON.
9295
+ *
9296
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9297
+ */
9298
+ 400: Error;
9299
+ /**
9300
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9301
+ */
9302
+ 401: Error;
9303
+ /**
9304
+ * `forbidden`: The organization does not allow the operation.
9305
+ *
9306
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9307
+ */
9308
+ 403: Error;
9309
+ /**
9310
+ * `not_found`: The resource does not exist in this organization.
9311
+ */
9312
+ 404: Error;
9313
+ /**
9314
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9315
+ *
9316
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9317
+ *
9318
+ * `conflict`: The resource changed in a way that prevents the operation.
9319
+ */
9320
+ 409: Error;
9321
+ /**
9322
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9323
+ */
9324
+ 413: Error;
9325
+ /**
9326
+ * `unsupported_media_type`: The body must be `application/json`.
9327
+ */
9328
+ 415: Error;
9329
+ /**
9330
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9331
+ */
9332
+ 422: Error;
9333
+ /**
9334
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9335
+ */
9336
+ 429: Error;
9337
+ /**
9338
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9339
+ */
9340
+ 500: Error;
9341
+ /**
9342
+ * `upstream_error`: The messaging provider failed. Retry later.
9343
+ */
9344
+ 502: Error;
9345
+ };
9346
+ export type RenameWorkflowDraftError = RenameWorkflowDraftErrors[keyof RenameWorkflowDraftErrors];
9347
+ export type RenameWorkflowDraftResponses = {
9348
+ /**
9349
+ * Success.
9350
+ */
9351
+ 200: {
9352
+ data: RenamedWorkflowIdentity;
9353
+ };
9354
+ };
9355
+ export type RenameWorkflowDraftResponse = RenameWorkflowDraftResponses[keyof RenameWorkflowDraftResponses];
9356
+ export type PublishWorkflowData = {
9357
+ body: WorkflowPublishDraftBodyInput;
9358
+ headers?: {
9359
+ /**
9360
+ * 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.
9361
+ */
9362
+ 'Idempotency-Key'?: string;
9363
+ };
9364
+ path: {
9365
+ /**
9366
+ * Workflow ID.
9367
+ */
9368
+ workflow_id: string;
9369
+ };
9370
+ query?: never;
9371
+ url: '/workflows/{workflow_id}/publish';
9372
+ };
9373
+ export type PublishWorkflowErrors = {
9374
+ /**
9375
+ * `invalid_json`: The body is not valid JSON.
9376
+ *
9377
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9378
+ */
9379
+ 400: Error;
9380
+ /**
9381
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9382
+ */
9383
+ 401: Error;
9384
+ /**
9385
+ * `forbidden`: The organization does not allow the operation.
9386
+ *
9387
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9388
+ */
9389
+ 403: Error;
9390
+ /**
9391
+ * `not_found`: The resource does not exist in this organization.
9392
+ */
9393
+ 404: Error;
9394
+ /**
9395
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9396
+ *
9397
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9398
+ *
9399
+ * `conflict`: The resource changed in a way that prevents the operation.
9400
+ */
9401
+ 409: Error;
9402
+ /**
9403
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9404
+ */
9405
+ 413: Error;
9406
+ /**
9407
+ * `unsupported_media_type`: The body must be `application/json`.
9408
+ */
9409
+ 415: Error;
9410
+ /**
9411
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9412
+ */
9413
+ 422: Error;
9414
+ /**
9415
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9416
+ */
9417
+ 429: Error;
9418
+ /**
9419
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9420
+ */
9421
+ 500: Error;
9422
+ /**
9423
+ * `upstream_error`: The messaging provider failed. Retry later.
9424
+ */
9425
+ 502: Error;
9426
+ };
9427
+ export type PublishWorkflowError = PublishWorkflowErrors[keyof PublishWorkflowErrors];
9428
+ export type PublishWorkflowResponses = {
9429
+ /**
9430
+ * Success.
9431
+ */
9432
+ 200: {
9433
+ data: WorkflowPublication;
9434
+ };
9435
+ };
9436
+ export type PublishWorkflowResponse = PublishWorkflowResponses[keyof PublishWorkflowResponses];
9437
+ export type ListWorkflowVersionsData = {
9438
+ body?: never;
9439
+ path: {
9440
+ /**
9441
+ * Workflow ID.
9442
+ */
9443
+ workflow_id: string;
9444
+ };
9445
+ query?: {
9446
+ /**
9447
+ * Items per page.
9448
+ */
9449
+ page_size?: number;
9450
+ /**
9451
+ * `next_cursor` from the previous page. Use it unchanged.
9452
+ */
9453
+ cursor?: string;
9454
+ };
9455
+ url: '/workflows/{workflow_id}/versions';
9456
+ };
9457
+ export type ListWorkflowVersionsErrors = {
9458
+ /**
9459
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9460
+ */
9461
+ 400: Error;
9462
+ /**
9463
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9464
+ */
9465
+ 401: Error;
9466
+ /**
9467
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9468
+ */
9469
+ 403: Error;
9470
+ /**
9471
+ * `not_found`: The resource does not exist in this organization.
9472
+ */
9473
+ 404: Error;
9474
+ /**
9475
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9476
+ */
9477
+ 429: Error;
9478
+ /**
9479
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9480
+ */
9481
+ 500: Error;
9482
+ };
9483
+ export type ListWorkflowVersionsError = ListWorkflowVersionsErrors[keyof ListWorkflowVersionsErrors];
9484
+ export type ListWorkflowVersionsResponses = {
9485
+ /**
9486
+ * Success.
9487
+ */
9488
+ 200: {
9489
+ data: Array<WorkflowVersionSummary>;
9490
+ /**
9491
+ * Pass as `cursor` for the next page; null on the last page.
9492
+ */
9493
+ next_cursor: string | null;
9494
+ };
9495
+ };
9496
+ export type ListWorkflowVersionsResponse = ListWorkflowVersionsResponses[keyof ListWorkflowVersionsResponses];
9497
+ export type GetWorkflowVersionData = {
9498
+ body?: never;
9499
+ path: {
9500
+ /**
9501
+ * Workflow ID.
9502
+ */
9503
+ workflow_id: string;
9504
+ /**
9505
+ * Version ID.
9506
+ */
9507
+ version_id: string;
9508
+ };
9509
+ query?: never;
9510
+ url: '/workflows/{workflow_id}/versions/{version_id}';
9511
+ };
9512
+ export type GetWorkflowVersionErrors = {
9513
+ /**
9514
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9515
+ */
9516
+ 400: Error;
9517
+ /**
9518
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9519
+ */
9520
+ 401: Error;
9521
+ /**
9522
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9523
+ */
9524
+ 403: Error;
9525
+ /**
9526
+ * `not_found`: The resource does not exist in this organization.
9527
+ */
9528
+ 404: Error;
9529
+ /**
9530
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9531
+ */
9532
+ 429: Error;
9533
+ /**
9534
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9535
+ */
9536
+ 500: Error;
9537
+ };
9538
+ export type GetWorkflowVersionError = GetWorkflowVersionErrors[keyof GetWorkflowVersionErrors];
9539
+ export type GetWorkflowVersionResponses = {
9540
+ /**
9541
+ * Success.
9542
+ */
9543
+ 200: {
9544
+ data: WorkflowVersionDetail;
9545
+ };
9546
+ };
9547
+ export type GetWorkflowVersionResponse = GetWorkflowVersionResponses[keyof GetWorkflowVersionResponses];
9548
+ export type RestoreWorkflowVersionToDraftData = {
9549
+ body: WorkflowRestoreDraftBodyInput;
9550
+ headers?: {
9551
+ /**
9552
+ * 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.
9553
+ */
9554
+ 'Idempotency-Key'?: string;
9555
+ };
9556
+ path: {
9557
+ /**
9558
+ * Workflow ID.
9559
+ */
9560
+ workflow_id: string;
9561
+ /**
9562
+ * Version ID.
9563
+ */
9564
+ version_id: string;
9565
+ };
9566
+ query?: never;
9567
+ url: '/workflows/{workflow_id}/versions/{version_id}/restore';
9568
+ };
9569
+ export type RestoreWorkflowVersionToDraftErrors = {
9570
+ /**
9571
+ * `invalid_json`: The body is not valid JSON.
9572
+ *
9573
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9574
+ */
9575
+ 400: Error;
9576
+ /**
9577
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9578
+ */
9579
+ 401: Error;
9580
+ /**
9581
+ * `forbidden`: The organization does not allow the operation.
9582
+ *
9583
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9584
+ */
9585
+ 403: Error;
9586
+ /**
9587
+ * `not_found`: The resource does not exist in this organization.
9588
+ */
9589
+ 404: Error;
9590
+ /**
9591
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9592
+ *
9593
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9594
+ *
9595
+ * `conflict`: The resource changed in a way that prevents the operation.
9596
+ */
9597
+ 409: Error;
9598
+ /**
9599
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9600
+ */
9601
+ 413: Error;
9602
+ /**
9603
+ * `unsupported_media_type`: The body must be `application/json`.
9604
+ */
9605
+ 415: Error;
9606
+ /**
9607
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9608
+ */
9609
+ 422: Error;
9610
+ /**
9611
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9612
+ */
9613
+ 429: Error;
9614
+ /**
9615
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9616
+ */
9617
+ 500: Error;
9618
+ /**
9619
+ * `upstream_error`: The messaging provider failed. Retry later.
9620
+ */
9621
+ 502: Error;
9622
+ };
9623
+ export type RestoreWorkflowVersionToDraftError = RestoreWorkflowVersionToDraftErrors[keyof RestoreWorkflowVersionToDraftErrors];
9624
+ export type RestoreWorkflowVersionToDraftResponses = {
9625
+ /**
9626
+ * Success.
9627
+ */
9628
+ 200: {
9629
+ data: WorkflowDraftCopy;
9630
+ };
9631
+ };
9632
+ export type RestoreWorkflowVersionToDraftResponse = RestoreWorkflowVersionToDraftResponses[keyof RestoreWorkflowVersionToDraftResponses];
8465
9633
  export type UploadWorkflowHeaderMediaData = {
8466
9634
  body: UploadWorkflowHeaderMedia;
8467
9635
  headers?: {
@@ -8507,7 +9675,7 @@ export type UploadWorkflowHeaderMediaErrors = {
8507
9675
  */
8508
9676
  409: Error;
8509
9677
  /**
8510
- * `body_too_large`: The JSON body exceeds 64 KiB.
9678
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
8511
9679
  */
8512
9680
  413: Error;
8513
9681
  /**
@@ -9573,7 +10741,7 @@ export type CreateAgentErrors = {
9573
10741
  */
9574
10742
  409: Error;
9575
10743
  /**
9576
- * `body_too_large`: The JSON body exceeds 64 KiB.
10744
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9577
10745
  */
9578
10746
  413: Error;
9579
10747
  /**
@@ -9736,7 +10904,7 @@ export type UpdateAgentErrors = {
9736
10904
  */
9737
10905
  409: Error;
9738
10906
  /**
9739
- * `body_too_large`: The JSON body exceeds 64 KiB.
10907
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9740
10908
  */
9741
10909
  413: Error;
9742
10910
  /**
@@ -9839,7 +11007,7 @@ export type AssignConversationAgentErrors = {
9839
11007
  */
9840
11008
  409: Error;
9841
11009
  /**
9842
- * `body_too_large`: The JSON body exceeds 64 KiB.
11010
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9843
11011
  */
9844
11012
  413: Error;
9845
11013
  /**
@@ -9937,7 +11105,7 @@ export type CreateKnowledgeLocationErrors = {
9937
11105
  */
9938
11106
  409: Error;
9939
11107
  /**
9940
- * `body_too_large`: The JSON body exceeds 64 KiB.
11108
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
9941
11109
  */
9942
11110
  413: Error;
9943
11111
  /**
@@ -10104,7 +11272,7 @@ export type UpdateKnowledgeLocationErrors = {
10104
11272
  */
10105
11273
  409: Error;
10106
11274
  /**
10107
- * `body_too_large`: The JSON body exceeds 64 KiB.
11275
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
10108
11276
  */
10109
11277
  413: Error;
10110
11278
  /**
@@ -10224,7 +11392,7 @@ export type CreateKnowledgeLocationPhotoErrors = {
10224
11392
  */
10225
11393
  409: Error;
10226
11394
  /**
10227
- * `body_too_large`: The JSON body exceeds 64 KiB.
11395
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
10228
11396
  */
10229
11397
  413: Error;
10230
11398
  /**
@@ -10391,7 +11559,7 @@ export type CreateKnowledgeContactErrors = {
10391
11559
  */
10392
11560
  409: Error;
10393
11561
  /**
10394
- * `body_too_large`: The JSON body exceeds 64 KiB.
11562
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
10395
11563
  */
10396
11564
  413: Error;
10397
11565
  /**
@@ -10554,7 +11722,7 @@ export type UpdateKnowledgeContactErrors = {
10554
11722
  */
10555
11723
  409: Error;
10556
11724
  /**
10557
- * `body_too_large`: The JSON body exceeds 64 KiB.
11725
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
10558
11726
  */
10559
11727
  413: Error;
10560
11728
  /**
@@ -10652,7 +11820,7 @@ export type CreateKnowledgeFileErrors = {
10652
11820
  */
10653
11821
  409: Error;
10654
11822
  /**
10655
- * `body_too_large`: The JSON body exceeds 64 KiB.
11823
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
10656
11824
  */
10657
11825
  413: Error;
10658
11826
  /**
@@ -10727,7 +11895,7 @@ export type CompleteKnowledgeFileErrors = {
10727
11895
  */
10728
11896
  409: Error;
10729
11897
  /**
10730
- * `body_too_large`: The JSON body exceeds 64 KiB.
11898
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
10731
11899
  */
10732
11900
  413: Error;
10733
11901
  /**
@@ -10904,7 +12072,7 @@ export type UpdateKnowledgeFileErrors = {
10904
12072
  */
10905
12073
  409: Error;
10906
12074
  /**
10907
- * `body_too_large`: The JSON body exceeds 64 KiB.
12075
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
10908
12076
  */
10909
12077
  413: Error;
10910
12078
  /**
@@ -11019,7 +12187,7 @@ export type ChangeContactsTagsErrors = {
11019
12187
  */
11020
12188
  409: Error;
11021
12189
  /**
11022
- * `body_too_large`: The JSON body exceeds 64 KiB.
12190
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
11023
12191
  */
11024
12192
  413: Error;
11025
12193
  /**
@@ -11212,7 +12380,7 @@ export type UpdateTagErrors = {
11212
12380
  */
11213
12381
  409: Error;
11214
12382
  /**
11215
- * `body_too_large`: The JSON body exceeds 64 KiB.
12383
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
11216
12384
  */
11217
12385
  413: Error;
11218
12386
  /**
@@ -11332,7 +12500,7 @@ export type ChangeConversationTagsErrors = {
11332
12500
  */
11333
12501
  409: Error;
11334
12502
  /**
11335
- * `body_too_large`: The JSON body exceeds 64 KiB.
12503
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
11336
12504
  */
11337
12505
  413: Error;
11338
12506
  /**
@@ -11601,7 +12769,7 @@ export type CreateQuickReplyErrors = {
11601
12769
  */
11602
12770
  409: Error;
11603
12771
  /**
11604
- * `body_too_large`: The JSON body exceeds 64 KiB.
12772
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
11605
12773
  */
11606
12774
  413: Error;
11607
12775
  /**
@@ -11778,7 +12946,7 @@ export type UpdateQuickReplyErrors = {
11778
12946
  */
11779
12947
  409: Error;
11780
12948
  /**
11781
- * `body_too_large`: The JSON body exceeds 64 KiB.
12949
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
11782
12950
  */
11783
12951
  413: Error;
11784
12952
  /**
@@ -11884,7 +13052,7 @@ export type CreateTemplateErrors = {
11884
13052
  */
11885
13053
  409: Error;
11886
13054
  /**
11887
- * `body_too_large`: The JSON body exceeds 64 KiB.
13055
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
11888
13056
  */
11889
13057
  413: Error;
11890
13058
  /**
@@ -12087,7 +13255,7 @@ export type UpdateTemplateErrors = {
12087
13255
  */
12088
13256
  409: Error;
12089
13257
  /**
12090
- * `body_too_large`: The JSON body exceeds 64 KiB.
13258
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12091
13259
  */
12092
13260
  413: Error;
12093
13261
  /**
@@ -12143,7 +13311,7 @@ export type ValidateTemplateErrors = {
12143
13311
  */
12144
13312
  403: Error;
12145
13313
  /**
12146
- * `body_too_large`: The JSON body exceeds 64 KiB.
13314
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12147
13315
  */
12148
13316
  413: Error;
12149
13317
  /**
@@ -12297,7 +13465,7 @@ export type UpdateWhatsAppNumberErrors = {
12297
13465
  */
12298
13466
  409: Error;
12299
13467
  /**
12300
- * `body_too_large`: The JSON body exceeds 64 KiB.
13468
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12301
13469
  */
12302
13470
  413: Error;
12303
13471
  /**
@@ -12373,7 +13541,7 @@ export type CreateTemplateMediaUploadErrors = {
12373
13541
  */
12374
13542
  409: Error;
12375
13543
  /**
12376
- * `body_too_large`: The JSON body exceeds 64 KiB.
13544
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12377
13545
  */
12378
13546
  413: Error;
12379
13547
  /**
@@ -12449,7 +13617,7 @@ export type CompleteTemplateMediaUploadErrors = {
12449
13617
  */
12450
13618
  409: Error;
12451
13619
  /**
12452
- * `body_too_large`: The JSON body exceeds 64 KiB.
13620
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12453
13621
  */
12454
13622
  413: Error;
12455
13623
  /**
@@ -12587,7 +13755,7 @@ export type ReplaceTemplateFieldMappingsErrors = {
12587
13755
  */
12588
13756
  409: Error;
12589
13757
  /**
12590
- * `body_too_large`: The JSON body exceeds 64 KiB.
13758
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12591
13759
  */
12592
13760
  413: Error;
12593
13761
  /**
@@ -12660,7 +13828,7 @@ export type UpdateWhatsAppBusinessProfileErrors = {
12660
13828
  */
12661
13829
  409: Error;
12662
13830
  /**
12663
- * `body_too_large`: The JSON body exceeds 64 KiB.
13831
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12664
13832
  */
12665
13833
  413: Error;
12666
13834
  /**
@@ -12741,7 +13909,7 @@ export type CreateProfilePhotoUploadErrors = {
12741
13909
  */
12742
13910
  409: Error;
12743
13911
  /**
12744
- * `body_too_large`: The JSON body exceeds 64 KiB.
13912
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12745
13913
  */
12746
13914
  413: Error;
12747
13915
  /**
@@ -12822,7 +13990,7 @@ export type CompleteProfilePhotoUploadErrors = {
12822
13990
  */
12823
13991
  409: Error;
12824
13992
  /**
12825
- * `body_too_large`: The JSON body exceeds 64 KiB.
13993
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12826
13994
  */
12827
13995
  413: Error;
12828
13996
  /**
@@ -12903,7 +14071,7 @@ export type RequestWhatsAppDisplayNameErrors = {
12903
14071
  */
12904
14072
  409: Error;
12905
14073
  /**
12906
- * `body_too_large`: The JSON body exceeds 64 KiB.
14074
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
12907
14075
  */
12908
14076
  413: Error;
12909
14077
  /**
@@ -13101,7 +14269,7 @@ export type CreateBroadcastErrors = {
13101
14269
  */
13102
14270
  409: Error;
13103
14271
  /**
13104
- * `body_too_large`: The JSON body exceeds 64 KiB.
14272
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
13105
14273
  */
13106
14274
  413: Error;
13107
14275
  /**
@@ -13341,7 +14509,7 @@ export type AssignConversationsErrors = {
13341
14509
  */
13342
14510
  409: Error;
13343
14511
  /**
13344
- * `body_too_large`: The JSON body exceeds 64 KiB.
14512
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
13345
14513
  */
13346
14514
  413: Error;
13347
14515
  /**
@@ -13414,7 +14582,7 @@ export type ResolveConversationHandoffErrors = {
13414
14582
  */
13415
14583
  409: Error;
13416
14584
  /**
13417
- * `body_too_large`: The JSON body exceeds 64 KiB.
14585
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
13418
14586
  */
13419
14587
  413: Error;
13420
14588
  /**
@@ -13529,7 +14697,7 @@ export type PreviewBroadcastAudienceErrors = {
13529
14697
  */
13530
14698
  404: Error;
13531
14699
  /**
13532
- * `body_too_large`: The JSON body exceeds 64 KiB.
14700
+ * `body_too_large`: The JSON body exceeds the size limit for this operation.
13533
14701
  */
13534
14702
  413: Error;
13535
14703
  /**