getricky 0.1.25 → 0.1.28
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.
|
@@ -1962,7 +1962,7 @@ export type DashboardReport = {
|
|
|
1962
1962
|
*/
|
|
1963
1963
|
channel: 'whatsapp' | 'instagram' | 'messenger' | 'webchat';
|
|
1964
1964
|
/**
|
|
1965
|
-
*
|
|
1965
|
+
* Customer name as the inbox shows it: the contact’s saved name, else the channel profile name, else the contact’s phone.
|
|
1966
1966
|
*/
|
|
1967
1967
|
participant_name: string | null;
|
|
1968
1968
|
/**
|
|
@@ -2786,6 +2786,124 @@ export type ReminderHistory = {
|
|
|
2786
2786
|
error: string | null;
|
|
2787
2787
|
}>;
|
|
2788
2788
|
};
|
|
2789
|
+
export type BusinessHours = {
|
|
2790
|
+
/**
|
|
2791
|
+
* IANA time zone, for example `America/Panama`.
|
|
2792
|
+
*/
|
|
2793
|
+
timezone: string;
|
|
2794
|
+
/**
|
|
2795
|
+
* Open ranges of each weekday, in `timezone`; a range never crosses midnight. A day left out of a request is closed. When sent, `start`, `end` and `weekdays` are ignored.
|
|
2796
|
+
*/
|
|
2797
|
+
days: {
|
|
2798
|
+
/**
|
|
2799
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
2800
|
+
*/
|
|
2801
|
+
monday: Array<{
|
|
2802
|
+
/**
|
|
2803
|
+
* Opens, `HH:MM`.
|
|
2804
|
+
*/
|
|
2805
|
+
start: string;
|
|
2806
|
+
/**
|
|
2807
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
2808
|
+
*/
|
|
2809
|
+
end: string;
|
|
2810
|
+
}>;
|
|
2811
|
+
/**
|
|
2812
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
2813
|
+
*/
|
|
2814
|
+
tuesday: Array<{
|
|
2815
|
+
/**
|
|
2816
|
+
* Opens, `HH:MM`.
|
|
2817
|
+
*/
|
|
2818
|
+
start: string;
|
|
2819
|
+
/**
|
|
2820
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
2821
|
+
*/
|
|
2822
|
+
end: string;
|
|
2823
|
+
}>;
|
|
2824
|
+
/**
|
|
2825
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
2826
|
+
*/
|
|
2827
|
+
wednesday: Array<{
|
|
2828
|
+
/**
|
|
2829
|
+
* Opens, `HH:MM`.
|
|
2830
|
+
*/
|
|
2831
|
+
start: string;
|
|
2832
|
+
/**
|
|
2833
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
2834
|
+
*/
|
|
2835
|
+
end: string;
|
|
2836
|
+
}>;
|
|
2837
|
+
/**
|
|
2838
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
2839
|
+
*/
|
|
2840
|
+
thursday: Array<{
|
|
2841
|
+
/**
|
|
2842
|
+
* Opens, `HH:MM`.
|
|
2843
|
+
*/
|
|
2844
|
+
start: string;
|
|
2845
|
+
/**
|
|
2846
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
2847
|
+
*/
|
|
2848
|
+
end: string;
|
|
2849
|
+
}>;
|
|
2850
|
+
/**
|
|
2851
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
2852
|
+
*/
|
|
2853
|
+
friday: Array<{
|
|
2854
|
+
/**
|
|
2855
|
+
* Opens, `HH:MM`.
|
|
2856
|
+
*/
|
|
2857
|
+
start: string;
|
|
2858
|
+
/**
|
|
2859
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
2860
|
+
*/
|
|
2861
|
+
end: string;
|
|
2862
|
+
}>;
|
|
2863
|
+
/**
|
|
2864
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
2865
|
+
*/
|
|
2866
|
+
saturday: Array<{
|
|
2867
|
+
/**
|
|
2868
|
+
* Opens, `HH:MM`.
|
|
2869
|
+
*/
|
|
2870
|
+
start: string;
|
|
2871
|
+
/**
|
|
2872
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
2873
|
+
*/
|
|
2874
|
+
end: string;
|
|
2875
|
+
}>;
|
|
2876
|
+
/**
|
|
2877
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
2878
|
+
*/
|
|
2879
|
+
sunday: Array<{
|
|
2880
|
+
/**
|
|
2881
|
+
* Opens, `HH:MM`.
|
|
2882
|
+
*/
|
|
2883
|
+
start: string;
|
|
2884
|
+
/**
|
|
2885
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
2886
|
+
*/
|
|
2887
|
+
end: string;
|
|
2888
|
+
}>;
|
|
2889
|
+
};
|
|
2890
|
+
/**
|
|
2891
|
+
* Local dates closed whatever the weekday says, such as holidays, `YYYY-MM-DD`.
|
|
2892
|
+
*/
|
|
2893
|
+
closed_dates: Array<string>;
|
|
2894
|
+
/**
|
|
2895
|
+
* Deprecated, read `days`: opening time when every open day has the same hours; otherwise the earliest opening of the week.
|
|
2896
|
+
*/
|
|
2897
|
+
start: string;
|
|
2898
|
+
/**
|
|
2899
|
+
* Deprecated, read `days`: closing time when every open day has the same hours (before `start` when they cross midnight); otherwise the latest closing of the week.
|
|
2900
|
+
*/
|
|
2901
|
+
end: string;
|
|
2902
|
+
/**
|
|
2903
|
+
* Deprecated, read `days`: open days, 0 for Sunday to 6 for Saturday.
|
|
2904
|
+
*/
|
|
2905
|
+
weekdays: Array<number>;
|
|
2906
|
+
};
|
|
2789
2907
|
/**
|
|
2790
2908
|
* An automation Ricky runs for the organization.
|
|
2791
2909
|
*/
|
|
@@ -2808,9 +2926,9 @@ export type Workflow = {
|
|
|
2808
2926
|
type: 'conversation' | 'scheduled';
|
|
2809
2927
|
definition: {
|
|
2810
2928
|
/**
|
|
2811
|
-
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives; `message_received` on every incoming message. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers every conversation of its channels and no assignee moves.
|
|
2929
|
+
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives; `message_received` on every incoming message. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers every conversation of its channels and no assignee moves. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
|
|
2812
2930
|
*/
|
|
2813
|
-
trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'team_away';
|
|
2931
|
+
trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'team_away' | 'call_received';
|
|
2814
2932
|
/**
|
|
2815
2933
|
* Channels it listens to. See `GET /channels`.
|
|
2816
2934
|
*/
|
|
@@ -2850,44 +2968,10 @@ export type Workflow = {
|
|
|
2850
2968
|
*/
|
|
2851
2969
|
condition: {
|
|
2852
2970
|
kind: 'inside_business_hours';
|
|
2853
|
-
business_hours:
|
|
2854
|
-
/**
|
|
2855
|
-
* Opening time, `HH:MM`.
|
|
2856
|
-
*/
|
|
2857
|
-
start: string;
|
|
2858
|
-
/**
|
|
2859
|
-
* Closing time, `HH:MM`.
|
|
2860
|
-
*/
|
|
2861
|
-
end: string;
|
|
2862
|
-
/**
|
|
2863
|
-
* IANA time zone, for example `America/Panama`.
|
|
2864
|
-
*/
|
|
2865
|
-
timezone: string;
|
|
2866
|
-
/**
|
|
2867
|
-
* Open days, 0 for Sunday to 6 for Saturday.
|
|
2868
|
-
*/
|
|
2869
|
-
weekdays: Array<number>;
|
|
2870
|
-
};
|
|
2971
|
+
business_hours: BusinessHours;
|
|
2871
2972
|
} | {
|
|
2872
2973
|
kind: 'outside_business_hours';
|
|
2873
|
-
business_hours:
|
|
2874
|
-
/**
|
|
2875
|
-
* Opening time, `HH:MM`.
|
|
2876
|
-
*/
|
|
2877
|
-
start: string;
|
|
2878
|
-
/**
|
|
2879
|
-
* Closing time, `HH:MM`.
|
|
2880
|
-
*/
|
|
2881
|
-
end: string;
|
|
2882
|
-
/**
|
|
2883
|
-
* IANA time zone, for example `America/Panama`.
|
|
2884
|
-
*/
|
|
2885
|
-
timezone: string;
|
|
2886
|
-
/**
|
|
2887
|
-
* Open days, 0 for Sunday to 6 for Saturday.
|
|
2888
|
-
*/
|
|
2889
|
-
weekdays: Array<number>;
|
|
2890
|
-
};
|
|
2974
|
+
business_hours: BusinessHours;
|
|
2891
2975
|
} | null;
|
|
2892
2976
|
/**
|
|
2893
2977
|
* The steps and how they connect.
|
|
@@ -2898,7 +2982,7 @@ export type Workflow = {
|
|
|
2898
2982
|
*/
|
|
2899
2983
|
entry: string;
|
|
2900
2984
|
/**
|
|
2901
|
-
* One step. `close_conversation` and `
|
|
2985
|
+
* One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
|
|
2902
2986
|
*/
|
|
2903
2987
|
steps: Array<{
|
|
2904
2988
|
/**
|
|
@@ -2974,12 +3058,19 @@ export type Workflow = {
|
|
|
2974
3058
|
/**
|
|
2975
3059
|
* Name the answer is kept under, for a later `branch`.
|
|
2976
3060
|
*/
|
|
2977
|
-
answer_key
|
|
2978
|
-
|
|
3061
|
+
answer_key?: string;
|
|
3062
|
+
/**
|
|
3063
|
+
* How the answer is compared. With `answer_key` and `value`.
|
|
3064
|
+
*/
|
|
3065
|
+
operator?: 'equals' | 'contains' | 'exists';
|
|
2979
3066
|
/**
|
|
2980
3067
|
* Value compared with the answer.
|
|
2981
3068
|
*/
|
|
2982
|
-
value
|
|
3069
|
+
value?: string;
|
|
3070
|
+
/**
|
|
3071
|
+
* Holds while the business is open at the moment the step runs. Send it instead of `answer_key`, `operator` and `value`.
|
|
3072
|
+
*/
|
|
3073
|
+
business_hours?: BusinessHours;
|
|
2983
3074
|
/**
|
|
2984
3075
|
* Step to run when the condition does not hold; `next` when it does.
|
|
2985
3076
|
*/
|
|
@@ -3012,6 +3103,10 @@ export type Workflow = {
|
|
|
3012
3103
|
* Member who takes the conversation. See `GET /members`.
|
|
3013
3104
|
*/
|
|
3014
3105
|
user_id: string;
|
|
3106
|
+
/**
|
|
3107
|
+
* Members who take new conversations in turn, when there are two or more.
|
|
3108
|
+
*/
|
|
3109
|
+
user_ids?: Array<string>;
|
|
3015
3110
|
} | {
|
|
3016
3111
|
/**
|
|
3017
3112
|
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
@@ -3046,6 +3141,34 @@ export type Workflow = {
|
|
|
3046
3141
|
*/
|
|
3047
3142
|
next: string | null;
|
|
3048
3143
|
kind: 'end';
|
|
3144
|
+
} | {
|
|
3145
|
+
/**
|
|
3146
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
3147
|
+
*/
|
|
3148
|
+
id: string;
|
|
3149
|
+
/**
|
|
3150
|
+
* Step to run next; null ends the flow.
|
|
3151
|
+
*/
|
|
3152
|
+
next: string | null;
|
|
3153
|
+
kind: 'answer_call';
|
|
3154
|
+
/**
|
|
3155
|
+
* AI agent that answers the call, in a `call_received` workflow. The conversation keeps whoever holds it.
|
|
3156
|
+
*/
|
|
3157
|
+
agent_id: string;
|
|
3158
|
+
} | {
|
|
3159
|
+
/**
|
|
3160
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
3161
|
+
*/
|
|
3162
|
+
id: string;
|
|
3163
|
+
/**
|
|
3164
|
+
* Step to run next; null ends the flow.
|
|
3165
|
+
*/
|
|
3166
|
+
next: string | null;
|
|
3167
|
+
kind: 'decline_call';
|
|
3168
|
+
/**
|
|
3169
|
+
* In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
|
|
3170
|
+
*/
|
|
3171
|
+
text: string;
|
|
3049
3172
|
}>;
|
|
3050
3173
|
};
|
|
3051
3174
|
} | {
|
|
@@ -4300,6 +4423,124 @@ export type UploadWorkflowHeaderMedia = {
|
|
|
4300
4423
|
*/
|
|
4301
4424
|
file_name?: string;
|
|
4302
4425
|
};
|
|
4426
|
+
export type BusinessHoursInput = {
|
|
4427
|
+
/**
|
|
4428
|
+
* IANA time zone, for example `America/Panama`.
|
|
4429
|
+
*/
|
|
4430
|
+
timezone: string;
|
|
4431
|
+
/**
|
|
4432
|
+
* Open ranges of each weekday, in `timezone`; a range never crosses midnight. A day left out of a request is closed. When sent, `start`, `end` and `weekdays` are ignored.
|
|
4433
|
+
*/
|
|
4434
|
+
days?: {
|
|
4435
|
+
/**
|
|
4436
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
4437
|
+
*/
|
|
4438
|
+
monday?: Array<{
|
|
4439
|
+
/**
|
|
4440
|
+
* Opens, `HH:MM`.
|
|
4441
|
+
*/
|
|
4442
|
+
start: string;
|
|
4443
|
+
/**
|
|
4444
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
4445
|
+
*/
|
|
4446
|
+
end: string;
|
|
4447
|
+
}>;
|
|
4448
|
+
/**
|
|
4449
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
4450
|
+
*/
|
|
4451
|
+
tuesday?: Array<{
|
|
4452
|
+
/**
|
|
4453
|
+
* Opens, `HH:MM`.
|
|
4454
|
+
*/
|
|
4455
|
+
start: string;
|
|
4456
|
+
/**
|
|
4457
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
4458
|
+
*/
|
|
4459
|
+
end: string;
|
|
4460
|
+
}>;
|
|
4461
|
+
/**
|
|
4462
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
4463
|
+
*/
|
|
4464
|
+
wednesday?: Array<{
|
|
4465
|
+
/**
|
|
4466
|
+
* Opens, `HH:MM`.
|
|
4467
|
+
*/
|
|
4468
|
+
start: string;
|
|
4469
|
+
/**
|
|
4470
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
4471
|
+
*/
|
|
4472
|
+
end: string;
|
|
4473
|
+
}>;
|
|
4474
|
+
/**
|
|
4475
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
4476
|
+
*/
|
|
4477
|
+
thursday?: Array<{
|
|
4478
|
+
/**
|
|
4479
|
+
* Opens, `HH:MM`.
|
|
4480
|
+
*/
|
|
4481
|
+
start: string;
|
|
4482
|
+
/**
|
|
4483
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
4484
|
+
*/
|
|
4485
|
+
end: string;
|
|
4486
|
+
}>;
|
|
4487
|
+
/**
|
|
4488
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
4489
|
+
*/
|
|
4490
|
+
friday?: Array<{
|
|
4491
|
+
/**
|
|
4492
|
+
* Opens, `HH:MM`.
|
|
4493
|
+
*/
|
|
4494
|
+
start: string;
|
|
4495
|
+
/**
|
|
4496
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
4497
|
+
*/
|
|
4498
|
+
end: string;
|
|
4499
|
+
}>;
|
|
4500
|
+
/**
|
|
4501
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
4502
|
+
*/
|
|
4503
|
+
saturday?: Array<{
|
|
4504
|
+
/**
|
|
4505
|
+
* Opens, `HH:MM`.
|
|
4506
|
+
*/
|
|
4507
|
+
start: string;
|
|
4508
|
+
/**
|
|
4509
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
4510
|
+
*/
|
|
4511
|
+
end: string;
|
|
4512
|
+
}>;
|
|
4513
|
+
/**
|
|
4514
|
+
* Up to 3 ranges in order; empty when closed that day.
|
|
4515
|
+
*/
|
|
4516
|
+
sunday?: Array<{
|
|
4517
|
+
/**
|
|
4518
|
+
* Opens, `HH:MM`.
|
|
4519
|
+
*/
|
|
4520
|
+
start: string;
|
|
4521
|
+
/**
|
|
4522
|
+
* Closes, `HH:MM`, after `start`; `24:00` is the end of the day.
|
|
4523
|
+
*/
|
|
4524
|
+
end: string;
|
|
4525
|
+
}>;
|
|
4526
|
+
};
|
|
4527
|
+
/**
|
|
4528
|
+
* Local dates closed whatever the weekday says, such as holidays, `YYYY-MM-DD`.
|
|
4529
|
+
*/
|
|
4530
|
+
closed_dates?: Array<string>;
|
|
4531
|
+
/**
|
|
4532
|
+
* Deprecated, read `days`: opening time when every open day has the same hours; otherwise the earliest opening of the week.
|
|
4533
|
+
*/
|
|
4534
|
+
start?: string;
|
|
4535
|
+
/**
|
|
4536
|
+
* Deprecated, read `days`: closing time when every open day has the same hours (before `start` when they cross midnight); otherwise the latest closing of the week.
|
|
4537
|
+
*/
|
|
4538
|
+
end?: string;
|
|
4539
|
+
/**
|
|
4540
|
+
* Deprecated, read `days`: open days, 0 for Sunday to 6 for Saturday.
|
|
4541
|
+
*/
|
|
4542
|
+
weekdays?: Array<number>;
|
|
4543
|
+
};
|
|
4303
4544
|
/**
|
|
4304
4545
|
* Creates a conversation workflow as a `draft`. Activating it is a separate call.
|
|
4305
4546
|
*/
|
|
@@ -4313,9 +4554,9 @@ export type CreateWorkflow = {
|
|
|
4313
4554
|
*/
|
|
4314
4555
|
definition: {
|
|
4315
4556
|
/**
|
|
4316
|
-
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives; `message_received` on every incoming message. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers every conversation of its channels and no assignee moves.
|
|
4557
|
+
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives; `message_received` on every incoming message. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers every conversation of its channels and no assignee moves. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
|
|
4317
4558
|
*/
|
|
4318
|
-
trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'team_away';
|
|
4559
|
+
trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'team_away' | 'call_received';
|
|
4319
4560
|
/**
|
|
4320
4561
|
* Channels it listens to. See `GET /channels`.
|
|
4321
4562
|
*/
|
|
@@ -4355,44 +4596,10 @@ export type CreateWorkflow = {
|
|
|
4355
4596
|
*/
|
|
4356
4597
|
condition: {
|
|
4357
4598
|
kind: 'inside_business_hours';
|
|
4358
|
-
business_hours:
|
|
4359
|
-
/**
|
|
4360
|
-
* Opening time, `HH:MM`.
|
|
4361
|
-
*/
|
|
4362
|
-
start: string;
|
|
4363
|
-
/**
|
|
4364
|
-
* Closing time, `HH:MM`.
|
|
4365
|
-
*/
|
|
4366
|
-
end: string;
|
|
4367
|
-
/**
|
|
4368
|
-
* IANA time zone, for example `America/Panama`.
|
|
4369
|
-
*/
|
|
4370
|
-
timezone: string;
|
|
4371
|
-
/**
|
|
4372
|
-
* Open days, 0 for Sunday to 6 for Saturday.
|
|
4373
|
-
*/
|
|
4374
|
-
weekdays: Array<number>;
|
|
4375
|
-
};
|
|
4599
|
+
business_hours: BusinessHoursInput;
|
|
4376
4600
|
} | {
|
|
4377
4601
|
kind: 'outside_business_hours';
|
|
4378
|
-
business_hours:
|
|
4379
|
-
/**
|
|
4380
|
-
* Opening time, `HH:MM`.
|
|
4381
|
-
*/
|
|
4382
|
-
start: string;
|
|
4383
|
-
/**
|
|
4384
|
-
* Closing time, `HH:MM`.
|
|
4385
|
-
*/
|
|
4386
|
-
end: string;
|
|
4387
|
-
/**
|
|
4388
|
-
* IANA time zone, for example `America/Panama`.
|
|
4389
|
-
*/
|
|
4390
|
-
timezone: string;
|
|
4391
|
-
/**
|
|
4392
|
-
* Open days, 0 for Sunday to 6 for Saturday.
|
|
4393
|
-
*/
|
|
4394
|
-
weekdays: Array<number>;
|
|
4395
|
-
};
|
|
4602
|
+
business_hours: BusinessHoursInput;
|
|
4396
4603
|
} | null;
|
|
4397
4604
|
/**
|
|
4398
4605
|
* The steps and how they connect.
|
|
@@ -4403,7 +4610,7 @@ export type CreateWorkflow = {
|
|
|
4403
4610
|
*/
|
|
4404
4611
|
entry: string;
|
|
4405
4612
|
/**
|
|
4406
|
-
* One step. `close_conversation` and `
|
|
4613
|
+
* One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
|
|
4407
4614
|
*/
|
|
4408
4615
|
steps: Array<{
|
|
4409
4616
|
/**
|
|
@@ -4479,12 +4686,19 @@ export type CreateWorkflow = {
|
|
|
4479
4686
|
/**
|
|
4480
4687
|
* Name the answer is kept under, for a later `branch`.
|
|
4481
4688
|
*/
|
|
4482
|
-
answer_key
|
|
4483
|
-
|
|
4689
|
+
answer_key?: string;
|
|
4690
|
+
/**
|
|
4691
|
+
* How the answer is compared. With `answer_key` and `value`.
|
|
4692
|
+
*/
|
|
4693
|
+
operator?: 'equals' | 'contains' | 'exists';
|
|
4484
4694
|
/**
|
|
4485
4695
|
* Value compared with the answer.
|
|
4486
4696
|
*/
|
|
4487
|
-
value
|
|
4697
|
+
value?: string;
|
|
4698
|
+
/**
|
|
4699
|
+
* Holds while the business is open at the moment the step runs. Send it instead of `answer_key`, `operator` and `value`.
|
|
4700
|
+
*/
|
|
4701
|
+
business_hours?: BusinessHoursInput;
|
|
4488
4702
|
/**
|
|
4489
4703
|
* Step to run when the condition does not hold; `next` when it does.
|
|
4490
4704
|
*/
|
|
@@ -4517,6 +4731,10 @@ export type CreateWorkflow = {
|
|
|
4517
4731
|
* Member who takes the conversation. See `GET /members`.
|
|
4518
4732
|
*/
|
|
4519
4733
|
user_id: string;
|
|
4734
|
+
/**
|
|
4735
|
+
* Members who take new conversations in turn, when there are two or more.
|
|
4736
|
+
*/
|
|
4737
|
+
user_ids?: Array<string>;
|
|
4520
4738
|
} | {
|
|
4521
4739
|
/**
|
|
4522
4740
|
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
@@ -4551,6 +4769,34 @@ export type CreateWorkflow = {
|
|
|
4551
4769
|
*/
|
|
4552
4770
|
next: string | null;
|
|
4553
4771
|
kind: 'end';
|
|
4772
|
+
} | {
|
|
4773
|
+
/**
|
|
4774
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
4775
|
+
*/
|
|
4776
|
+
id: string;
|
|
4777
|
+
/**
|
|
4778
|
+
* Step to run next; null ends the flow.
|
|
4779
|
+
*/
|
|
4780
|
+
next: string | null;
|
|
4781
|
+
kind: 'answer_call';
|
|
4782
|
+
/**
|
|
4783
|
+
* AI agent that answers the call, in a `call_received` workflow. The conversation keeps whoever holds it.
|
|
4784
|
+
*/
|
|
4785
|
+
agent_id: string;
|
|
4786
|
+
} | {
|
|
4787
|
+
/**
|
|
4788
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
4789
|
+
*/
|
|
4790
|
+
id: string;
|
|
4791
|
+
/**
|
|
4792
|
+
* Step to run next; null ends the flow.
|
|
4793
|
+
*/
|
|
4794
|
+
next: string | null;
|
|
4795
|
+
kind: 'decline_call';
|
|
4796
|
+
/**
|
|
4797
|
+
* In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
|
|
4798
|
+
*/
|
|
4799
|
+
text: string;
|
|
4554
4800
|
}>;
|
|
4555
4801
|
};
|
|
4556
4802
|
};
|
|
@@ -4568,9 +4814,9 @@ export type UpdateWorkflow = {
|
|
|
4568
4814
|
*/
|
|
4569
4815
|
definition?: {
|
|
4570
4816
|
/**
|
|
4571
|
-
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives; `message_received` on every incoming message. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers every conversation of its channels and no assignee moves.
|
|
4817
|
+
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives; `message_received` on every incoming message. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers every conversation of its channels and no assignee moves. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
|
|
4572
4818
|
*/
|
|
4573
|
-
trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'team_away';
|
|
4819
|
+
trigger: 'conversation_opened' | 'first_message_received' | 'message_received' | 'team_away' | 'call_received';
|
|
4574
4820
|
/**
|
|
4575
4821
|
* Channels it listens to. See `GET /channels`.
|
|
4576
4822
|
*/
|
|
@@ -4610,44 +4856,10 @@ export type UpdateWorkflow = {
|
|
|
4610
4856
|
*/
|
|
4611
4857
|
condition: {
|
|
4612
4858
|
kind: 'inside_business_hours';
|
|
4613
|
-
business_hours:
|
|
4614
|
-
/**
|
|
4615
|
-
* Opening time, `HH:MM`.
|
|
4616
|
-
*/
|
|
4617
|
-
start: string;
|
|
4618
|
-
/**
|
|
4619
|
-
* Closing time, `HH:MM`.
|
|
4620
|
-
*/
|
|
4621
|
-
end: string;
|
|
4622
|
-
/**
|
|
4623
|
-
* IANA time zone, for example `America/Panama`.
|
|
4624
|
-
*/
|
|
4625
|
-
timezone: string;
|
|
4626
|
-
/**
|
|
4627
|
-
* Open days, 0 for Sunday to 6 for Saturday.
|
|
4628
|
-
*/
|
|
4629
|
-
weekdays: Array<number>;
|
|
4630
|
-
};
|
|
4859
|
+
business_hours: BusinessHoursInput;
|
|
4631
4860
|
} | {
|
|
4632
4861
|
kind: 'outside_business_hours';
|
|
4633
|
-
business_hours:
|
|
4634
|
-
/**
|
|
4635
|
-
* Opening time, `HH:MM`.
|
|
4636
|
-
*/
|
|
4637
|
-
start: string;
|
|
4638
|
-
/**
|
|
4639
|
-
* Closing time, `HH:MM`.
|
|
4640
|
-
*/
|
|
4641
|
-
end: string;
|
|
4642
|
-
/**
|
|
4643
|
-
* IANA time zone, for example `America/Panama`.
|
|
4644
|
-
*/
|
|
4645
|
-
timezone: string;
|
|
4646
|
-
/**
|
|
4647
|
-
* Open days, 0 for Sunday to 6 for Saturday.
|
|
4648
|
-
*/
|
|
4649
|
-
weekdays: Array<number>;
|
|
4650
|
-
};
|
|
4862
|
+
business_hours: BusinessHoursInput;
|
|
4651
4863
|
} | null;
|
|
4652
4864
|
/**
|
|
4653
4865
|
* The steps and how they connect.
|
|
@@ -4658,7 +4870,7 @@ export type UpdateWorkflow = {
|
|
|
4658
4870
|
*/
|
|
4659
4871
|
entry: string;
|
|
4660
4872
|
/**
|
|
4661
|
-
* One step. `close_conversation` and `
|
|
4873
|
+
* One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
|
|
4662
4874
|
*/
|
|
4663
4875
|
steps: Array<{
|
|
4664
4876
|
/**
|
|
@@ -4734,12 +4946,19 @@ export type UpdateWorkflow = {
|
|
|
4734
4946
|
/**
|
|
4735
4947
|
* Name the answer is kept under, for a later `branch`.
|
|
4736
4948
|
*/
|
|
4737
|
-
answer_key
|
|
4738
|
-
|
|
4949
|
+
answer_key?: string;
|
|
4950
|
+
/**
|
|
4951
|
+
* How the answer is compared. With `answer_key` and `value`.
|
|
4952
|
+
*/
|
|
4953
|
+
operator?: 'equals' | 'contains' | 'exists';
|
|
4739
4954
|
/**
|
|
4740
4955
|
* Value compared with the answer.
|
|
4741
4956
|
*/
|
|
4742
|
-
value
|
|
4957
|
+
value?: string;
|
|
4958
|
+
/**
|
|
4959
|
+
* Holds while the business is open at the moment the step runs. Send it instead of `answer_key`, `operator` and `value`.
|
|
4960
|
+
*/
|
|
4961
|
+
business_hours?: BusinessHoursInput;
|
|
4743
4962
|
/**
|
|
4744
4963
|
* Step to run when the condition does not hold; `next` when it does.
|
|
4745
4964
|
*/
|
|
@@ -4772,6 +4991,10 @@ export type UpdateWorkflow = {
|
|
|
4772
4991
|
* Member who takes the conversation. See `GET /members`.
|
|
4773
4992
|
*/
|
|
4774
4993
|
user_id: string;
|
|
4994
|
+
/**
|
|
4995
|
+
* Members who take new conversations in turn, when there are two or more.
|
|
4996
|
+
*/
|
|
4997
|
+
user_ids?: Array<string>;
|
|
4775
4998
|
} | {
|
|
4776
4999
|
/**
|
|
4777
5000
|
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
@@ -4806,6 +5029,34 @@ export type UpdateWorkflow = {
|
|
|
4806
5029
|
*/
|
|
4807
5030
|
next: string | null;
|
|
4808
5031
|
kind: 'end';
|
|
5032
|
+
} | {
|
|
5033
|
+
/**
|
|
5034
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
5035
|
+
*/
|
|
5036
|
+
id: string;
|
|
5037
|
+
/**
|
|
5038
|
+
* Step to run next; null ends the flow.
|
|
5039
|
+
*/
|
|
5040
|
+
next: string | null;
|
|
5041
|
+
kind: 'answer_call';
|
|
5042
|
+
/**
|
|
5043
|
+
* AI agent that answers the call, in a `call_received` workflow. The conversation keeps whoever holds it.
|
|
5044
|
+
*/
|
|
5045
|
+
agent_id: string;
|
|
5046
|
+
} | {
|
|
5047
|
+
/**
|
|
5048
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
5049
|
+
*/
|
|
5050
|
+
id: string;
|
|
5051
|
+
/**
|
|
5052
|
+
* Step to run next; null ends the flow.
|
|
5053
|
+
*/
|
|
5054
|
+
next: string | null;
|
|
5055
|
+
kind: 'decline_call';
|
|
5056
|
+
/**
|
|
5057
|
+
* In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
|
|
5058
|
+
*/
|
|
5059
|
+
text: string;
|
|
4809
5060
|
}>;
|
|
4810
5061
|
};
|
|
4811
5062
|
};
|