getricky 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/generated/idempotency.gen.js +2 -0
- package/dist/cjs/generated/index.d.ts +1 -1
- package/dist/cjs/generated/sdk.gen.d.ts +129 -1
- package/dist/cjs/generated/sdk.gen.js +248 -0
- package/dist/cjs/generated/types.gen.d.ts +3445 -783
- package/dist/esm/generated/idempotency.gen.js +2 -0
- package/dist/esm/generated/index.d.ts +1 -1
- package/dist/esm/generated/sdk.gen.d.ts +129 -1
- package/dist/esm/generated/sdk.gen.js +248 -0
- package/dist/esm/generated/types.gen.d.ts +3445 -783
- package/package.json +1 -1
|
@@ -601,385 +601,2958 @@ export type WebhookTestResult = {
|
|
|
601
601
|
duration_ms: number;
|
|
602
602
|
};
|
|
603
603
|
/**
|
|
604
|
-
*
|
|
604
|
+
* The days a report covers, in America/Panama time, and the period it is compared with.
|
|
605
605
|
*/
|
|
606
|
-
export type
|
|
607
|
-
/**
|
|
608
|
-
* First name.
|
|
609
|
-
*/
|
|
610
|
-
first_name?: string | null;
|
|
611
|
-
/**
|
|
612
|
-
* Last name.
|
|
613
|
-
*/
|
|
614
|
-
last_name?: string | null;
|
|
615
|
-
/**
|
|
616
|
-
* Email.
|
|
617
|
-
*/
|
|
618
|
-
primary_email?: string | null;
|
|
619
|
-
/**
|
|
620
|
-
* Phone with country code, for example `+507 6000-1234`.
|
|
621
|
-
*/
|
|
622
|
-
primary_phone?: string | null;
|
|
623
|
-
/**
|
|
624
|
-
* Company.
|
|
625
|
-
*/
|
|
626
|
-
company?: string | null;
|
|
606
|
+
export type ReportPeriod = {
|
|
627
607
|
/**
|
|
628
|
-
*
|
|
608
|
+
* First day, inclusive.
|
|
629
609
|
*/
|
|
630
|
-
|
|
610
|
+
from: string;
|
|
631
611
|
/**
|
|
632
|
-
*
|
|
612
|
+
* Last day, inclusive. A `to` after today is today.
|
|
633
613
|
*/
|
|
634
|
-
|
|
614
|
+
to: string;
|
|
635
615
|
/**
|
|
636
|
-
*
|
|
616
|
+
* Days in the period.
|
|
637
617
|
*/
|
|
638
|
-
|
|
618
|
+
days: number;
|
|
639
619
|
/**
|
|
640
|
-
*
|
|
620
|
+
* `hour` when the period is one day: series then have 24 hourly slots.
|
|
641
621
|
*/
|
|
642
|
-
|
|
622
|
+
granularity: 'day' | 'hour';
|
|
643
623
|
/**
|
|
644
|
-
*
|
|
624
|
+
* The time zone of every day and hour in the report.
|
|
645
625
|
*/
|
|
646
|
-
|
|
626
|
+
time_zone: 'America/Panama';
|
|
647
627
|
/**
|
|
648
|
-
*
|
|
628
|
+
* First day of the previous period: the same number of days, right before.
|
|
649
629
|
*/
|
|
650
|
-
|
|
630
|
+
previous_from: string;
|
|
651
631
|
/**
|
|
652
|
-
*
|
|
632
|
+
* Last day of the previous period.
|
|
653
633
|
*/
|
|
654
|
-
|
|
634
|
+
previous_to: string;
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* How many customers write, whether they are new, and when. Only messages customers send count: a customer is a conversation with at least one of them in the period, and it is new when its first message ever falls in the period. Messages from the team, AI agents or campaigns and conversation openings and closes play no part.
|
|
638
|
+
*/
|
|
639
|
+
export type ConversationsReport = {
|
|
640
|
+
period: ReportPeriod;
|
|
655
641
|
/**
|
|
656
|
-
*
|
|
642
|
+
* The channel filter the report applied.
|
|
657
643
|
*/
|
|
658
|
-
|
|
644
|
+
channel: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
659
645
|
/**
|
|
660
|
-
*
|
|
646
|
+
* The period.
|
|
661
647
|
*/
|
|
662
|
-
|
|
648
|
+
totals: {
|
|
649
|
+
/**
|
|
650
|
+
* Conversations with at least one customer message in the period.
|
|
651
|
+
*/
|
|
652
|
+
customers: number;
|
|
653
|
+
/**
|
|
654
|
+
* Customers whose first message ever falls in the period.
|
|
655
|
+
*/
|
|
656
|
+
new_customers: number;
|
|
657
|
+
/**
|
|
658
|
+
* Customers who had written before the period.
|
|
659
|
+
*/
|
|
660
|
+
returning_customers: number;
|
|
661
|
+
/**
|
|
662
|
+
* Messages customers sent in the period.
|
|
663
|
+
*/
|
|
664
|
+
messages: number;
|
|
665
|
+
};
|
|
663
666
|
/**
|
|
664
|
-
*
|
|
667
|
+
* The previous period.
|
|
665
668
|
*/
|
|
666
|
-
|
|
669
|
+
previous: {
|
|
670
|
+
/**
|
|
671
|
+
* Conversations with at least one customer message in the period.
|
|
672
|
+
*/
|
|
673
|
+
customers: number;
|
|
674
|
+
/**
|
|
675
|
+
* Customers whose first message ever falls in the period.
|
|
676
|
+
*/
|
|
677
|
+
new_customers: number;
|
|
678
|
+
/**
|
|
679
|
+
* Customers who had written before the period.
|
|
680
|
+
*/
|
|
681
|
+
returning_customers: number;
|
|
682
|
+
/**
|
|
683
|
+
* Messages customers sent in the period.
|
|
684
|
+
*/
|
|
685
|
+
messages: number;
|
|
686
|
+
};
|
|
667
687
|
/**
|
|
668
|
-
*
|
|
688
|
+
* The period per channel, most customers first.
|
|
669
689
|
*/
|
|
670
|
-
|
|
690
|
+
by_channel: Array<{
|
|
691
|
+
/**
|
|
692
|
+
* Channel.
|
|
693
|
+
*/
|
|
694
|
+
channel: 'whatsapp' | 'instagram' | 'messenger';
|
|
695
|
+
/**
|
|
696
|
+
* Conversations with at least one customer message in the period.
|
|
697
|
+
*/
|
|
698
|
+
customers: number;
|
|
699
|
+
/**
|
|
700
|
+
* Customers whose first message ever falls in the period.
|
|
701
|
+
*/
|
|
702
|
+
new_customers: number;
|
|
703
|
+
/**
|
|
704
|
+
* Customers who had written before the period.
|
|
705
|
+
*/
|
|
706
|
+
returning_customers: number;
|
|
707
|
+
/**
|
|
708
|
+
* Messages customers sent in the period.
|
|
709
|
+
*/
|
|
710
|
+
messages: number;
|
|
711
|
+
}>;
|
|
671
712
|
/**
|
|
672
|
-
*
|
|
713
|
+
* One entry per day of the period, or per hour of a one-day period.
|
|
673
714
|
*/
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
715
|
+
series: Array<{
|
|
716
|
+
/**
|
|
717
|
+
* America/Panama day `YYYY-MM-DD`, or hour `YYYY-MM-DDTHH` when the period is one day.
|
|
718
|
+
*/
|
|
719
|
+
slot: string;
|
|
720
|
+
/**
|
|
721
|
+
* Customers whose first message ever falls in this slot.
|
|
722
|
+
*/
|
|
723
|
+
new_customers: number;
|
|
724
|
+
/**
|
|
725
|
+
* Customers who wrote in this slot and had written before.
|
|
726
|
+
*/
|
|
727
|
+
returning_customers: number;
|
|
728
|
+
previous_customers: number | null;
|
|
729
|
+
}>;
|
|
677
730
|
/**
|
|
678
|
-
*
|
|
731
|
+
* Customer messages of the period per weekday and hour; slots without any are left out.
|
|
679
732
|
*/
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
733
|
+
heatmap: Array<{
|
|
734
|
+
/**
|
|
735
|
+
* 0 is Sunday, 6 is Saturday.
|
|
736
|
+
*/
|
|
737
|
+
day_of_week: number;
|
|
738
|
+
/**
|
|
739
|
+
* Hour of the day, 0–23.
|
|
740
|
+
*/
|
|
741
|
+
hour: number;
|
|
742
|
+
/**
|
|
743
|
+
* Customer messages in that hour of that weekday.
|
|
744
|
+
*/
|
|
745
|
+
messages: number;
|
|
746
|
+
}>;
|
|
683
747
|
/**
|
|
684
|
-
*
|
|
748
|
+
* When Ricky computed the report.
|
|
685
749
|
*/
|
|
686
|
-
|
|
750
|
+
generated_at: string;
|
|
687
751
|
};
|
|
688
752
|
/**
|
|
689
|
-
*
|
|
753
|
+
* Messages received from customers and sent to them in the period, and who sent them, dated when each message was sent.
|
|
690
754
|
*/
|
|
691
|
-
export type
|
|
692
|
-
|
|
693
|
-
* First name.
|
|
694
|
-
*/
|
|
695
|
-
first_name?: string | null;
|
|
755
|
+
export type MessagesReport = {
|
|
756
|
+
period: ReportPeriod;
|
|
696
757
|
/**
|
|
697
|
-
*
|
|
758
|
+
* The channel filter the report applied.
|
|
698
759
|
*/
|
|
699
|
-
|
|
760
|
+
channel: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
700
761
|
/**
|
|
701
|
-
*
|
|
762
|
+
* The period.
|
|
702
763
|
*/
|
|
703
|
-
|
|
764
|
+
totals: {
|
|
765
|
+
/**
|
|
766
|
+
* Messages customers sent.
|
|
767
|
+
*/
|
|
768
|
+
received: number;
|
|
769
|
+
/**
|
|
770
|
+
* Messages sent to customers, by anyone; the sum of `sent_by`.
|
|
771
|
+
*/
|
|
772
|
+
sent: number;
|
|
773
|
+
/**
|
|
774
|
+
* Sent messages by sender; each message counts in one of them.
|
|
775
|
+
*/
|
|
776
|
+
sent_by: {
|
|
777
|
+
/**
|
|
778
|
+
* Sent by a person in Ricky.
|
|
779
|
+
*/
|
|
780
|
+
human: number;
|
|
781
|
+
/**
|
|
782
|
+
* Sent by an AI agent.
|
|
783
|
+
*/
|
|
784
|
+
ai: number;
|
|
785
|
+
/**
|
|
786
|
+
* Sent by an automation.
|
|
787
|
+
*/
|
|
788
|
+
automation: number;
|
|
789
|
+
/**
|
|
790
|
+
* Templates not sent by an automation: broadcasts and templates sent by hand or through the API.
|
|
791
|
+
*/
|
|
792
|
+
campaign: number;
|
|
793
|
+
/**
|
|
794
|
+
* Sent from the channel's own app, with no sender in Ricky: WhatsApp Business app coexistence and imported history.
|
|
795
|
+
*/
|
|
796
|
+
external: number;
|
|
797
|
+
};
|
|
798
|
+
};
|
|
704
799
|
/**
|
|
705
|
-
*
|
|
800
|
+
* The previous period.
|
|
706
801
|
*/
|
|
707
|
-
|
|
802
|
+
previous: {
|
|
803
|
+
/**
|
|
804
|
+
* Messages customers sent.
|
|
805
|
+
*/
|
|
806
|
+
received: number;
|
|
807
|
+
/**
|
|
808
|
+
* Messages sent to customers, by anyone; the sum of `sent_by`.
|
|
809
|
+
*/
|
|
810
|
+
sent: number;
|
|
811
|
+
/**
|
|
812
|
+
* Sent messages by sender; each message counts in one of them.
|
|
813
|
+
*/
|
|
814
|
+
sent_by: {
|
|
815
|
+
/**
|
|
816
|
+
* Sent by a person in Ricky.
|
|
817
|
+
*/
|
|
818
|
+
human: number;
|
|
819
|
+
/**
|
|
820
|
+
* Sent by an AI agent.
|
|
821
|
+
*/
|
|
822
|
+
ai: number;
|
|
823
|
+
/**
|
|
824
|
+
* Sent by an automation.
|
|
825
|
+
*/
|
|
826
|
+
automation: number;
|
|
827
|
+
/**
|
|
828
|
+
* Templates not sent by an automation: broadcasts and templates sent by hand or through the API.
|
|
829
|
+
*/
|
|
830
|
+
campaign: number;
|
|
831
|
+
/**
|
|
832
|
+
* Sent from the channel's own app, with no sender in Ricky: WhatsApp Business app coexistence and imported history.
|
|
833
|
+
*/
|
|
834
|
+
external: number;
|
|
835
|
+
};
|
|
836
|
+
};
|
|
708
837
|
/**
|
|
709
|
-
*
|
|
838
|
+
* The period per channel, most messages first.
|
|
710
839
|
*/
|
|
711
|
-
|
|
840
|
+
by_channel: Array<{
|
|
841
|
+
/**
|
|
842
|
+
* Channel.
|
|
843
|
+
*/
|
|
844
|
+
channel: 'whatsapp' | 'instagram' | 'messenger';
|
|
845
|
+
/**
|
|
846
|
+
* Messages customers sent.
|
|
847
|
+
*/
|
|
848
|
+
received: number;
|
|
849
|
+
/**
|
|
850
|
+
* Messages sent to customers, by anyone; the sum of `sent_by`.
|
|
851
|
+
*/
|
|
852
|
+
sent: number;
|
|
853
|
+
/**
|
|
854
|
+
* Sent messages by sender; each message counts in one of them.
|
|
855
|
+
*/
|
|
856
|
+
sent_by: {
|
|
857
|
+
/**
|
|
858
|
+
* Sent by a person in Ricky.
|
|
859
|
+
*/
|
|
860
|
+
human: number;
|
|
861
|
+
/**
|
|
862
|
+
* Sent by an AI agent.
|
|
863
|
+
*/
|
|
864
|
+
ai: number;
|
|
865
|
+
/**
|
|
866
|
+
* Sent by an automation.
|
|
867
|
+
*/
|
|
868
|
+
automation: number;
|
|
869
|
+
/**
|
|
870
|
+
* Templates not sent by an automation: broadcasts and templates sent by hand or through the API.
|
|
871
|
+
*/
|
|
872
|
+
campaign: number;
|
|
873
|
+
/**
|
|
874
|
+
* Sent from the channel's own app, with no sender in Ricky: WhatsApp Business app coexistence and imported history.
|
|
875
|
+
*/
|
|
876
|
+
external: number;
|
|
877
|
+
};
|
|
878
|
+
}>;
|
|
712
879
|
/**
|
|
713
|
-
*
|
|
880
|
+
* One entry per day of the period, or per hour of a one-day period.
|
|
714
881
|
*/
|
|
715
|
-
|
|
882
|
+
series: Array<{
|
|
883
|
+
/**
|
|
884
|
+
* America/Panama day `YYYY-MM-DD`, or hour `YYYY-MM-DDTHH` when the period is one day.
|
|
885
|
+
*/
|
|
886
|
+
slot: string;
|
|
887
|
+
/**
|
|
888
|
+
* Messages customers sent.
|
|
889
|
+
*/
|
|
890
|
+
received: number;
|
|
891
|
+
/**
|
|
892
|
+
* Messages sent to customers, by anyone; the sum of `sent_by`.
|
|
893
|
+
*/
|
|
894
|
+
sent: number;
|
|
895
|
+
/**
|
|
896
|
+
* Sent messages by sender; each message counts in one of them.
|
|
897
|
+
*/
|
|
898
|
+
sent_by: {
|
|
899
|
+
/**
|
|
900
|
+
* Sent by a person in Ricky.
|
|
901
|
+
*/
|
|
902
|
+
human: number;
|
|
903
|
+
/**
|
|
904
|
+
* Sent by an AI agent.
|
|
905
|
+
*/
|
|
906
|
+
ai: number;
|
|
907
|
+
/**
|
|
908
|
+
* Sent by an automation.
|
|
909
|
+
*/
|
|
910
|
+
automation: number;
|
|
911
|
+
/**
|
|
912
|
+
* Templates not sent by an automation: broadcasts and templates sent by hand or through the API.
|
|
913
|
+
*/
|
|
914
|
+
campaign: number;
|
|
915
|
+
/**
|
|
916
|
+
* Sent from the channel's own app, with no sender in Ricky: WhatsApp Business app coexistence and imported history.
|
|
917
|
+
*/
|
|
918
|
+
external: number;
|
|
919
|
+
};
|
|
920
|
+
previous_received: number | null;
|
|
921
|
+
previous_sent: number | null;
|
|
922
|
+
}>;
|
|
716
923
|
/**
|
|
717
|
-
*
|
|
924
|
+
* When Ricky computed the report.
|
|
718
925
|
*/
|
|
719
|
-
|
|
926
|
+
generated_at: string;
|
|
927
|
+
};
|
|
928
|
+
/**
|
|
929
|
+
* What the inbox looks like right now; it has no period.
|
|
930
|
+
*/
|
|
931
|
+
export type DashboardReport = {
|
|
720
932
|
/**
|
|
721
|
-
*
|
|
933
|
+
* Now.
|
|
722
934
|
*/
|
|
723
|
-
|
|
935
|
+
totals: {
|
|
936
|
+
/**
|
|
937
|
+
* Open conversations.
|
|
938
|
+
*/
|
|
939
|
+
open_now: number;
|
|
940
|
+
/**
|
|
941
|
+
* Open conversations with no member or AI agent assigned.
|
|
942
|
+
*/
|
|
943
|
+
unassigned: number;
|
|
944
|
+
/**
|
|
945
|
+
* Open conversations whose last message, reactions aside, is from the customer.
|
|
946
|
+
*/
|
|
947
|
+
awaiting_reply: number;
|
|
948
|
+
/**
|
|
949
|
+
* Handoffs from an AI agent to a person still waiting.
|
|
950
|
+
*/
|
|
951
|
+
pending_handoffs: number;
|
|
952
|
+
/**
|
|
953
|
+
* Conversations opened or reopened today, America/Panama.
|
|
954
|
+
*/
|
|
955
|
+
opened_today: number;
|
|
956
|
+
/**
|
|
957
|
+
* Conversations closed today, America/Panama.
|
|
958
|
+
*/
|
|
959
|
+
closed_today: number;
|
|
960
|
+
};
|
|
724
961
|
/**
|
|
725
|
-
*
|
|
962
|
+
* Open conversations per channel, most first.
|
|
726
963
|
*/
|
|
727
|
-
|
|
964
|
+
by_channel: Array<{
|
|
965
|
+
/**
|
|
966
|
+
* Channel.
|
|
967
|
+
*/
|
|
968
|
+
channel: 'whatsapp' | 'instagram' | 'messenger';
|
|
969
|
+
/**
|
|
970
|
+
* Open conversations.
|
|
971
|
+
*/
|
|
972
|
+
open: number;
|
|
973
|
+
}>;
|
|
728
974
|
/**
|
|
729
|
-
*
|
|
975
|
+
* Open conversations per assignee, most first.
|
|
730
976
|
*/
|
|
731
|
-
|
|
977
|
+
assignees: Array<{
|
|
978
|
+
/**
|
|
979
|
+
* `human` is a member, `ai` an AI agent, `unassigned` nobody.
|
|
980
|
+
*/
|
|
981
|
+
type: 'human' | 'ai' | 'unassigned';
|
|
982
|
+
/**
|
|
983
|
+
* User ID or AI agent ID; null for `unassigned`.
|
|
984
|
+
*/
|
|
985
|
+
id: string | null;
|
|
986
|
+
/**
|
|
987
|
+
* Name; null when it has none and for `unassigned`.
|
|
988
|
+
*/
|
|
989
|
+
name: string | null;
|
|
990
|
+
/**
|
|
991
|
+
* Open conversations they hold.
|
|
992
|
+
*/
|
|
993
|
+
open: number;
|
|
994
|
+
/**
|
|
995
|
+
* Of those, the ones whose last message is from the customer.
|
|
996
|
+
*/
|
|
997
|
+
awaiting_reply: number;
|
|
998
|
+
}>;
|
|
732
999
|
/**
|
|
733
|
-
*
|
|
1000
|
+
* The 15 open conversations waiting longest for a reply, oldest first.
|
|
734
1001
|
*/
|
|
735
|
-
|
|
1002
|
+
longest_waiting: Array<{
|
|
1003
|
+
/**
|
|
1004
|
+
* Conversation ID.
|
|
1005
|
+
*/
|
|
1006
|
+
conversation_id: string;
|
|
1007
|
+
/**
|
|
1008
|
+
* Channel.
|
|
1009
|
+
*/
|
|
1010
|
+
channel: 'whatsapp' | 'instagram' | 'messenger';
|
|
1011
|
+
/**
|
|
1012
|
+
* Name the channel reports for the customer.
|
|
1013
|
+
*/
|
|
1014
|
+
participant_name: string | null;
|
|
1015
|
+
/**
|
|
1016
|
+
* When the customer message they wait on arrived.
|
|
1017
|
+
*/
|
|
1018
|
+
waiting_since: string;
|
|
1019
|
+
/**
|
|
1020
|
+
* `human` is a member, `ai` an AI agent, `unassigned` nobody.
|
|
1021
|
+
*/
|
|
1022
|
+
assignee_type: 'human' | 'ai' | 'unassigned';
|
|
1023
|
+
/**
|
|
1024
|
+
* Assignee name; null when there is none.
|
|
1025
|
+
*/
|
|
1026
|
+
assignee_name: string | null;
|
|
1027
|
+
}>;
|
|
736
1028
|
/**
|
|
737
|
-
*
|
|
1029
|
+
* When Ricky computed the report.
|
|
738
1030
|
*/
|
|
739
|
-
|
|
1031
|
+
generated_at: string;
|
|
1032
|
+
};
|
|
1033
|
+
/**
|
|
1034
|
+
* People and AI agents side by side: what they were assigned, what they sent, what they closed and how fast.
|
|
1035
|
+
*/
|
|
1036
|
+
export type TeamReport = {
|
|
1037
|
+
period: ReportPeriod;
|
|
740
1038
|
/**
|
|
741
|
-
*
|
|
1039
|
+
* The channel filter the report applied.
|
|
742
1040
|
*/
|
|
743
|
-
|
|
1041
|
+
channel: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
744
1042
|
/**
|
|
745
|
-
*
|
|
1043
|
+
* Every member and active AI agent, most messages and closes first.
|
|
746
1044
|
*/
|
|
747
|
-
|
|
1045
|
+
members: Array<{
|
|
1046
|
+
/**
|
|
1047
|
+
* `human` is a member, `ai` an active AI agent.
|
|
1048
|
+
*/
|
|
1049
|
+
type: 'human' | 'ai';
|
|
1050
|
+
/**
|
|
1051
|
+
* User ID or AI agent ID.
|
|
1052
|
+
*/
|
|
1053
|
+
id: string;
|
|
1054
|
+
/**
|
|
1055
|
+
* Name; null when it has none.
|
|
1056
|
+
*/
|
|
1057
|
+
name: string | null;
|
|
1058
|
+
/**
|
|
1059
|
+
* Assignments to them in the period; each assignment counts.
|
|
1060
|
+
*/
|
|
1061
|
+
assigned: number;
|
|
1062
|
+
/**
|
|
1063
|
+
* Messages they sent in the period.
|
|
1064
|
+
*/
|
|
1065
|
+
messages_sent: number;
|
|
1066
|
+
/**
|
|
1067
|
+
* Closes in the period while they held the conversation.
|
|
1068
|
+
*/
|
|
1069
|
+
closed: number;
|
|
1070
|
+
/**
|
|
1071
|
+
* Conversations they hold that are open right now, whatever the period.
|
|
1072
|
+
*/
|
|
1073
|
+
open_now: number;
|
|
1074
|
+
/**
|
|
1075
|
+
* For conversations opened in the period, median time from the opening to the first message a person or AI agent sent, counted for whoever sent it, in seconds. Not narrowed by `channel`.
|
|
1076
|
+
*/
|
|
1077
|
+
median_first_response_seconds: number | null;
|
|
1078
|
+
/**
|
|
1079
|
+
* Median time from opening to close of the conversations they closed, in seconds.
|
|
1080
|
+
*/
|
|
1081
|
+
median_resolution_seconds: number | null;
|
|
1082
|
+
}>;
|
|
1083
|
+
/**
|
|
1084
|
+
* The period.
|
|
1085
|
+
*/
|
|
1086
|
+
totals: {
|
|
1087
|
+
/**
|
|
1088
|
+
* Assignments in the period.
|
|
1089
|
+
*/
|
|
1090
|
+
assignments: number;
|
|
1091
|
+
/**
|
|
1092
|
+
* Assignments in the period that replaced a previous assignee.
|
|
1093
|
+
*/
|
|
1094
|
+
reassignments: number;
|
|
1095
|
+
};
|
|
1096
|
+
/**
|
|
1097
|
+
* When Ricky computed the report.
|
|
1098
|
+
*/
|
|
1099
|
+
generated_at: string;
|
|
1100
|
+
};
|
|
1101
|
+
/**
|
|
1102
|
+
* WhatsApp broadcasts created in the period and what happened to their recipients. Delivered and read come from the template message each recipient's conversation got while the broadcast ran; a recipient counts once.
|
|
1103
|
+
*/
|
|
1104
|
+
export type BroadcastsReport = {
|
|
1105
|
+
period: ReportPeriod;
|
|
1106
|
+
/**
|
|
1107
|
+
* The period.
|
|
1108
|
+
*/
|
|
1109
|
+
totals: {
|
|
1110
|
+
/**
|
|
1111
|
+
* Broadcasts created in the period.
|
|
1112
|
+
*/
|
|
1113
|
+
broadcasts: number;
|
|
1114
|
+
/**
|
|
1115
|
+
* Recipients.
|
|
1116
|
+
*/
|
|
1117
|
+
recipients: number;
|
|
1118
|
+
/**
|
|
1119
|
+
* Recipients the template was sent to.
|
|
1120
|
+
*/
|
|
1121
|
+
sent: number;
|
|
1122
|
+
/**
|
|
1123
|
+
* Recipients the send failed for.
|
|
1124
|
+
*/
|
|
1125
|
+
failed: number;
|
|
1126
|
+
/**
|
|
1127
|
+
* Sent recipients whose template message the provider confirmed delivered or read.
|
|
1128
|
+
*/
|
|
1129
|
+
delivered: number;
|
|
1130
|
+
/**
|
|
1131
|
+
* Sent recipients who read the template message.
|
|
1132
|
+
*/
|
|
1133
|
+
read: number;
|
|
1134
|
+
};
|
|
1135
|
+
/**
|
|
1136
|
+
* The previous period.
|
|
1137
|
+
*/
|
|
1138
|
+
previous: {
|
|
1139
|
+
/**
|
|
1140
|
+
* Broadcasts created in the period.
|
|
1141
|
+
*/
|
|
1142
|
+
broadcasts: number;
|
|
1143
|
+
/**
|
|
1144
|
+
* Recipients.
|
|
1145
|
+
*/
|
|
1146
|
+
recipients: number;
|
|
1147
|
+
};
|
|
1148
|
+
/**
|
|
1149
|
+
* One entry per day of the period, or per hour of a one-day period.
|
|
1150
|
+
*/
|
|
1151
|
+
series: Array<{
|
|
1152
|
+
/**
|
|
1153
|
+
* America/Panama day `YYYY-MM-DD`, or hour `YYYY-MM-DDTHH` when the period is one day.
|
|
1154
|
+
*/
|
|
1155
|
+
slot: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Broadcasts created in the slot.
|
|
1158
|
+
*/
|
|
1159
|
+
broadcasts: number;
|
|
1160
|
+
/**
|
|
1161
|
+
* Their recipients.
|
|
1162
|
+
*/
|
|
1163
|
+
recipients: number;
|
|
1164
|
+
}>;
|
|
1165
|
+
/**
|
|
1166
|
+
* Broadcasts created in the period, newest first.
|
|
1167
|
+
*/
|
|
1168
|
+
broadcasts: Array<{
|
|
1169
|
+
/**
|
|
1170
|
+
* Broadcast ID.
|
|
1171
|
+
*/
|
|
1172
|
+
id: string;
|
|
1173
|
+
/**
|
|
1174
|
+
* Template name.
|
|
1175
|
+
*/
|
|
1176
|
+
template_name: string;
|
|
1177
|
+
/**
|
|
1178
|
+
* Broadcast status.
|
|
1179
|
+
*/
|
|
1180
|
+
status: 'queued' | 'sending' | 'completed';
|
|
1181
|
+
/**
|
|
1182
|
+
* The WhatsApp number it went out from.
|
|
1183
|
+
*/
|
|
1184
|
+
channel_name: string | null;
|
|
1185
|
+
/**
|
|
1186
|
+
* Member who sent it; null when they have no name.
|
|
1187
|
+
*/
|
|
1188
|
+
created_by_name: string | null;
|
|
1189
|
+
/**
|
|
1190
|
+
* When it was created.
|
|
1191
|
+
*/
|
|
1192
|
+
created_at: string;
|
|
1193
|
+
/**
|
|
1194
|
+
* When it finished; null while it runs.
|
|
1195
|
+
*/
|
|
1196
|
+
completed_at: string | null;
|
|
1197
|
+
/**
|
|
1198
|
+
* Recipients not sent yet.
|
|
1199
|
+
*/
|
|
1200
|
+
pending: number;
|
|
1201
|
+
/**
|
|
1202
|
+
* Recipients.
|
|
1203
|
+
*/
|
|
1204
|
+
recipients: number;
|
|
1205
|
+
/**
|
|
1206
|
+
* Recipients the template was sent to.
|
|
1207
|
+
*/
|
|
1208
|
+
sent: number;
|
|
1209
|
+
/**
|
|
1210
|
+
* Recipients the send failed for.
|
|
1211
|
+
*/
|
|
1212
|
+
failed: number;
|
|
1213
|
+
/**
|
|
1214
|
+
* Sent recipients whose template message the provider confirmed delivered or read.
|
|
1215
|
+
*/
|
|
1216
|
+
delivered: number;
|
|
1217
|
+
/**
|
|
1218
|
+
* Sent recipients who read the template message.
|
|
1219
|
+
*/
|
|
1220
|
+
read: number;
|
|
1221
|
+
}>;
|
|
1222
|
+
/**
|
|
1223
|
+
* When Ricky computed the report.
|
|
1224
|
+
*/
|
|
1225
|
+
generated_at: string;
|
|
1226
|
+
};
|
|
1227
|
+
/**
|
|
1228
|
+
* Meta ad spend next to the conversations each ad brought. A conversation comes from an ad when a customer message carries a Meta ad referral (WhatsApp click-to-chat or an Instagram ad); those are America/Panama days. Spend, impressions and clicks are Meta's daily figures for the ad account's own days, so the edges of a period can differ by the time zones' offset.
|
|
1229
|
+
*/
|
|
1230
|
+
export type AdsReport = {
|
|
1231
|
+
period: ReportPeriod;
|
|
1232
|
+
/**
|
|
1233
|
+
* The Meta Ads connection that syncs spend.
|
|
1234
|
+
*/
|
|
1235
|
+
connection: 'connected' | 'disconnected' | 'error';
|
|
1236
|
+
/**
|
|
1237
|
+
* When spend was last synced; null if never.
|
|
1238
|
+
*/
|
|
1239
|
+
synced_at: string | null;
|
|
1240
|
+
/**
|
|
1241
|
+
* ISO 4217 currency of the spend; null when there is none or several.
|
|
1242
|
+
*/
|
|
1243
|
+
currency_code: string | null;
|
|
1244
|
+
/**
|
|
1245
|
+
* The period.
|
|
1246
|
+
*/
|
|
1247
|
+
totals: {
|
|
1248
|
+
/**
|
|
1249
|
+
* Spend of every ad, including ads that brought no conversation.
|
|
1250
|
+
*/
|
|
1251
|
+
spend: number | null;
|
|
1252
|
+
/**
|
|
1253
|
+
* Impressions.
|
|
1254
|
+
*/
|
|
1255
|
+
impressions: number | null;
|
|
1256
|
+
/**
|
|
1257
|
+
* Clicks.
|
|
1258
|
+
*/
|
|
1259
|
+
clicks: number | null;
|
|
1260
|
+
/**
|
|
1261
|
+
* Conversations an ad brought in the period; one brought back by several ads counts once.
|
|
1262
|
+
*/
|
|
1263
|
+
conversations: number;
|
|
1264
|
+
/**
|
|
1265
|
+
* Spend divided by conversations; null without spend, without conversations, or when the spend mixes currencies.
|
|
1266
|
+
*/
|
|
1267
|
+
cost_per_conversation: number | null;
|
|
1268
|
+
};
|
|
1269
|
+
/**
|
|
1270
|
+
* The previous period.
|
|
1271
|
+
*/
|
|
1272
|
+
previous: {
|
|
1273
|
+
/**
|
|
1274
|
+
* Spend.
|
|
1275
|
+
*/
|
|
1276
|
+
spend: number | null;
|
|
1277
|
+
/**
|
|
1278
|
+
* Conversations ads brought.
|
|
1279
|
+
*/
|
|
1280
|
+
conversations: number;
|
|
1281
|
+
};
|
|
1282
|
+
/**
|
|
1283
|
+
* One entry per day of the period, or per hour of a one-day period.
|
|
1284
|
+
*/
|
|
1285
|
+
series: Array<{
|
|
1286
|
+
/**
|
|
1287
|
+
* America/Panama day `YYYY-MM-DD`, or hour `YYYY-MM-DDTHH` when the period is one day.
|
|
1288
|
+
*/
|
|
1289
|
+
slot: string;
|
|
1290
|
+
/**
|
|
1291
|
+
* Spend that day; null for hourly slots and when the spend mixes currencies.
|
|
1292
|
+
*/
|
|
1293
|
+
spend: number | null;
|
|
1294
|
+
/**
|
|
1295
|
+
* Conversations ads brought.
|
|
1296
|
+
*/
|
|
1297
|
+
conversations: number;
|
|
1298
|
+
}>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Ads with spend or conversations in the period.
|
|
1301
|
+
*/
|
|
1302
|
+
ads: Array<{
|
|
1303
|
+
/**
|
|
1304
|
+
* Ad ID at Meta.
|
|
1305
|
+
*/
|
|
1306
|
+
ad_id: string;
|
|
1307
|
+
/**
|
|
1308
|
+
* Name in Meta; null when no spend was synced for it in the period.
|
|
1309
|
+
*/
|
|
1310
|
+
ad_name: string | null;
|
|
1311
|
+
/**
|
|
1312
|
+
* Campaign name in Meta.
|
|
1313
|
+
*/
|
|
1314
|
+
campaign_name: string | null;
|
|
1315
|
+
/**
|
|
1316
|
+
* The ad title the referral carried.
|
|
1317
|
+
*/
|
|
1318
|
+
headline: string | null;
|
|
1319
|
+
/**
|
|
1320
|
+
* Spend.
|
|
1321
|
+
*/
|
|
1322
|
+
spend: number | null;
|
|
1323
|
+
/**
|
|
1324
|
+
* ISO 4217 currency of the spend; null when there is none or several.
|
|
1325
|
+
*/
|
|
1326
|
+
currency_code: string | null;
|
|
1327
|
+
/**
|
|
1328
|
+
* Impressions.
|
|
1329
|
+
*/
|
|
1330
|
+
impressions: number | null;
|
|
1331
|
+
/**
|
|
1332
|
+
* Clicks.
|
|
1333
|
+
*/
|
|
1334
|
+
clicks: number | null;
|
|
1335
|
+
/**
|
|
1336
|
+
* Distinct conversations this ad opened or brought back in the period.
|
|
1337
|
+
*/
|
|
1338
|
+
conversations: number;
|
|
1339
|
+
/**
|
|
1340
|
+
* Spend divided by conversations; null without spend, without conversations, or when the spend mixes currencies.
|
|
1341
|
+
*/
|
|
1342
|
+
cost_per_conversation: number | null;
|
|
1343
|
+
}>;
|
|
1344
|
+
/**
|
|
1345
|
+
* When Ricky computed the report.
|
|
1346
|
+
*/
|
|
1347
|
+
generated_at: string;
|
|
1348
|
+
};
|
|
1349
|
+
/**
|
|
1350
|
+
* How fast people and AI agents answer customers. A response is the first message sent to the customer, other than a reaction, right after a customer message that is not a reaction; its response time is the wait since that customer message. Later messages in a row are follow-ups, and automations and templates are not responses. Responses are dated when they were sent. Conversation openings, closes and assignments play no part.
|
|
1351
|
+
*/
|
|
1352
|
+
export type ResponsesReport = {
|
|
1353
|
+
period: ReportPeriod;
|
|
1354
|
+
/**
|
|
1355
|
+
* The channel filter the report applied.
|
|
1356
|
+
*/
|
|
1357
|
+
channel: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
1358
|
+
/**
|
|
1359
|
+
* The responder filter the report applied: `all`, `humans`, `agents` or an ID.
|
|
1360
|
+
*/
|
|
1361
|
+
responder: string;
|
|
1362
|
+
/**
|
|
1363
|
+
* Open conversations whose last message, reactions aside, is from the customer, right now. Narrowed by `channel` only.
|
|
1364
|
+
*/
|
|
1365
|
+
awaiting_reply_now: number;
|
|
1366
|
+
/**
|
|
1367
|
+
* How long customers waited for each response.
|
|
1368
|
+
*/
|
|
1369
|
+
response_time: {
|
|
1370
|
+
/**
|
|
1371
|
+
* Responses in the period: the sample.
|
|
1372
|
+
*/
|
|
1373
|
+
responses: number;
|
|
1374
|
+
/**
|
|
1375
|
+
* Average response time, in seconds.
|
|
1376
|
+
*/
|
|
1377
|
+
average_seconds: number | null;
|
|
1378
|
+
/**
|
|
1379
|
+
* Median response time, in seconds.
|
|
1380
|
+
*/
|
|
1381
|
+
median_seconds: number | null;
|
|
1382
|
+
/**
|
|
1383
|
+
* Nine in ten responses were faster than this, in seconds.
|
|
1384
|
+
*/
|
|
1385
|
+
p90_seconds: number | null;
|
|
1386
|
+
/**
|
|
1387
|
+
* Average response time of the previous period, in seconds.
|
|
1388
|
+
*/
|
|
1389
|
+
previous_average_seconds: number | null;
|
|
1390
|
+
/**
|
|
1391
|
+
* Responses of the period by how long they took.
|
|
1392
|
+
*/
|
|
1393
|
+
buckets: Array<{
|
|
1394
|
+
bucket: 'under_30s' | '30s_2m' | '2m_5m' | '5m_10m' | '10m_30m' | '30m_1h' | 'over_1h';
|
|
1395
|
+
/**
|
|
1396
|
+
* Items in the bucket.
|
|
1397
|
+
*/
|
|
1398
|
+
count: number;
|
|
1399
|
+
/**
|
|
1400
|
+
* Share of the sample, 0–1.
|
|
1401
|
+
*/
|
|
1402
|
+
share: number;
|
|
1403
|
+
}>;
|
|
1404
|
+
/**
|
|
1405
|
+
* One entry per day of the period, or per hour of a one-day period.
|
|
1406
|
+
*/
|
|
1407
|
+
series: Array<{
|
|
1408
|
+
/**
|
|
1409
|
+
* America/Panama day `YYYY-MM-DD`, or hour `YYYY-MM-DDTHH` when the period is one day.
|
|
1410
|
+
*/
|
|
1411
|
+
slot: string;
|
|
1412
|
+
/**
|
|
1413
|
+
* Average response time, in seconds.
|
|
1414
|
+
*/
|
|
1415
|
+
average_seconds: number | null;
|
|
1416
|
+
/**
|
|
1417
|
+
* Median response time, in seconds.
|
|
1418
|
+
*/
|
|
1419
|
+
median_seconds: number | null;
|
|
1420
|
+
/**
|
|
1421
|
+
* Average of the same slot of the previous period, in seconds.
|
|
1422
|
+
*/
|
|
1423
|
+
previous_average_seconds: number | null;
|
|
1424
|
+
/**
|
|
1425
|
+
* Median of the same slot of the previous period, in seconds.
|
|
1426
|
+
*/
|
|
1427
|
+
previous_median_seconds: number | null;
|
|
1428
|
+
}>;
|
|
1429
|
+
};
|
|
1430
|
+
/**
|
|
1431
|
+
* How many responses each answered conversation got.
|
|
1432
|
+
*/
|
|
1433
|
+
responses_per_conversation: {
|
|
1434
|
+
/**
|
|
1435
|
+
* Conversations that got at least one response in the period: the sample.
|
|
1436
|
+
*/
|
|
1437
|
+
conversations: number;
|
|
1438
|
+
/**
|
|
1439
|
+
* Responses in the period divided by the conversations they went to.
|
|
1440
|
+
*/
|
|
1441
|
+
average: number | null;
|
|
1442
|
+
/**
|
|
1443
|
+
* The same for the previous period.
|
|
1444
|
+
*/
|
|
1445
|
+
previous_average: number | null;
|
|
1446
|
+
/**
|
|
1447
|
+
* Conversations by how many responses they got.
|
|
1448
|
+
*/
|
|
1449
|
+
buckets: Array<{
|
|
1450
|
+
bucket: '1_2' | '3_10' | '11_20' | 'over_20';
|
|
1451
|
+
/**
|
|
1452
|
+
* Items in the bucket.
|
|
1453
|
+
*/
|
|
1454
|
+
count: number;
|
|
1455
|
+
/**
|
|
1456
|
+
* Share of the sample, 0–1.
|
|
1457
|
+
*/
|
|
1458
|
+
share: number;
|
|
1459
|
+
}>;
|
|
1460
|
+
/**
|
|
1461
|
+
* One entry per day of the period, or per hour of a one-day period.
|
|
1462
|
+
*/
|
|
1463
|
+
series: Array<{
|
|
1464
|
+
/**
|
|
1465
|
+
* America/Panama day `YYYY-MM-DD`, or hour `YYYY-MM-DDTHH` when the period is one day.
|
|
1466
|
+
*/
|
|
1467
|
+
slot: string;
|
|
1468
|
+
/**
|
|
1469
|
+
* Responses per conversation in the slot.
|
|
1470
|
+
*/
|
|
1471
|
+
average: number | null;
|
|
1472
|
+
/**
|
|
1473
|
+
* The same slot of the previous period.
|
|
1474
|
+
*/
|
|
1475
|
+
previous_average: number | null;
|
|
1476
|
+
}>;
|
|
1477
|
+
};
|
|
1478
|
+
/**
|
|
1479
|
+
* The period per channel, most responses first.
|
|
1480
|
+
*/
|
|
1481
|
+
by_channel: Array<{
|
|
1482
|
+
/**
|
|
1483
|
+
* Channel.
|
|
1484
|
+
*/
|
|
1485
|
+
channel: 'whatsapp' | 'instagram' | 'messenger';
|
|
1486
|
+
/**
|
|
1487
|
+
* Responses in the period.
|
|
1488
|
+
*/
|
|
1489
|
+
responses: number;
|
|
1490
|
+
/**
|
|
1491
|
+
* Conversations those responses went to.
|
|
1492
|
+
*/
|
|
1493
|
+
conversations: number;
|
|
1494
|
+
/**
|
|
1495
|
+
* Average response time, in seconds.
|
|
1496
|
+
*/
|
|
1497
|
+
average_seconds: number | null;
|
|
1498
|
+
/**
|
|
1499
|
+
* Median response time, in seconds.
|
|
1500
|
+
*/
|
|
1501
|
+
median_seconds: number | null;
|
|
1502
|
+
/**
|
|
1503
|
+
* Nine in ten responses were faster than this, in seconds.
|
|
1504
|
+
*/
|
|
1505
|
+
p90_seconds: number | null;
|
|
1506
|
+
}>;
|
|
1507
|
+
/**
|
|
1508
|
+
* The period per responder, most responses first.
|
|
1509
|
+
*/
|
|
1510
|
+
by_responder: Array<{
|
|
1511
|
+
/**
|
|
1512
|
+
* `human` is a person in Ricky, `ai` an AI agent, `external` someone answering from the channel's own app.
|
|
1513
|
+
*/
|
|
1514
|
+
type: 'human' | 'ai' | 'external';
|
|
1515
|
+
/**
|
|
1516
|
+
* User ID or AI agent ID; null for `external`.
|
|
1517
|
+
*/
|
|
1518
|
+
id: string | null;
|
|
1519
|
+
/**
|
|
1520
|
+
* Name; null when it has none and for `external`.
|
|
1521
|
+
*/
|
|
1522
|
+
name: string | null;
|
|
1523
|
+
/**
|
|
1524
|
+
* The app an `external` responder used; null otherwise.
|
|
1525
|
+
*/
|
|
1526
|
+
channel: 'whatsapp' | 'instagram' | 'messenger' | null;
|
|
1527
|
+
/**
|
|
1528
|
+
* Responses in the period.
|
|
1529
|
+
*/
|
|
1530
|
+
responses: number;
|
|
1531
|
+
/**
|
|
1532
|
+
* Conversations those responses went to.
|
|
1533
|
+
*/
|
|
1534
|
+
conversations: number;
|
|
1535
|
+
/**
|
|
1536
|
+
* Average response time, in seconds.
|
|
1537
|
+
*/
|
|
1538
|
+
average_seconds: number | null;
|
|
1539
|
+
/**
|
|
1540
|
+
* Median response time, in seconds.
|
|
1541
|
+
*/
|
|
1542
|
+
median_seconds: number | null;
|
|
1543
|
+
/**
|
|
1544
|
+
* Nine in ten responses were faster than this, in seconds.
|
|
1545
|
+
*/
|
|
1546
|
+
p90_seconds: number | null;
|
|
1547
|
+
}>;
|
|
1548
|
+
/**
|
|
1549
|
+
* When Ricky computed the report.
|
|
1550
|
+
*/
|
|
1551
|
+
generated_at: string;
|
|
1552
|
+
};
|
|
1553
|
+
/**
|
|
1554
|
+
* How long conversations stay open before someone closes them. Every close in the period counts, dated when it happened; resolution time runs from the opening of that span to the close. Conversations without a single message are left out.
|
|
1555
|
+
*/
|
|
1556
|
+
export type ResolutionsReport = {
|
|
1557
|
+
period: ReportPeriod;
|
|
1558
|
+
/**
|
|
1559
|
+
* The channel filter the report applied.
|
|
1560
|
+
*/
|
|
1561
|
+
channel: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
1562
|
+
/**
|
|
1563
|
+
* The period.
|
|
1564
|
+
*/
|
|
1565
|
+
summary: {
|
|
1566
|
+
/**
|
|
1567
|
+
* Conversations closed in the period; a conversation closed twice counts twice.
|
|
1568
|
+
*/
|
|
1569
|
+
closed: number;
|
|
1570
|
+
/**
|
|
1571
|
+
* Average time from opening to close, in seconds.
|
|
1572
|
+
*/
|
|
1573
|
+
average_resolution_seconds: number | null;
|
|
1574
|
+
/**
|
|
1575
|
+
* Median time from opening to close, in seconds.
|
|
1576
|
+
*/
|
|
1577
|
+
median_resolution_seconds: number | null;
|
|
1578
|
+
/**
|
|
1579
|
+
* Average time from opening to the first assignment before the close, in seconds; closes without an assignment are left out.
|
|
1580
|
+
*/
|
|
1581
|
+
average_time_to_first_assignment_seconds: number | null;
|
|
1582
|
+
/**
|
|
1583
|
+
* Average number of assignments between opening and close.
|
|
1584
|
+
*/
|
|
1585
|
+
average_assignments_to_close: number | null;
|
|
1586
|
+
};
|
|
1587
|
+
/**
|
|
1588
|
+
* The previous period.
|
|
1589
|
+
*/
|
|
1590
|
+
previous: {
|
|
1591
|
+
/**
|
|
1592
|
+
* Conversations closed in the period; a conversation closed twice counts twice.
|
|
1593
|
+
*/
|
|
1594
|
+
closed: number;
|
|
1595
|
+
/**
|
|
1596
|
+
* Average time from opening to close, in seconds.
|
|
1597
|
+
*/
|
|
1598
|
+
average_resolution_seconds: number | null;
|
|
1599
|
+
/**
|
|
1600
|
+
* Median time from opening to close, in seconds.
|
|
1601
|
+
*/
|
|
1602
|
+
median_resolution_seconds: number | null;
|
|
1603
|
+
/**
|
|
1604
|
+
* Average time from opening to the first assignment before the close, in seconds; closes without an assignment are left out.
|
|
1605
|
+
*/
|
|
1606
|
+
average_time_to_first_assignment_seconds: number | null;
|
|
1607
|
+
/**
|
|
1608
|
+
* Average number of assignments between opening and close.
|
|
1609
|
+
*/
|
|
1610
|
+
average_assignments_to_close: number | null;
|
|
1611
|
+
};
|
|
1612
|
+
/**
|
|
1613
|
+
* One entry per day of the period, or per hour of a one-day period.
|
|
1614
|
+
*/
|
|
1615
|
+
series: Array<{
|
|
1616
|
+
/**
|
|
1617
|
+
* America/Panama day `YYYY-MM-DD`, or hour `YYYY-MM-DDTHH` when the period is one day.
|
|
1618
|
+
*/
|
|
1619
|
+
slot: string;
|
|
1620
|
+
/**
|
|
1621
|
+
* Closes in the slot.
|
|
1622
|
+
*/
|
|
1623
|
+
closed: number;
|
|
1624
|
+
/**
|
|
1625
|
+
* Median time from opening to close, in seconds.
|
|
1626
|
+
*/
|
|
1627
|
+
median_resolution_seconds: number | null;
|
|
1628
|
+
}>;
|
|
1629
|
+
/**
|
|
1630
|
+
* The period per channel, most closes first.
|
|
1631
|
+
*/
|
|
1632
|
+
by_channel: Array<{
|
|
1633
|
+
/**
|
|
1634
|
+
* Channel.
|
|
1635
|
+
*/
|
|
1636
|
+
channel: 'whatsapp' | 'instagram' | 'messenger';
|
|
1637
|
+
/**
|
|
1638
|
+
* Closes in the period.
|
|
1639
|
+
*/
|
|
1640
|
+
closed: number;
|
|
1641
|
+
/**
|
|
1642
|
+
* Median time from opening to close, in seconds.
|
|
1643
|
+
*/
|
|
1644
|
+
median_resolution_seconds: number | null;
|
|
1645
|
+
}>;
|
|
1646
|
+
/**
|
|
1647
|
+
* The period by who held the conversation when it closed, most closes first.
|
|
1648
|
+
*/
|
|
1649
|
+
by_assignee: Array<{
|
|
1650
|
+
/**
|
|
1651
|
+
* Who held the conversation when it closed.
|
|
1652
|
+
*/
|
|
1653
|
+
type: 'human' | 'ai' | 'unassigned';
|
|
1654
|
+
/**
|
|
1655
|
+
* Name; null when it has none and for `unassigned`. Equal names are one row.
|
|
1656
|
+
*/
|
|
1657
|
+
name: string | null;
|
|
1658
|
+
/**
|
|
1659
|
+
* Closes in the period.
|
|
1660
|
+
*/
|
|
1661
|
+
closed: number;
|
|
1662
|
+
/**
|
|
1663
|
+
* Median time from opening to close, in seconds.
|
|
1664
|
+
*/
|
|
1665
|
+
median_resolution_seconds: number | null;
|
|
1666
|
+
}>;
|
|
1667
|
+
/**
|
|
1668
|
+
* Closes of the period by how long the conversation was open.
|
|
1669
|
+
*/
|
|
1670
|
+
distribution: Array<{
|
|
1671
|
+
bucket: 'under_1h' | '1h_4h' | '4h_24h' | '1d_3d' | 'over_3d';
|
|
1672
|
+
/**
|
|
1673
|
+
* Closes in the period that took that long.
|
|
1674
|
+
*/
|
|
1675
|
+
closed: number;
|
|
1676
|
+
}>;
|
|
1677
|
+
/**
|
|
1678
|
+
* When Ricky computed the report.
|
|
1679
|
+
*/
|
|
1680
|
+
generated_at: string;
|
|
1681
|
+
};
|
|
1682
|
+
/**
|
|
1683
|
+
* An automation Ricky runs for the organization.
|
|
1684
|
+
*/
|
|
1685
|
+
export type Workflow = {
|
|
1686
|
+
/**
|
|
1687
|
+
* Workflow ID.
|
|
1688
|
+
*/
|
|
1689
|
+
id: string;
|
|
1690
|
+
/**
|
|
1691
|
+
* Display name.
|
|
1692
|
+
*/
|
|
1693
|
+
name: string;
|
|
1694
|
+
/**
|
|
1695
|
+
* `draft` until activated; `paused` runs nothing new; `active` runs.
|
|
1696
|
+
*/
|
|
1697
|
+
status: 'draft' | 'active' | 'paused';
|
|
1698
|
+
/**
|
|
1699
|
+
* Which `definition` it has: a conversation flow or a daily template.
|
|
1700
|
+
*/
|
|
1701
|
+
type: 'conversation' | 'scheduled';
|
|
1702
|
+
definition: {
|
|
1703
|
+
/**
|
|
1704
|
+
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives.
|
|
1705
|
+
*/
|
|
1706
|
+
trigger: 'conversation_opened' | 'first_message_received';
|
|
1707
|
+
/**
|
|
1708
|
+
* Channels it listens to. See `GET /channels`.
|
|
1709
|
+
*/
|
|
1710
|
+
channel_ids: Array<string>;
|
|
1711
|
+
/**
|
|
1712
|
+
* When it runs; null runs at any hour.
|
|
1713
|
+
*/
|
|
1714
|
+
condition: {
|
|
1715
|
+
kind: 'inside_business_hours';
|
|
1716
|
+
business_hours: {
|
|
1717
|
+
/**
|
|
1718
|
+
* Opening time, `HH:MM`.
|
|
1719
|
+
*/
|
|
1720
|
+
start: string;
|
|
1721
|
+
/**
|
|
1722
|
+
* Closing time, `HH:MM`.
|
|
1723
|
+
*/
|
|
1724
|
+
end: string;
|
|
1725
|
+
/**
|
|
1726
|
+
* IANA time zone, for example `America/Panama`.
|
|
1727
|
+
*/
|
|
1728
|
+
timezone: string;
|
|
1729
|
+
/**
|
|
1730
|
+
* Open days, 0 for Sunday to 6 for Saturday.
|
|
1731
|
+
*/
|
|
1732
|
+
weekdays: Array<number>;
|
|
1733
|
+
};
|
|
1734
|
+
} | {
|
|
1735
|
+
kind: 'outside_business_hours';
|
|
1736
|
+
business_hours: {
|
|
1737
|
+
/**
|
|
1738
|
+
* Opening time, `HH:MM`.
|
|
1739
|
+
*/
|
|
1740
|
+
start: string;
|
|
1741
|
+
/**
|
|
1742
|
+
* Closing time, `HH:MM`.
|
|
1743
|
+
*/
|
|
1744
|
+
end: string;
|
|
1745
|
+
/**
|
|
1746
|
+
* IANA time zone, for example `America/Panama`.
|
|
1747
|
+
*/
|
|
1748
|
+
timezone: string;
|
|
1749
|
+
/**
|
|
1750
|
+
* Open days, 0 for Sunday to 6 for Saturday.
|
|
1751
|
+
*/
|
|
1752
|
+
weekdays: Array<number>;
|
|
1753
|
+
};
|
|
1754
|
+
} | null;
|
|
1755
|
+
/**
|
|
1756
|
+
* The steps and how they connect.
|
|
1757
|
+
*/
|
|
1758
|
+
flow: {
|
|
1759
|
+
/**
|
|
1760
|
+
* ID of the first step.
|
|
1761
|
+
*/
|
|
1762
|
+
entry: string;
|
|
1763
|
+
/**
|
|
1764
|
+
* One step. `assign_user`, `assign_agent` and `close_conversation` end the flow after they run.
|
|
1765
|
+
*/
|
|
1766
|
+
steps: Array<{
|
|
1767
|
+
/**
|
|
1768
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1769
|
+
*/
|
|
1770
|
+
id: string;
|
|
1771
|
+
/**
|
|
1772
|
+
* Step to run next; null ends the flow.
|
|
1773
|
+
*/
|
|
1774
|
+
next: string | null;
|
|
1775
|
+
kind: 'send_message';
|
|
1776
|
+
/**
|
|
1777
|
+
* Text sent to the contact.
|
|
1778
|
+
*/
|
|
1779
|
+
text: string;
|
|
1780
|
+
} | {
|
|
1781
|
+
/**
|
|
1782
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1783
|
+
*/
|
|
1784
|
+
id: string;
|
|
1785
|
+
/**
|
|
1786
|
+
* Step to run next; null ends the flow.
|
|
1787
|
+
*/
|
|
1788
|
+
next: string | null;
|
|
1789
|
+
kind: 'ask_question';
|
|
1790
|
+
/**
|
|
1791
|
+
* Text sent to the contact.
|
|
1792
|
+
*/
|
|
1793
|
+
text: string;
|
|
1794
|
+
/**
|
|
1795
|
+
* Name the answer is kept under, for a later `branch`.
|
|
1796
|
+
*/
|
|
1797
|
+
answer_key: string;
|
|
1798
|
+
/**
|
|
1799
|
+
* Buttons or list options, WhatsApp only. Empty for a free-text answer, which goes to `next`.
|
|
1800
|
+
*/
|
|
1801
|
+
choices: Array<{
|
|
1802
|
+
/**
|
|
1803
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1804
|
+
*/
|
|
1805
|
+
id: string;
|
|
1806
|
+
/**
|
|
1807
|
+
* Button text, up to 20 characters.
|
|
1808
|
+
*/
|
|
1809
|
+
label: string;
|
|
1810
|
+
/**
|
|
1811
|
+
* Step to run when the contact picks it.
|
|
1812
|
+
*/
|
|
1813
|
+
next: string | null;
|
|
1814
|
+
}>;
|
|
1815
|
+
/**
|
|
1816
|
+
* How long to wait for the answer, up to 7 days.
|
|
1817
|
+
*/
|
|
1818
|
+
timeout_seconds: number;
|
|
1819
|
+
/**
|
|
1820
|
+
* Step to run when no answer arrives in time.
|
|
1821
|
+
*/
|
|
1822
|
+
on_timeout: string | null;
|
|
1823
|
+
/**
|
|
1824
|
+
* Step to run when the answer matches no option.
|
|
1825
|
+
*/
|
|
1826
|
+
on_invalid: string | null;
|
|
1827
|
+
} | {
|
|
1828
|
+
/**
|
|
1829
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1830
|
+
*/
|
|
1831
|
+
id: string;
|
|
1832
|
+
/**
|
|
1833
|
+
* Step to run next; null ends the flow.
|
|
1834
|
+
*/
|
|
1835
|
+
next: string | null;
|
|
1836
|
+
kind: 'branch';
|
|
1837
|
+
/**
|
|
1838
|
+
* Name the answer is kept under, for a later `branch`.
|
|
1839
|
+
*/
|
|
1840
|
+
answer_key: string;
|
|
1841
|
+
operator: 'equals' | 'contains' | 'exists';
|
|
1842
|
+
/**
|
|
1843
|
+
* Value compared with the answer.
|
|
1844
|
+
*/
|
|
1845
|
+
value: string;
|
|
1846
|
+
/**
|
|
1847
|
+
* Step to run when the condition does not hold; `next` when it does.
|
|
1848
|
+
*/
|
|
1849
|
+
otherwise: string | null;
|
|
1850
|
+
} | {
|
|
1851
|
+
/**
|
|
1852
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1853
|
+
*/
|
|
1854
|
+
id: string;
|
|
1855
|
+
/**
|
|
1856
|
+
* Step to run next; null ends the flow.
|
|
1857
|
+
*/
|
|
1858
|
+
next: string | null;
|
|
1859
|
+
kind: 'wait';
|
|
1860
|
+
/**
|
|
1861
|
+
* Delay, up to 7 days.
|
|
1862
|
+
*/
|
|
1863
|
+
seconds: number;
|
|
1864
|
+
} | {
|
|
1865
|
+
/**
|
|
1866
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1867
|
+
*/
|
|
1868
|
+
id: string;
|
|
1869
|
+
/**
|
|
1870
|
+
* Step to run next; null ends the flow.
|
|
1871
|
+
*/
|
|
1872
|
+
next: string | null;
|
|
1873
|
+
kind: 'assign_user';
|
|
1874
|
+
/**
|
|
1875
|
+
* Member who takes the conversation. See `GET /members`.
|
|
1876
|
+
*/
|
|
1877
|
+
user_id: string;
|
|
1878
|
+
} | {
|
|
1879
|
+
/**
|
|
1880
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1881
|
+
*/
|
|
1882
|
+
id: string;
|
|
1883
|
+
/**
|
|
1884
|
+
* Step to run next; null ends the flow.
|
|
1885
|
+
*/
|
|
1886
|
+
next: string | null;
|
|
1887
|
+
kind: 'assign_agent';
|
|
1888
|
+
/**
|
|
1889
|
+
* AI agent that answers the conversation.
|
|
1890
|
+
*/
|
|
1891
|
+
agent_id: string;
|
|
1892
|
+
} | {
|
|
1893
|
+
/**
|
|
1894
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1895
|
+
*/
|
|
1896
|
+
id: string;
|
|
1897
|
+
/**
|
|
1898
|
+
* Step to run next; null ends the flow.
|
|
1899
|
+
*/
|
|
1900
|
+
next: string | null;
|
|
1901
|
+
kind: 'close_conversation';
|
|
1902
|
+
} | {
|
|
1903
|
+
/**
|
|
1904
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
1905
|
+
*/
|
|
1906
|
+
id: string;
|
|
1907
|
+
/**
|
|
1908
|
+
* Step to run next; null ends the flow.
|
|
1909
|
+
*/
|
|
1910
|
+
next: string | null;
|
|
1911
|
+
kind: 'end';
|
|
1912
|
+
}>;
|
|
1913
|
+
};
|
|
1914
|
+
} | {
|
|
1915
|
+
trigger: {
|
|
1916
|
+
kind: 'daily';
|
|
1917
|
+
/**
|
|
1918
|
+
* Time of day it runs, `HH:MM`.
|
|
1919
|
+
*/
|
|
1920
|
+
time: string;
|
|
1921
|
+
/**
|
|
1922
|
+
* IANA time zone of `time`.
|
|
1923
|
+
*/
|
|
1924
|
+
timezone: string;
|
|
1925
|
+
};
|
|
1926
|
+
/**
|
|
1927
|
+
* Who it messages: Odoo appointments or Odoo birthdays.
|
|
1928
|
+
*/
|
|
1929
|
+
source: {
|
|
1930
|
+
kind: 'odoo_appointments';
|
|
1931
|
+
/**
|
|
1932
|
+
* Days before the appointment it reminds.
|
|
1933
|
+
*/
|
|
1934
|
+
days_ahead: number;
|
|
1935
|
+
/**
|
|
1936
|
+
* Odoo appointment states it reminds; null for every state.
|
|
1937
|
+
*/
|
|
1938
|
+
appointment_states: Array<string> | null;
|
|
1939
|
+
} | {
|
|
1940
|
+
kind: 'odoo_birthdays';
|
|
1941
|
+
};
|
|
1942
|
+
template: {
|
|
1943
|
+
/**
|
|
1944
|
+
* WhatsApp channel it sends from.
|
|
1945
|
+
*/
|
|
1946
|
+
channel_id: string;
|
|
1947
|
+
/**
|
|
1948
|
+
* Template ID at Meta.
|
|
1949
|
+
*/
|
|
1950
|
+
template_id: string;
|
|
1951
|
+
/**
|
|
1952
|
+
* Template name.
|
|
1953
|
+
*/
|
|
1954
|
+
template_name: string;
|
|
1955
|
+
/**
|
|
1956
|
+
* Template language code.
|
|
1957
|
+
*/
|
|
1958
|
+
language: string;
|
|
1959
|
+
/**
|
|
1960
|
+
* Value each template variable takes.
|
|
1961
|
+
*/
|
|
1962
|
+
parameters: {
|
|
1963
|
+
[key: string]: 'appointment_start' | 'branch_name' | 'customer_first_name';
|
|
1964
|
+
};
|
|
1965
|
+
/**
|
|
1966
|
+
* Whether an image is stored for the header.
|
|
1967
|
+
*/
|
|
1968
|
+
has_header_image: boolean;
|
|
1969
|
+
};
|
|
1970
|
+
};
|
|
1971
|
+
/**
|
|
1972
|
+
* Last change to the workflow.
|
|
1973
|
+
*/
|
|
1974
|
+
updated_at: string;
|
|
1975
|
+
};
|
|
1976
|
+
/**
|
|
1977
|
+
* One queued run of a workflow, or one template send of a scheduled workflow. Its status does not confirm each message's delivery.
|
|
1978
|
+
*/
|
|
1979
|
+
export type WorkflowExecution = {
|
|
1980
|
+
/**
|
|
1981
|
+
* Execution ID.
|
|
1982
|
+
*/
|
|
1983
|
+
id: string;
|
|
1984
|
+
/**
|
|
1985
|
+
* `pending` or `processing` while queued or retrying; `processed` when it ran; `failed` for good; `superseded` when a newer execution replaced it.
|
|
1986
|
+
*/
|
|
1987
|
+
status: 'pending' | 'processing' | 'processed' | 'failed' | 'superseded';
|
|
1988
|
+
/**
|
|
1989
|
+
* Attempts so far.
|
|
1990
|
+
*/
|
|
1991
|
+
attempts: number;
|
|
1992
|
+
/**
|
|
1993
|
+
* Error of the latest failed attempt.
|
|
1994
|
+
*/
|
|
1995
|
+
last_error: string | null;
|
|
1996
|
+
/**
|
|
1997
|
+
* When it was queued.
|
|
1998
|
+
*/
|
|
1999
|
+
created_at: string;
|
|
2000
|
+
/**
|
|
2001
|
+
* When it finished, failed or was superseded.
|
|
2002
|
+
*/
|
|
2003
|
+
processed_at: string | null;
|
|
2004
|
+
};
|
|
2005
|
+
/**
|
|
2006
|
+
* A contact needs at least a name, a phone or an email.
|
|
2007
|
+
*/
|
|
2008
|
+
export type CreateContact = {
|
|
2009
|
+
/**
|
|
2010
|
+
* First name.
|
|
2011
|
+
*/
|
|
2012
|
+
first_name?: string | null;
|
|
2013
|
+
/**
|
|
2014
|
+
* Last name.
|
|
2015
|
+
*/
|
|
2016
|
+
last_name?: string | null;
|
|
2017
|
+
/**
|
|
2018
|
+
* Email.
|
|
2019
|
+
*/
|
|
2020
|
+
primary_email?: string | null;
|
|
2021
|
+
/**
|
|
2022
|
+
* Phone with country code, for example `+507 6000-1234`.
|
|
2023
|
+
*/
|
|
2024
|
+
primary_phone?: string | null;
|
|
2025
|
+
/**
|
|
2026
|
+
* Company.
|
|
2027
|
+
*/
|
|
2028
|
+
company?: string | null;
|
|
2029
|
+
/**
|
|
2030
|
+
* Job title.
|
|
2031
|
+
*/
|
|
2032
|
+
job_title?: string | null;
|
|
2033
|
+
/**
|
|
2034
|
+
* Birthday as `YYYY-MM-DD`.
|
|
2035
|
+
*/
|
|
2036
|
+
birthday?: string | null;
|
|
2037
|
+
/**
|
|
2038
|
+
* City.
|
|
2039
|
+
*/
|
|
2040
|
+
city?: string | null;
|
|
2041
|
+
/**
|
|
2042
|
+
* State, province or region.
|
|
2043
|
+
*/
|
|
2044
|
+
region?: string | null;
|
|
2045
|
+
/**
|
|
2046
|
+
* Country.
|
|
2047
|
+
*/
|
|
2048
|
+
country?: string | null;
|
|
2049
|
+
/**
|
|
2050
|
+
* Street address.
|
|
2051
|
+
*/
|
|
2052
|
+
street_address?: string | null;
|
|
2053
|
+
/**
|
|
2054
|
+
* Postal code.
|
|
2055
|
+
*/
|
|
2056
|
+
postal_code?: string | null;
|
|
2057
|
+
/**
|
|
2058
|
+
* Website URL.
|
|
2059
|
+
*/
|
|
2060
|
+
website_url?: string | null;
|
|
2061
|
+
/**
|
|
2062
|
+
* LinkedIn profile URL.
|
|
2063
|
+
*/
|
|
2064
|
+
linkedin_url?: string | null;
|
|
2065
|
+
/**
|
|
2066
|
+
* Where the contact came from.
|
|
2067
|
+
*/
|
|
2068
|
+
source?: string | null;
|
|
2069
|
+
/**
|
|
2070
|
+
* Free-form notes.
|
|
2071
|
+
*/
|
|
2072
|
+
notes?: string | null;
|
|
2073
|
+
/**
|
|
2074
|
+
* Member who owns the contact.
|
|
2075
|
+
*/
|
|
2076
|
+
owner_user_id?: string | null;
|
|
2077
|
+
lead_status?: 'new' | 'open' | 'in_progress' | 'attempted' | 'connected' | 'unqualified' | 'bad_timing' | null;
|
|
2078
|
+
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other' | null;
|
|
2079
|
+
/**
|
|
2080
|
+
* Values keyed by contact field ID. Keys you omit keep their value.
|
|
2081
|
+
*/
|
|
2082
|
+
custom_values?: {
|
|
2083
|
+
[key: string]: string | number | boolean | Array<string> | null;
|
|
2084
|
+
};
|
|
2085
|
+
/**
|
|
2086
|
+
* The complete set of tag IDs. Replaces the current tags.
|
|
2087
|
+
*/
|
|
2088
|
+
tag_ids?: Array<string>;
|
|
2089
|
+
};
|
|
2090
|
+
/**
|
|
2091
|
+
* Only the fields you send change. Send `null` to clear one.
|
|
2092
|
+
*/
|
|
2093
|
+
export type UpdateContact = {
|
|
2094
|
+
/**
|
|
2095
|
+
* First name.
|
|
2096
|
+
*/
|
|
2097
|
+
first_name?: string | null;
|
|
2098
|
+
/**
|
|
2099
|
+
* Last name.
|
|
2100
|
+
*/
|
|
2101
|
+
last_name?: string | null;
|
|
2102
|
+
/**
|
|
2103
|
+
* Email.
|
|
2104
|
+
*/
|
|
2105
|
+
primary_email?: string | null;
|
|
2106
|
+
/**
|
|
2107
|
+
* Phone with country code, for example `+507 6000-1234`.
|
|
2108
|
+
*/
|
|
2109
|
+
primary_phone?: string | null;
|
|
2110
|
+
/**
|
|
2111
|
+
* Company.
|
|
2112
|
+
*/
|
|
2113
|
+
company?: string | null;
|
|
2114
|
+
/**
|
|
2115
|
+
* Job title.
|
|
2116
|
+
*/
|
|
2117
|
+
job_title?: string | null;
|
|
2118
|
+
/**
|
|
2119
|
+
* Birthday as `YYYY-MM-DD`.
|
|
2120
|
+
*/
|
|
2121
|
+
birthday?: string | null;
|
|
2122
|
+
/**
|
|
2123
|
+
* City.
|
|
2124
|
+
*/
|
|
2125
|
+
city?: string | null;
|
|
2126
|
+
/**
|
|
2127
|
+
* State, province or region.
|
|
2128
|
+
*/
|
|
2129
|
+
region?: string | null;
|
|
2130
|
+
/**
|
|
2131
|
+
* Country.
|
|
2132
|
+
*/
|
|
2133
|
+
country?: string | null;
|
|
2134
|
+
/**
|
|
2135
|
+
* Street address.
|
|
2136
|
+
*/
|
|
2137
|
+
street_address?: string | null;
|
|
2138
|
+
/**
|
|
2139
|
+
* Postal code.
|
|
2140
|
+
*/
|
|
2141
|
+
postal_code?: string | null;
|
|
2142
|
+
/**
|
|
2143
|
+
* Website URL.
|
|
2144
|
+
*/
|
|
2145
|
+
website_url?: string | null;
|
|
2146
|
+
/**
|
|
2147
|
+
* LinkedIn profile URL.
|
|
2148
|
+
*/
|
|
2149
|
+
linkedin_url?: string | null;
|
|
2150
|
+
/**
|
|
2151
|
+
* Where the contact came from.
|
|
2152
|
+
*/
|
|
2153
|
+
source?: string | null;
|
|
2154
|
+
/**
|
|
2155
|
+
* Free-form notes.
|
|
2156
|
+
*/
|
|
2157
|
+
notes?: string | null;
|
|
2158
|
+
/**
|
|
2159
|
+
* Member who owns the contact.
|
|
2160
|
+
*/
|
|
2161
|
+
owner_user_id?: string | null;
|
|
2162
|
+
lead_status?: 'new' | 'open' | 'in_progress' | 'attempted' | 'connected' | 'unqualified' | 'bad_timing' | null;
|
|
2163
|
+
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other' | null;
|
|
2164
|
+
/**
|
|
2165
|
+
* Values keyed by contact field ID. Keys you omit keep their value.
|
|
2166
|
+
*/
|
|
2167
|
+
custom_values?: {
|
|
2168
|
+
[key: string]: string | number | boolean | Array<string> | null;
|
|
2169
|
+
};
|
|
2170
|
+
/**
|
|
2171
|
+
* The complete set of tag IDs. Replaces the current tags.
|
|
2172
|
+
*/
|
|
2173
|
+
tag_ids?: Array<string>;
|
|
2174
|
+
};
|
|
2175
|
+
/**
|
|
2176
|
+
* An approved WhatsApp template and the values of its variables.
|
|
2177
|
+
*/
|
|
2178
|
+
export type TemplateMessage = {
|
|
2179
|
+
/**
|
|
2180
|
+
* Approved template ID from `GET /templates`.
|
|
2181
|
+
*/
|
|
2182
|
+
id: string;
|
|
2183
|
+
/**
|
|
2184
|
+
* Variable values, in the WhatsApp Cloud API format.
|
|
2185
|
+
*/
|
|
2186
|
+
components?: Array<{
|
|
2187
|
+
type: 'header' | 'body' | 'button';
|
|
2188
|
+
sub_type?: 'url' | 'quick_reply';
|
|
2189
|
+
/**
|
|
2190
|
+
* Button position, from `"0"`.
|
|
2191
|
+
*/
|
|
2192
|
+
index?: string;
|
|
2193
|
+
parameters: Array<{
|
|
2194
|
+
type: 'text';
|
|
2195
|
+
text: string;
|
|
2196
|
+
/**
|
|
2197
|
+
* For `NAMED` templates.
|
|
2198
|
+
*/
|
|
2199
|
+
parameter_name?: string;
|
|
2200
|
+
} | {
|
|
2201
|
+
type: 'payload';
|
|
2202
|
+
payload: string;
|
|
2203
|
+
} | {
|
|
2204
|
+
type: 'image';
|
|
2205
|
+
/**
|
|
2206
|
+
* Media file.
|
|
2207
|
+
*/
|
|
2208
|
+
image: {
|
|
2209
|
+
/**
|
|
2210
|
+
* Public HTTPS URL of the file.
|
|
2211
|
+
*/
|
|
2212
|
+
link: string;
|
|
2213
|
+
};
|
|
2214
|
+
} | {
|
|
2215
|
+
type: 'video';
|
|
2216
|
+
/**
|
|
2217
|
+
* Media file.
|
|
2218
|
+
*/
|
|
2219
|
+
video: {
|
|
2220
|
+
/**
|
|
2221
|
+
* Public HTTPS URL of the file.
|
|
2222
|
+
*/
|
|
2223
|
+
link: string;
|
|
2224
|
+
};
|
|
2225
|
+
} | {
|
|
2226
|
+
type: 'document';
|
|
2227
|
+
document: {
|
|
2228
|
+
/**
|
|
2229
|
+
* Public HTTPS URL of the file.
|
|
2230
|
+
*/
|
|
2231
|
+
link: string;
|
|
2232
|
+
filename?: string;
|
|
2233
|
+
};
|
|
2234
|
+
} | {
|
|
2235
|
+
type: 'currency';
|
|
2236
|
+
currency: {
|
|
2237
|
+
amount_1000: number;
|
|
2238
|
+
code: string;
|
|
2239
|
+
fallback_value: string;
|
|
2240
|
+
};
|
|
2241
|
+
} | {
|
|
2242
|
+
type: 'date_time';
|
|
2243
|
+
date_time: {
|
|
2244
|
+
fallback_value: string;
|
|
2245
|
+
};
|
|
2246
|
+
}>;
|
|
2247
|
+
}>;
|
|
2248
|
+
};
|
|
2249
|
+
/**
|
|
2250
|
+
* A file Ricky downloads and sends. WhatsApp and Instagram only.
|
|
2251
|
+
*/
|
|
2252
|
+
export type MediaMessage = {
|
|
2253
|
+
/**
|
|
2254
|
+
* Public HTTPS URL of the file. Ricky downloads it once, without following redirects.
|
|
2255
|
+
*/
|
|
2256
|
+
url: string;
|
|
2257
|
+
/**
|
|
2258
|
+
* How the channel shows the file. The file type must match it.
|
|
2259
|
+
*/
|
|
2260
|
+
kind: 'image' | 'video' | 'audio' | 'document';
|
|
2261
|
+
/**
|
|
2262
|
+
* Text under an image, video or document. WhatsApp only.
|
|
2263
|
+
*/
|
|
2264
|
+
caption?: string;
|
|
2265
|
+
/**
|
|
2266
|
+
* Name the recipient sees for a document. Defaults to the last segment of `url`.
|
|
2267
|
+
*/
|
|
2268
|
+
filename?: string;
|
|
2269
|
+
};
|
|
2270
|
+
/**
|
|
2271
|
+
* Text and media work inside the channel reply window; a template (WhatsApp only) works any time.
|
|
2272
|
+
*/
|
|
2273
|
+
export type SendMessage = {
|
|
2274
|
+
type: 'text';
|
|
2275
|
+
/**
|
|
2276
|
+
* Message text.
|
|
2277
|
+
*/
|
|
2278
|
+
text: string;
|
|
2279
|
+
} | {
|
|
2280
|
+
type: 'template';
|
|
2281
|
+
template: TemplateMessage;
|
|
2282
|
+
} | {
|
|
2283
|
+
type: 'media';
|
|
2284
|
+
media: MediaMessage;
|
|
2285
|
+
};
|
|
2286
|
+
/**
|
|
2287
|
+
* Sends a template to a phone number.
|
|
2288
|
+
*/
|
|
2289
|
+
export type StartConversation = {
|
|
2290
|
+
/**
|
|
2291
|
+
* WhatsApp channel to send from. See `GET /channels`.
|
|
2292
|
+
*/
|
|
2293
|
+
channel_id: string;
|
|
2294
|
+
/**
|
|
2295
|
+
* Recipient phone with country code, for example `+50760001234`.
|
|
2296
|
+
*/
|
|
2297
|
+
phone: string;
|
|
2298
|
+
template: TemplateMessage;
|
|
2299
|
+
};
|
|
2300
|
+
export type AssignConversation = {
|
|
2301
|
+
/**
|
|
2302
|
+
* Member to assign; null unassigns.
|
|
2303
|
+
*/
|
|
2304
|
+
assigned_user_id: string | null;
|
|
2305
|
+
/**
|
|
2306
|
+
* Also make that member the contact owner.
|
|
2307
|
+
*/
|
|
2308
|
+
sync_contact_owner?: boolean;
|
|
2309
|
+
};
|
|
2310
|
+
export type CloseConversation = {
|
|
2311
|
+
/**
|
|
2312
|
+
* Why it is closed.
|
|
2313
|
+
*/
|
|
2314
|
+
category?: 'resolved' | 'sale' | 'no_response' | 'spam' | 'other' | null;
|
|
2315
|
+
};
|
|
2316
|
+
export type CreateTag = {
|
|
2317
|
+
/**
|
|
2318
|
+
* Display name, unique in the organization regardless of case.
|
|
2319
|
+
*/
|
|
2320
|
+
name: string;
|
|
2321
|
+
/**
|
|
2322
|
+
* Display color.
|
|
2323
|
+
*/
|
|
2324
|
+
color: 'gray' | 'red' | 'orange' | 'amber' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'pink';
|
|
2325
|
+
};
|
|
2326
|
+
export type AddContactNote = {
|
|
2327
|
+
/**
|
|
2328
|
+
* Note text. Ricky adds it after the current notes, separated by a blank line.
|
|
2329
|
+
*/
|
|
2330
|
+
text: string;
|
|
2331
|
+
};
|
|
2332
|
+
export type CreateWebhook = {
|
|
2333
|
+
/**
|
|
2334
|
+
* Public HTTPS endpoint.
|
|
2335
|
+
*/
|
|
2336
|
+
url: string;
|
|
2337
|
+
event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated'>;
|
|
2338
|
+
};
|
|
2339
|
+
export type RotateWebhookSecret = {
|
|
2340
|
+
/**
|
|
2341
|
+
* How long deliveries keep the previous signature too, so you can deploy the new secret first. 0 ends the previous secret now.
|
|
2342
|
+
*/
|
|
2343
|
+
expire_previous_after_hours?: number;
|
|
2344
|
+
};
|
|
2345
|
+
/**
|
|
2346
|
+
* Creates a conversation workflow as a `draft`. Activating it is a separate call.
|
|
2347
|
+
*/
|
|
2348
|
+
export type CreateWorkflow = {
|
|
2349
|
+
/**
|
|
2350
|
+
* Display name.
|
|
2351
|
+
*/
|
|
2352
|
+
name: string;
|
|
2353
|
+
/**
|
|
2354
|
+
* Reacts to a conversation with messages, questions, waits and assignments.
|
|
2355
|
+
*/
|
|
2356
|
+
definition: {
|
|
2357
|
+
/**
|
|
2358
|
+
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives.
|
|
2359
|
+
*/
|
|
2360
|
+
trigger: 'conversation_opened' | 'first_message_received';
|
|
2361
|
+
/**
|
|
2362
|
+
* Channels it listens to. See `GET /channels`.
|
|
2363
|
+
*/
|
|
2364
|
+
channel_ids: Array<string>;
|
|
2365
|
+
/**
|
|
2366
|
+
* When it runs; null runs at any hour.
|
|
2367
|
+
*/
|
|
2368
|
+
condition: {
|
|
2369
|
+
kind: 'inside_business_hours';
|
|
2370
|
+
business_hours: {
|
|
2371
|
+
/**
|
|
2372
|
+
* Opening time, `HH:MM`.
|
|
2373
|
+
*/
|
|
2374
|
+
start: string;
|
|
2375
|
+
/**
|
|
2376
|
+
* Closing time, `HH:MM`.
|
|
2377
|
+
*/
|
|
2378
|
+
end: string;
|
|
2379
|
+
/**
|
|
2380
|
+
* IANA time zone, for example `America/Panama`.
|
|
2381
|
+
*/
|
|
2382
|
+
timezone: string;
|
|
2383
|
+
/**
|
|
2384
|
+
* Open days, 0 for Sunday to 6 for Saturday.
|
|
2385
|
+
*/
|
|
2386
|
+
weekdays: Array<number>;
|
|
2387
|
+
};
|
|
2388
|
+
} | {
|
|
2389
|
+
kind: 'outside_business_hours';
|
|
2390
|
+
business_hours: {
|
|
2391
|
+
/**
|
|
2392
|
+
* Opening time, `HH:MM`.
|
|
2393
|
+
*/
|
|
2394
|
+
start: string;
|
|
2395
|
+
/**
|
|
2396
|
+
* Closing time, `HH:MM`.
|
|
2397
|
+
*/
|
|
2398
|
+
end: string;
|
|
2399
|
+
/**
|
|
2400
|
+
* IANA time zone, for example `America/Panama`.
|
|
2401
|
+
*/
|
|
2402
|
+
timezone: string;
|
|
2403
|
+
/**
|
|
2404
|
+
* Open days, 0 for Sunday to 6 for Saturday.
|
|
2405
|
+
*/
|
|
2406
|
+
weekdays: Array<number>;
|
|
2407
|
+
};
|
|
2408
|
+
} | null;
|
|
2409
|
+
/**
|
|
2410
|
+
* The steps and how they connect.
|
|
2411
|
+
*/
|
|
2412
|
+
flow: {
|
|
2413
|
+
/**
|
|
2414
|
+
* ID of the first step.
|
|
2415
|
+
*/
|
|
2416
|
+
entry: string;
|
|
2417
|
+
/**
|
|
2418
|
+
* One step. `assign_user`, `assign_agent` and `close_conversation` end the flow after they run.
|
|
2419
|
+
*/
|
|
2420
|
+
steps: Array<{
|
|
2421
|
+
/**
|
|
2422
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2423
|
+
*/
|
|
2424
|
+
id: string;
|
|
2425
|
+
/**
|
|
2426
|
+
* Step to run next; null ends the flow.
|
|
2427
|
+
*/
|
|
2428
|
+
next: string | null;
|
|
2429
|
+
kind: 'send_message';
|
|
2430
|
+
/**
|
|
2431
|
+
* Text sent to the contact.
|
|
2432
|
+
*/
|
|
2433
|
+
text: string;
|
|
2434
|
+
} | {
|
|
2435
|
+
/**
|
|
2436
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2437
|
+
*/
|
|
2438
|
+
id: string;
|
|
2439
|
+
/**
|
|
2440
|
+
* Step to run next; null ends the flow.
|
|
2441
|
+
*/
|
|
2442
|
+
next: string | null;
|
|
2443
|
+
kind: 'ask_question';
|
|
2444
|
+
/**
|
|
2445
|
+
* Text sent to the contact.
|
|
2446
|
+
*/
|
|
2447
|
+
text: string;
|
|
2448
|
+
/**
|
|
2449
|
+
* Name the answer is kept under, for a later `branch`.
|
|
2450
|
+
*/
|
|
2451
|
+
answer_key: string;
|
|
2452
|
+
/**
|
|
2453
|
+
* Buttons or list options, WhatsApp only. Empty for a free-text answer, which goes to `next`.
|
|
2454
|
+
*/
|
|
2455
|
+
choices: Array<{
|
|
2456
|
+
/**
|
|
2457
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2458
|
+
*/
|
|
2459
|
+
id: string;
|
|
2460
|
+
/**
|
|
2461
|
+
* Button text, up to 20 characters.
|
|
2462
|
+
*/
|
|
2463
|
+
label: string;
|
|
2464
|
+
/**
|
|
2465
|
+
* Step to run when the contact picks it.
|
|
2466
|
+
*/
|
|
2467
|
+
next: string | null;
|
|
2468
|
+
}>;
|
|
2469
|
+
/**
|
|
2470
|
+
* How long to wait for the answer, up to 7 days.
|
|
2471
|
+
*/
|
|
2472
|
+
timeout_seconds: number;
|
|
2473
|
+
/**
|
|
2474
|
+
* Step to run when no answer arrives in time.
|
|
2475
|
+
*/
|
|
2476
|
+
on_timeout: string | null;
|
|
2477
|
+
/**
|
|
2478
|
+
* Step to run when the answer matches no option.
|
|
2479
|
+
*/
|
|
2480
|
+
on_invalid: string | null;
|
|
2481
|
+
} | {
|
|
2482
|
+
/**
|
|
2483
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2484
|
+
*/
|
|
2485
|
+
id: string;
|
|
2486
|
+
/**
|
|
2487
|
+
* Step to run next; null ends the flow.
|
|
2488
|
+
*/
|
|
2489
|
+
next: string | null;
|
|
2490
|
+
kind: 'branch';
|
|
2491
|
+
/**
|
|
2492
|
+
* Name the answer is kept under, for a later `branch`.
|
|
2493
|
+
*/
|
|
2494
|
+
answer_key: string;
|
|
2495
|
+
operator: 'equals' | 'contains' | 'exists';
|
|
2496
|
+
/**
|
|
2497
|
+
* Value compared with the answer.
|
|
2498
|
+
*/
|
|
2499
|
+
value: string;
|
|
2500
|
+
/**
|
|
2501
|
+
* Step to run when the condition does not hold; `next` when it does.
|
|
2502
|
+
*/
|
|
2503
|
+
otherwise: string | null;
|
|
2504
|
+
} | {
|
|
2505
|
+
/**
|
|
2506
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2507
|
+
*/
|
|
2508
|
+
id: string;
|
|
2509
|
+
/**
|
|
2510
|
+
* Step to run next; null ends the flow.
|
|
2511
|
+
*/
|
|
2512
|
+
next: string | null;
|
|
2513
|
+
kind: 'wait';
|
|
2514
|
+
/**
|
|
2515
|
+
* Delay, up to 7 days.
|
|
2516
|
+
*/
|
|
2517
|
+
seconds: number;
|
|
2518
|
+
} | {
|
|
2519
|
+
/**
|
|
2520
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2521
|
+
*/
|
|
2522
|
+
id: string;
|
|
2523
|
+
/**
|
|
2524
|
+
* Step to run next; null ends the flow.
|
|
2525
|
+
*/
|
|
2526
|
+
next: string | null;
|
|
2527
|
+
kind: 'assign_user';
|
|
2528
|
+
/**
|
|
2529
|
+
* Member who takes the conversation. See `GET /members`.
|
|
2530
|
+
*/
|
|
2531
|
+
user_id: string;
|
|
2532
|
+
} | {
|
|
2533
|
+
/**
|
|
2534
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2535
|
+
*/
|
|
2536
|
+
id: string;
|
|
2537
|
+
/**
|
|
2538
|
+
* Step to run next; null ends the flow.
|
|
2539
|
+
*/
|
|
2540
|
+
next: string | null;
|
|
2541
|
+
kind: 'assign_agent';
|
|
2542
|
+
/**
|
|
2543
|
+
* AI agent that answers the conversation.
|
|
2544
|
+
*/
|
|
2545
|
+
agent_id: string;
|
|
2546
|
+
} | {
|
|
2547
|
+
/**
|
|
2548
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2549
|
+
*/
|
|
2550
|
+
id: string;
|
|
2551
|
+
/**
|
|
2552
|
+
* Step to run next; null ends the flow.
|
|
2553
|
+
*/
|
|
2554
|
+
next: string | null;
|
|
2555
|
+
kind: 'close_conversation';
|
|
2556
|
+
} | {
|
|
2557
|
+
/**
|
|
2558
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2559
|
+
*/
|
|
2560
|
+
id: string;
|
|
2561
|
+
/**
|
|
2562
|
+
* Step to run next; null ends the flow.
|
|
2563
|
+
*/
|
|
2564
|
+
next: string | null;
|
|
2565
|
+
kind: 'end';
|
|
2566
|
+
}>;
|
|
2567
|
+
};
|
|
2568
|
+
};
|
|
2569
|
+
};
|
|
2570
|
+
/**
|
|
2571
|
+
* Only the fields you send change. The status stays: an active workflow runs the new definition from its next execution.
|
|
2572
|
+
*/
|
|
2573
|
+
export type UpdateWorkflow = {
|
|
2574
|
+
/**
|
|
2575
|
+
* Display name.
|
|
2576
|
+
*/
|
|
2577
|
+
name?: string;
|
|
2578
|
+
/**
|
|
2579
|
+
* Replaces the whole definition.
|
|
2580
|
+
*/
|
|
2581
|
+
definition?: {
|
|
2582
|
+
/**
|
|
2583
|
+
* `conversation_opened` runs when a conversation opens; `first_message_received` when the first message from the contact in a conversation arrives.
|
|
2584
|
+
*/
|
|
2585
|
+
trigger: 'conversation_opened' | 'first_message_received';
|
|
2586
|
+
/**
|
|
2587
|
+
* Channels it listens to. See `GET /channels`.
|
|
2588
|
+
*/
|
|
2589
|
+
channel_ids: Array<string>;
|
|
2590
|
+
/**
|
|
2591
|
+
* When it runs; null runs at any hour.
|
|
2592
|
+
*/
|
|
2593
|
+
condition: {
|
|
2594
|
+
kind: 'inside_business_hours';
|
|
2595
|
+
business_hours: {
|
|
2596
|
+
/**
|
|
2597
|
+
* Opening time, `HH:MM`.
|
|
2598
|
+
*/
|
|
2599
|
+
start: string;
|
|
2600
|
+
/**
|
|
2601
|
+
* Closing time, `HH:MM`.
|
|
2602
|
+
*/
|
|
2603
|
+
end: string;
|
|
2604
|
+
/**
|
|
2605
|
+
* IANA time zone, for example `America/Panama`.
|
|
2606
|
+
*/
|
|
2607
|
+
timezone: string;
|
|
2608
|
+
/**
|
|
2609
|
+
* Open days, 0 for Sunday to 6 for Saturday.
|
|
2610
|
+
*/
|
|
2611
|
+
weekdays: Array<number>;
|
|
2612
|
+
};
|
|
2613
|
+
} | {
|
|
2614
|
+
kind: 'outside_business_hours';
|
|
2615
|
+
business_hours: {
|
|
2616
|
+
/**
|
|
2617
|
+
* Opening time, `HH:MM`.
|
|
2618
|
+
*/
|
|
2619
|
+
start: string;
|
|
2620
|
+
/**
|
|
2621
|
+
* Closing time, `HH:MM`.
|
|
2622
|
+
*/
|
|
2623
|
+
end: string;
|
|
2624
|
+
/**
|
|
2625
|
+
* IANA time zone, for example `America/Panama`.
|
|
2626
|
+
*/
|
|
2627
|
+
timezone: string;
|
|
2628
|
+
/**
|
|
2629
|
+
* Open days, 0 for Sunday to 6 for Saturday.
|
|
2630
|
+
*/
|
|
2631
|
+
weekdays: Array<number>;
|
|
2632
|
+
};
|
|
2633
|
+
} | null;
|
|
2634
|
+
/**
|
|
2635
|
+
* The steps and how they connect.
|
|
2636
|
+
*/
|
|
2637
|
+
flow: {
|
|
2638
|
+
/**
|
|
2639
|
+
* ID of the first step.
|
|
2640
|
+
*/
|
|
2641
|
+
entry: string;
|
|
2642
|
+
/**
|
|
2643
|
+
* One step. `assign_user`, `assign_agent` and `close_conversation` end the flow after they run.
|
|
2644
|
+
*/
|
|
2645
|
+
steps: Array<{
|
|
2646
|
+
/**
|
|
2647
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2648
|
+
*/
|
|
2649
|
+
id: string;
|
|
2650
|
+
/**
|
|
2651
|
+
* Step to run next; null ends the flow.
|
|
2652
|
+
*/
|
|
2653
|
+
next: string | null;
|
|
2654
|
+
kind: 'send_message';
|
|
2655
|
+
/**
|
|
2656
|
+
* Text sent to the contact.
|
|
2657
|
+
*/
|
|
2658
|
+
text: string;
|
|
2659
|
+
} | {
|
|
2660
|
+
/**
|
|
2661
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2662
|
+
*/
|
|
2663
|
+
id: string;
|
|
2664
|
+
/**
|
|
2665
|
+
* Step to run next; null ends the flow.
|
|
2666
|
+
*/
|
|
2667
|
+
next: string | null;
|
|
2668
|
+
kind: 'ask_question';
|
|
2669
|
+
/**
|
|
2670
|
+
* Text sent to the contact.
|
|
2671
|
+
*/
|
|
2672
|
+
text: string;
|
|
2673
|
+
/**
|
|
2674
|
+
* Name the answer is kept under, for a later `branch`.
|
|
2675
|
+
*/
|
|
2676
|
+
answer_key: string;
|
|
2677
|
+
/**
|
|
2678
|
+
* Buttons or list options, WhatsApp only. Empty for a free-text answer, which goes to `next`.
|
|
2679
|
+
*/
|
|
2680
|
+
choices: Array<{
|
|
2681
|
+
/**
|
|
2682
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2683
|
+
*/
|
|
2684
|
+
id: string;
|
|
2685
|
+
/**
|
|
2686
|
+
* Button text, up to 20 characters.
|
|
2687
|
+
*/
|
|
2688
|
+
label: string;
|
|
2689
|
+
/**
|
|
2690
|
+
* Step to run when the contact picks it.
|
|
2691
|
+
*/
|
|
2692
|
+
next: string | null;
|
|
2693
|
+
}>;
|
|
2694
|
+
/**
|
|
2695
|
+
* How long to wait for the answer, up to 7 days.
|
|
2696
|
+
*/
|
|
2697
|
+
timeout_seconds: number;
|
|
2698
|
+
/**
|
|
2699
|
+
* Step to run when no answer arrives in time.
|
|
2700
|
+
*/
|
|
2701
|
+
on_timeout: string | null;
|
|
2702
|
+
/**
|
|
2703
|
+
* Step to run when the answer matches no option.
|
|
2704
|
+
*/
|
|
2705
|
+
on_invalid: string | null;
|
|
2706
|
+
} | {
|
|
2707
|
+
/**
|
|
2708
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2709
|
+
*/
|
|
2710
|
+
id: string;
|
|
2711
|
+
/**
|
|
2712
|
+
* Step to run next; null ends the flow.
|
|
2713
|
+
*/
|
|
2714
|
+
next: string | null;
|
|
2715
|
+
kind: 'branch';
|
|
2716
|
+
/**
|
|
2717
|
+
* Name the answer is kept under, for a later `branch`.
|
|
2718
|
+
*/
|
|
2719
|
+
answer_key: string;
|
|
2720
|
+
operator: 'equals' | 'contains' | 'exists';
|
|
2721
|
+
/**
|
|
2722
|
+
* Value compared with the answer.
|
|
2723
|
+
*/
|
|
2724
|
+
value: string;
|
|
2725
|
+
/**
|
|
2726
|
+
* Step to run when the condition does not hold; `next` when it does.
|
|
2727
|
+
*/
|
|
2728
|
+
otherwise: string | null;
|
|
2729
|
+
} | {
|
|
2730
|
+
/**
|
|
2731
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2732
|
+
*/
|
|
2733
|
+
id: string;
|
|
2734
|
+
/**
|
|
2735
|
+
* Step to run next; null ends the flow.
|
|
2736
|
+
*/
|
|
2737
|
+
next: string | null;
|
|
2738
|
+
kind: 'wait';
|
|
2739
|
+
/**
|
|
2740
|
+
* Delay, up to 7 days.
|
|
2741
|
+
*/
|
|
2742
|
+
seconds: number;
|
|
2743
|
+
} | {
|
|
2744
|
+
/**
|
|
2745
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2746
|
+
*/
|
|
2747
|
+
id: string;
|
|
2748
|
+
/**
|
|
2749
|
+
* Step to run next; null ends the flow.
|
|
2750
|
+
*/
|
|
2751
|
+
next: string | null;
|
|
2752
|
+
kind: 'assign_user';
|
|
2753
|
+
/**
|
|
2754
|
+
* Member who takes the conversation. See `GET /members`.
|
|
2755
|
+
*/
|
|
2756
|
+
user_id: string;
|
|
2757
|
+
} | {
|
|
2758
|
+
/**
|
|
2759
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2760
|
+
*/
|
|
2761
|
+
id: string;
|
|
2762
|
+
/**
|
|
2763
|
+
* Step to run next; null ends the flow.
|
|
2764
|
+
*/
|
|
2765
|
+
next: string | null;
|
|
2766
|
+
kind: 'assign_agent';
|
|
2767
|
+
/**
|
|
2768
|
+
* AI agent that answers the conversation.
|
|
2769
|
+
*/
|
|
2770
|
+
agent_id: string;
|
|
2771
|
+
} | {
|
|
2772
|
+
/**
|
|
2773
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2774
|
+
*/
|
|
2775
|
+
id: string;
|
|
2776
|
+
/**
|
|
2777
|
+
* Step to run next; null ends the flow.
|
|
2778
|
+
*/
|
|
2779
|
+
next: string | null;
|
|
2780
|
+
kind: 'close_conversation';
|
|
2781
|
+
} | {
|
|
2782
|
+
/**
|
|
2783
|
+
* Step ID: letters, digits, `_` or `-`, up to 64.
|
|
2784
|
+
*/
|
|
2785
|
+
id: string;
|
|
2786
|
+
/**
|
|
2787
|
+
* Step to run next; null ends the flow.
|
|
2788
|
+
*/
|
|
2789
|
+
next: string | null;
|
|
2790
|
+
kind: 'end';
|
|
2791
|
+
}>;
|
|
2792
|
+
};
|
|
2793
|
+
};
|
|
2794
|
+
};
|
|
2795
|
+
/**
|
|
2796
|
+
* 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.
|
|
2797
|
+
*/
|
|
2798
|
+
export type IdempotencyKey = string;
|
|
2799
|
+
export type ListContactsData = {
|
|
2800
|
+
body?: never;
|
|
2801
|
+
path?: never;
|
|
2802
|
+
query?: {
|
|
2803
|
+
/**
|
|
2804
|
+
* Items per page.
|
|
2805
|
+
*/
|
|
2806
|
+
page_size?: number;
|
|
2807
|
+
/**
|
|
2808
|
+
* `next_cursor` from the previous page. Use it unchanged.
|
|
2809
|
+
*/
|
|
2810
|
+
cursor?: string;
|
|
2811
|
+
/**
|
|
2812
|
+
* Text contained in the name, phone, email or company.
|
|
2813
|
+
*/
|
|
2814
|
+
query?: string;
|
|
2815
|
+
/**
|
|
2816
|
+
* Only contacts with this tag.
|
|
2817
|
+
*/
|
|
2818
|
+
tag_id?: string;
|
|
2819
|
+
/**
|
|
2820
|
+
* Only contacts this member owns.
|
|
2821
|
+
*/
|
|
2822
|
+
owner_user_id?: string;
|
|
2823
|
+
/**
|
|
2824
|
+
* Only contacts at this stage.
|
|
2825
|
+
*/
|
|
2826
|
+
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other';
|
|
2827
|
+
/**
|
|
2828
|
+
* Only contacts reachable on this channel.
|
|
2829
|
+
*/
|
|
2830
|
+
channel?: 'whatsapp' | 'instagram' | 'messenger';
|
|
2831
|
+
};
|
|
2832
|
+
url: '/contacts';
|
|
2833
|
+
};
|
|
2834
|
+
export type ListContactsErrors = {
|
|
2835
|
+
/**
|
|
2836
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2837
|
+
*/
|
|
2838
|
+
400: Error;
|
|
2839
|
+
/**
|
|
2840
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2841
|
+
*/
|
|
2842
|
+
401: Error;
|
|
2843
|
+
/**
|
|
2844
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2845
|
+
*/
|
|
2846
|
+
403: Error;
|
|
2847
|
+
/**
|
|
2848
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2849
|
+
*/
|
|
2850
|
+
429: Error;
|
|
2851
|
+
/**
|
|
2852
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2853
|
+
*/
|
|
2854
|
+
500: Error;
|
|
2855
|
+
};
|
|
2856
|
+
export type ListContactsError = ListContactsErrors[keyof ListContactsErrors];
|
|
2857
|
+
export type ListContactsResponses = {
|
|
2858
|
+
/**
|
|
2859
|
+
* Success.
|
|
2860
|
+
*/
|
|
2861
|
+
200: {
|
|
2862
|
+
data: Array<Contact>;
|
|
2863
|
+
/**
|
|
2864
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
2865
|
+
*/
|
|
2866
|
+
next_cursor: string | null;
|
|
2867
|
+
};
|
|
2868
|
+
};
|
|
2869
|
+
export type ListContactsResponse = ListContactsResponses[keyof ListContactsResponses];
|
|
2870
|
+
export type CreateContactData = {
|
|
2871
|
+
body: CreateContact;
|
|
2872
|
+
headers?: {
|
|
2873
|
+
/**
|
|
2874
|
+
* 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.
|
|
2875
|
+
*/
|
|
2876
|
+
'Idempotency-Key'?: string;
|
|
2877
|
+
};
|
|
2878
|
+
path?: never;
|
|
2879
|
+
query?: never;
|
|
2880
|
+
url: '/contacts';
|
|
2881
|
+
};
|
|
2882
|
+
export type CreateContactErrors = {
|
|
2883
|
+
/**
|
|
2884
|
+
* `invalid_json`: The body is not valid JSON.
|
|
2885
|
+
*
|
|
2886
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2887
|
+
*/
|
|
2888
|
+
400: Error;
|
|
2889
|
+
/**
|
|
2890
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2891
|
+
*/
|
|
2892
|
+
401: Error;
|
|
2893
|
+
/**
|
|
2894
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2895
|
+
*/
|
|
2896
|
+
403: Error;
|
|
2897
|
+
/**
|
|
2898
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
2899
|
+
*
|
|
2900
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
2901
|
+
*
|
|
2902
|
+
* `conflict`: The resource changed in a way that prevents the operation.
|
|
2903
|
+
*/
|
|
2904
|
+
409: Error;
|
|
2905
|
+
/**
|
|
2906
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
2907
|
+
*/
|
|
2908
|
+
413: Error;
|
|
2909
|
+
/**
|
|
2910
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
2911
|
+
*/
|
|
2912
|
+
415: Error;
|
|
2913
|
+
/**
|
|
2914
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2915
|
+
*/
|
|
2916
|
+
429: Error;
|
|
2917
|
+
/**
|
|
2918
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2919
|
+
*/
|
|
2920
|
+
500: Error;
|
|
2921
|
+
};
|
|
2922
|
+
export type CreateContactError = CreateContactErrors[keyof CreateContactErrors];
|
|
2923
|
+
export type CreateContactResponses = {
|
|
2924
|
+
/**
|
|
2925
|
+
* Success.
|
|
2926
|
+
*/
|
|
2927
|
+
201: {
|
|
2928
|
+
data: Contact;
|
|
2929
|
+
};
|
|
2930
|
+
};
|
|
2931
|
+
export type CreateContactResponse = CreateContactResponses[keyof CreateContactResponses];
|
|
2932
|
+
export type GetContactData = {
|
|
2933
|
+
body?: never;
|
|
2934
|
+
path: {
|
|
2935
|
+
/**
|
|
2936
|
+
* Contact ID.
|
|
2937
|
+
*/
|
|
2938
|
+
contact_id: string;
|
|
2939
|
+
};
|
|
2940
|
+
query?: never;
|
|
2941
|
+
url: '/contacts/{contact_id}';
|
|
2942
|
+
};
|
|
2943
|
+
export type GetContactErrors = {
|
|
2944
|
+
/**
|
|
2945
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2946
|
+
*/
|
|
2947
|
+
400: Error;
|
|
2948
|
+
/**
|
|
2949
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2950
|
+
*/
|
|
2951
|
+
401: Error;
|
|
2952
|
+
/**
|
|
2953
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2954
|
+
*/
|
|
2955
|
+
403: Error;
|
|
2956
|
+
/**
|
|
2957
|
+
* `not_found`: The resource does not exist in this organization.
|
|
2958
|
+
*/
|
|
2959
|
+
404: Error;
|
|
2960
|
+
/**
|
|
2961
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2962
|
+
*/
|
|
2963
|
+
429: Error;
|
|
2964
|
+
/**
|
|
2965
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2966
|
+
*/
|
|
2967
|
+
500: Error;
|
|
2968
|
+
};
|
|
2969
|
+
export type GetContactError = GetContactErrors[keyof GetContactErrors];
|
|
2970
|
+
export type GetContactResponses = {
|
|
2971
|
+
/**
|
|
2972
|
+
* Success.
|
|
2973
|
+
*/
|
|
2974
|
+
200: {
|
|
2975
|
+
data: Contact;
|
|
2976
|
+
};
|
|
2977
|
+
};
|
|
2978
|
+
export type GetContactResponse = GetContactResponses[keyof GetContactResponses];
|
|
2979
|
+
export type UpdateContactData = {
|
|
2980
|
+
body: UpdateContact;
|
|
2981
|
+
headers?: {
|
|
2982
|
+
/**
|
|
2983
|
+
* 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.
|
|
2984
|
+
*/
|
|
2985
|
+
'Idempotency-Key'?: string;
|
|
2986
|
+
};
|
|
2987
|
+
path: {
|
|
2988
|
+
/**
|
|
2989
|
+
* Contact ID.
|
|
2990
|
+
*/
|
|
2991
|
+
contact_id: string;
|
|
2992
|
+
};
|
|
2993
|
+
query?: never;
|
|
2994
|
+
url: '/contacts/{contact_id}';
|
|
2995
|
+
};
|
|
2996
|
+
export type UpdateContactErrors = {
|
|
2997
|
+
/**
|
|
2998
|
+
* `invalid_json`: The body is not valid JSON.
|
|
2999
|
+
*
|
|
3000
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
3001
|
+
*/
|
|
3002
|
+
400: Error;
|
|
3003
|
+
/**
|
|
3004
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3005
|
+
*/
|
|
3006
|
+
401: Error;
|
|
3007
|
+
/**
|
|
3008
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3009
|
+
*/
|
|
3010
|
+
403: Error;
|
|
3011
|
+
/**
|
|
3012
|
+
* `not_found`: The resource does not exist in this organization.
|
|
3013
|
+
*/
|
|
3014
|
+
404: Error;
|
|
3015
|
+
/**
|
|
3016
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
3017
|
+
*
|
|
3018
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
3019
|
+
*
|
|
3020
|
+
* `conflict`: The resource changed in a way that prevents the operation.
|
|
3021
|
+
*/
|
|
3022
|
+
409: Error;
|
|
3023
|
+
/**
|
|
3024
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
3025
|
+
*/
|
|
3026
|
+
413: Error;
|
|
3027
|
+
/**
|
|
3028
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
3029
|
+
*/
|
|
3030
|
+
415: Error;
|
|
3031
|
+
/**
|
|
3032
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3033
|
+
*/
|
|
3034
|
+
429: Error;
|
|
3035
|
+
/**
|
|
3036
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3037
|
+
*/
|
|
3038
|
+
500: Error;
|
|
3039
|
+
};
|
|
3040
|
+
export type UpdateContactError = UpdateContactErrors[keyof UpdateContactErrors];
|
|
3041
|
+
export type UpdateContactResponses = {
|
|
3042
|
+
/**
|
|
3043
|
+
* Success.
|
|
3044
|
+
*/
|
|
3045
|
+
200: {
|
|
3046
|
+
data: Contact;
|
|
3047
|
+
};
|
|
3048
|
+
};
|
|
3049
|
+
export type UpdateContactResponse = UpdateContactResponses[keyof UpdateContactResponses];
|
|
3050
|
+
export type AddContactNoteData = {
|
|
3051
|
+
body: AddContactNote;
|
|
3052
|
+
headers?: {
|
|
3053
|
+
/**
|
|
3054
|
+
* 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.
|
|
3055
|
+
*/
|
|
3056
|
+
'Idempotency-Key'?: string;
|
|
3057
|
+
};
|
|
3058
|
+
path: {
|
|
3059
|
+
/**
|
|
3060
|
+
* Contact ID.
|
|
3061
|
+
*/
|
|
3062
|
+
contact_id: string;
|
|
3063
|
+
};
|
|
3064
|
+
query?: never;
|
|
3065
|
+
url: '/contacts/{contact_id}/notes';
|
|
3066
|
+
};
|
|
3067
|
+
export type AddContactNoteErrors = {
|
|
3068
|
+
/**
|
|
3069
|
+
* `invalid_json`: The body is not valid JSON.
|
|
3070
|
+
*
|
|
3071
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
3072
|
+
*/
|
|
3073
|
+
400: Error;
|
|
3074
|
+
/**
|
|
3075
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3076
|
+
*/
|
|
3077
|
+
401: Error;
|
|
3078
|
+
/**
|
|
3079
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3080
|
+
*/
|
|
3081
|
+
403: Error;
|
|
3082
|
+
/**
|
|
3083
|
+
* `not_found`: The resource does not exist in this organization.
|
|
3084
|
+
*/
|
|
3085
|
+
404: Error;
|
|
3086
|
+
/**
|
|
3087
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
3088
|
+
*
|
|
3089
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
3090
|
+
*/
|
|
3091
|
+
409: Error;
|
|
3092
|
+
/**
|
|
3093
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
3094
|
+
*/
|
|
3095
|
+
413: Error;
|
|
3096
|
+
/**
|
|
3097
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
3098
|
+
*/
|
|
3099
|
+
415: Error;
|
|
3100
|
+
/**
|
|
3101
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3102
|
+
*/
|
|
3103
|
+
429: Error;
|
|
3104
|
+
/**
|
|
3105
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3106
|
+
*/
|
|
3107
|
+
500: Error;
|
|
3108
|
+
};
|
|
3109
|
+
export type AddContactNoteError = AddContactNoteErrors[keyof AddContactNoteErrors];
|
|
3110
|
+
export type AddContactNoteResponses = {
|
|
3111
|
+
/**
|
|
3112
|
+
* Success.
|
|
3113
|
+
*/
|
|
3114
|
+
200: {
|
|
3115
|
+
data: Contact;
|
|
3116
|
+
};
|
|
3117
|
+
};
|
|
3118
|
+
export type AddContactNoteResponse = AddContactNoteResponses[keyof AddContactNoteResponses];
|
|
3119
|
+
export type ListContactFieldsData = {
|
|
3120
|
+
body?: never;
|
|
3121
|
+
path?: never;
|
|
3122
|
+
query?: never;
|
|
3123
|
+
url: '/contact-fields';
|
|
3124
|
+
};
|
|
3125
|
+
export type ListContactFieldsErrors = {
|
|
3126
|
+
/**
|
|
3127
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3128
|
+
*/
|
|
3129
|
+
401: Error;
|
|
3130
|
+
/**
|
|
3131
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3132
|
+
*/
|
|
3133
|
+
403: Error;
|
|
3134
|
+
/**
|
|
3135
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3136
|
+
*/
|
|
3137
|
+
429: Error;
|
|
3138
|
+
/**
|
|
3139
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3140
|
+
*/
|
|
3141
|
+
500: Error;
|
|
3142
|
+
};
|
|
3143
|
+
export type ListContactFieldsError = ListContactFieldsErrors[keyof ListContactFieldsErrors];
|
|
3144
|
+
export type ListContactFieldsResponses = {
|
|
3145
|
+
/**
|
|
3146
|
+
* Success.
|
|
3147
|
+
*/
|
|
3148
|
+
200: {
|
|
3149
|
+
data: Array<ContactField>;
|
|
3150
|
+
/**
|
|
3151
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
3152
|
+
*/
|
|
3153
|
+
next_cursor: string | null;
|
|
3154
|
+
};
|
|
3155
|
+
};
|
|
3156
|
+
export type ListContactFieldsResponse = ListContactFieldsResponses[keyof ListContactFieldsResponses];
|
|
3157
|
+
export type ListConversationsData = {
|
|
3158
|
+
body?: never;
|
|
3159
|
+
path?: never;
|
|
3160
|
+
query?: {
|
|
3161
|
+
/**
|
|
3162
|
+
* Items per page.
|
|
3163
|
+
*/
|
|
3164
|
+
page_size?: number;
|
|
3165
|
+
/**
|
|
3166
|
+
* `next_cursor` from the previous page. Use it unchanged.
|
|
3167
|
+
*/
|
|
3168
|
+
cursor?: string;
|
|
3169
|
+
status?: 'all' | 'open' | 'closed';
|
|
3170
|
+
/**
|
|
3171
|
+
* Only conversations assigned to this member.
|
|
3172
|
+
*/
|
|
3173
|
+
assigned_user_id?: string;
|
|
3174
|
+
};
|
|
3175
|
+
url: '/conversations';
|
|
3176
|
+
};
|
|
3177
|
+
export type ListConversationsErrors = {
|
|
3178
|
+
/**
|
|
3179
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
3180
|
+
*/
|
|
3181
|
+
400: Error;
|
|
3182
|
+
/**
|
|
3183
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3184
|
+
*/
|
|
3185
|
+
401: Error;
|
|
3186
|
+
/**
|
|
3187
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3188
|
+
*/
|
|
3189
|
+
403: Error;
|
|
3190
|
+
/**
|
|
3191
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3192
|
+
*/
|
|
3193
|
+
429: Error;
|
|
3194
|
+
/**
|
|
3195
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3196
|
+
*/
|
|
3197
|
+
500: Error;
|
|
3198
|
+
};
|
|
3199
|
+
export type ListConversationsError = ListConversationsErrors[keyof ListConversationsErrors];
|
|
3200
|
+
export type ListConversationsResponses = {
|
|
3201
|
+
/**
|
|
3202
|
+
* Success.
|
|
3203
|
+
*/
|
|
3204
|
+
200: {
|
|
3205
|
+
data: Array<Conversation>;
|
|
3206
|
+
/**
|
|
3207
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
3208
|
+
*/
|
|
3209
|
+
next_cursor: string | null;
|
|
3210
|
+
};
|
|
3211
|
+
};
|
|
3212
|
+
export type ListConversationsResponse = ListConversationsResponses[keyof ListConversationsResponses];
|
|
3213
|
+
export type StartConversationData = {
|
|
3214
|
+
body: StartConversation;
|
|
3215
|
+
headers?: {
|
|
3216
|
+
/**
|
|
3217
|
+
* 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.
|
|
3218
|
+
*/
|
|
3219
|
+
'Idempotency-Key'?: string;
|
|
3220
|
+
};
|
|
3221
|
+
path?: never;
|
|
3222
|
+
query?: never;
|
|
3223
|
+
url: '/conversations';
|
|
3224
|
+
};
|
|
3225
|
+
export type StartConversationErrors = {
|
|
3226
|
+
/**
|
|
3227
|
+
* `invalid_json`: The body is not valid JSON.
|
|
3228
|
+
*
|
|
3229
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
3230
|
+
*/
|
|
3231
|
+
400: Error;
|
|
3232
|
+
/**
|
|
3233
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3234
|
+
*/
|
|
3235
|
+
401: Error;
|
|
3236
|
+
/**
|
|
3237
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3238
|
+
*/
|
|
3239
|
+
403: Error;
|
|
3240
|
+
/**
|
|
3241
|
+
* `not_found`: The resource does not exist in this organization.
|
|
3242
|
+
*/
|
|
3243
|
+
404: Error;
|
|
3244
|
+
/**
|
|
3245
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
3246
|
+
*
|
|
3247
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
3248
|
+
*/
|
|
3249
|
+
409: Error;
|
|
3250
|
+
/**
|
|
3251
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
3252
|
+
*/
|
|
3253
|
+
413: Error;
|
|
3254
|
+
/**
|
|
3255
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
3256
|
+
*/
|
|
3257
|
+
415: Error;
|
|
3258
|
+
/**
|
|
3259
|
+
* `outside_messaging_window`: The channel only allows free-form text inside its reply window; send a template.
|
|
3260
|
+
*
|
|
3261
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
3262
|
+
*/
|
|
3263
|
+
422: Error;
|
|
3264
|
+
/**
|
|
3265
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3266
|
+
*/
|
|
3267
|
+
429: Error;
|
|
3268
|
+
/**
|
|
3269
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3270
|
+
*/
|
|
3271
|
+
500: Error;
|
|
3272
|
+
/**
|
|
3273
|
+
* `upstream_error`: The messaging provider failed. Retry later.
|
|
3274
|
+
*/
|
|
3275
|
+
502: Error;
|
|
3276
|
+
/**
|
|
3277
|
+
* `unavailable`: A dependency is temporarily unavailable. Retry later.
|
|
3278
|
+
*/
|
|
3279
|
+
503: Error;
|
|
3280
|
+
};
|
|
3281
|
+
export type StartConversationError = StartConversationErrors[keyof StartConversationErrors];
|
|
3282
|
+
export type StartConversationResponses = {
|
|
3283
|
+
/**
|
|
3284
|
+
* Accepted.
|
|
3285
|
+
*/
|
|
3286
|
+
202: {
|
|
3287
|
+
data: Send;
|
|
3288
|
+
};
|
|
3289
|
+
};
|
|
3290
|
+
export type StartConversationResponse = StartConversationResponses[keyof StartConversationResponses];
|
|
3291
|
+
export type GetConversationData = {
|
|
3292
|
+
body?: never;
|
|
3293
|
+
path: {
|
|
3294
|
+
/**
|
|
3295
|
+
* Conversation ID.
|
|
3296
|
+
*/
|
|
3297
|
+
conversation_id: string;
|
|
3298
|
+
};
|
|
3299
|
+
query?: never;
|
|
3300
|
+
url: '/conversations/{conversation_id}';
|
|
3301
|
+
};
|
|
3302
|
+
export type GetConversationErrors = {
|
|
3303
|
+
/**
|
|
3304
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
3305
|
+
*/
|
|
3306
|
+
400: Error;
|
|
3307
|
+
/**
|
|
3308
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3309
|
+
*/
|
|
3310
|
+
401: Error;
|
|
3311
|
+
/**
|
|
3312
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3313
|
+
*/
|
|
3314
|
+
403: Error;
|
|
3315
|
+
/**
|
|
3316
|
+
* `not_found`: The resource does not exist in this organization.
|
|
3317
|
+
*/
|
|
3318
|
+
404: Error;
|
|
3319
|
+
/**
|
|
3320
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3321
|
+
*/
|
|
3322
|
+
429: Error;
|
|
3323
|
+
/**
|
|
3324
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3325
|
+
*/
|
|
3326
|
+
500: Error;
|
|
3327
|
+
};
|
|
3328
|
+
export type GetConversationError = GetConversationErrors[keyof GetConversationErrors];
|
|
3329
|
+
export type GetConversationResponses = {
|
|
3330
|
+
/**
|
|
3331
|
+
* Success.
|
|
3332
|
+
*/
|
|
3333
|
+
200: {
|
|
3334
|
+
data: Conversation;
|
|
3335
|
+
};
|
|
3336
|
+
};
|
|
3337
|
+
export type GetConversationResponse = GetConversationResponses[keyof GetConversationResponses];
|
|
3338
|
+
export type AssignConversationData = {
|
|
3339
|
+
body: AssignConversation;
|
|
3340
|
+
headers?: {
|
|
3341
|
+
/**
|
|
3342
|
+
* 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.
|
|
3343
|
+
*/
|
|
3344
|
+
'Idempotency-Key'?: string;
|
|
3345
|
+
};
|
|
3346
|
+
path: {
|
|
3347
|
+
/**
|
|
3348
|
+
* Conversation ID.
|
|
3349
|
+
*/
|
|
3350
|
+
conversation_id: string;
|
|
3351
|
+
};
|
|
3352
|
+
query?: never;
|
|
3353
|
+
url: '/conversations/{conversation_id}/assignment';
|
|
3354
|
+
};
|
|
3355
|
+
export type AssignConversationErrors = {
|
|
3356
|
+
/**
|
|
3357
|
+
* `invalid_json`: The body is not valid JSON.
|
|
3358
|
+
*
|
|
3359
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
3360
|
+
*/
|
|
3361
|
+
400: Error;
|
|
748
3362
|
/**
|
|
749
|
-
*
|
|
3363
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
750
3364
|
*/
|
|
751
|
-
|
|
3365
|
+
401: Error;
|
|
752
3366
|
/**
|
|
753
|
-
*
|
|
3367
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
754
3368
|
*/
|
|
755
|
-
|
|
3369
|
+
403: Error;
|
|
756
3370
|
/**
|
|
757
|
-
*
|
|
3371
|
+
* `not_found`: The resource does not exist in this organization.
|
|
758
3372
|
*/
|
|
759
|
-
|
|
760
|
-
lead_status?: 'new' | 'open' | 'in_progress' | 'attempted' | 'connected' | 'unqualified' | 'bad_timing' | null;
|
|
761
|
-
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other' | null;
|
|
3373
|
+
404: Error;
|
|
762
3374
|
/**
|
|
763
|
-
*
|
|
3375
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
3376
|
+
*
|
|
3377
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
764
3378
|
*/
|
|
765
|
-
|
|
766
|
-
[key: string]: string | number | boolean | Array<string> | null;
|
|
767
|
-
};
|
|
3379
|
+
409: Error;
|
|
768
3380
|
/**
|
|
769
|
-
* The
|
|
3381
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
770
3382
|
*/
|
|
771
|
-
|
|
772
|
-
};
|
|
773
|
-
/**
|
|
774
|
-
* An approved WhatsApp template and the values of its variables.
|
|
775
|
-
*/
|
|
776
|
-
export type TemplateMessage = {
|
|
3383
|
+
413: Error;
|
|
777
3384
|
/**
|
|
778
|
-
*
|
|
3385
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
779
3386
|
*/
|
|
780
|
-
|
|
3387
|
+
415: Error;
|
|
781
3388
|
/**
|
|
782
|
-
*
|
|
3389
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
783
3390
|
*/
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
3391
|
+
422: Error;
|
|
3392
|
+
/**
|
|
3393
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3394
|
+
*/
|
|
3395
|
+
429: Error;
|
|
3396
|
+
/**
|
|
3397
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3398
|
+
*/
|
|
3399
|
+
500: Error;
|
|
3400
|
+
};
|
|
3401
|
+
export type AssignConversationError = AssignConversationErrors[keyof AssignConversationErrors];
|
|
3402
|
+
export type AssignConversationResponses = {
|
|
3403
|
+
/**
|
|
3404
|
+
* Success.
|
|
3405
|
+
*/
|
|
3406
|
+
200: {
|
|
3407
|
+
data: Conversation;
|
|
3408
|
+
};
|
|
3409
|
+
};
|
|
3410
|
+
export type AssignConversationResponse = AssignConversationResponses[keyof AssignConversationResponses];
|
|
3411
|
+
export type CloseConversationData = {
|
|
3412
|
+
body: CloseConversation;
|
|
3413
|
+
headers?: {
|
|
787
3414
|
/**
|
|
788
|
-
*
|
|
3415
|
+
* 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.
|
|
789
3416
|
*/
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
payload: string;
|
|
801
|
-
} | {
|
|
802
|
-
type: 'image';
|
|
803
|
-
/**
|
|
804
|
-
* Media file.
|
|
805
|
-
*/
|
|
806
|
-
image: {
|
|
807
|
-
/**
|
|
808
|
-
* Public HTTPS URL of the file.
|
|
809
|
-
*/
|
|
810
|
-
link: string;
|
|
811
|
-
};
|
|
812
|
-
} | {
|
|
813
|
-
type: 'video';
|
|
814
|
-
/**
|
|
815
|
-
* Media file.
|
|
816
|
-
*/
|
|
817
|
-
video: {
|
|
818
|
-
/**
|
|
819
|
-
* Public HTTPS URL of the file.
|
|
820
|
-
*/
|
|
821
|
-
link: string;
|
|
822
|
-
};
|
|
823
|
-
} | {
|
|
824
|
-
type: 'document';
|
|
825
|
-
document: {
|
|
826
|
-
/**
|
|
827
|
-
* Public HTTPS URL of the file.
|
|
828
|
-
*/
|
|
829
|
-
link: string;
|
|
830
|
-
filename?: string;
|
|
831
|
-
};
|
|
832
|
-
} | {
|
|
833
|
-
type: 'currency';
|
|
834
|
-
currency: {
|
|
835
|
-
amount_1000: number;
|
|
836
|
-
code: string;
|
|
837
|
-
fallback_value: string;
|
|
838
|
-
};
|
|
839
|
-
} | {
|
|
840
|
-
type: 'date_time';
|
|
841
|
-
date_time: {
|
|
842
|
-
fallback_value: string;
|
|
843
|
-
};
|
|
844
|
-
}>;
|
|
845
|
-
}>;
|
|
3417
|
+
'Idempotency-Key'?: string;
|
|
3418
|
+
};
|
|
3419
|
+
path: {
|
|
3420
|
+
/**
|
|
3421
|
+
* Conversation ID.
|
|
3422
|
+
*/
|
|
3423
|
+
conversation_id: string;
|
|
3424
|
+
};
|
|
3425
|
+
query?: never;
|
|
3426
|
+
url: '/conversations/{conversation_id}/close';
|
|
846
3427
|
};
|
|
847
|
-
|
|
848
|
-
* A file Ricky downloads and sends. WhatsApp and Instagram only.
|
|
849
|
-
*/
|
|
850
|
-
export type MediaMessage = {
|
|
3428
|
+
export type CloseConversationErrors = {
|
|
851
3429
|
/**
|
|
852
|
-
*
|
|
3430
|
+
* `invalid_json`: The body is not valid JSON.
|
|
3431
|
+
*
|
|
3432
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
853
3433
|
*/
|
|
854
|
-
|
|
3434
|
+
400: Error;
|
|
855
3435
|
/**
|
|
856
|
-
*
|
|
3436
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
857
3437
|
*/
|
|
858
|
-
|
|
3438
|
+
401: Error;
|
|
859
3439
|
/**
|
|
860
|
-
*
|
|
3440
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
861
3441
|
*/
|
|
862
|
-
|
|
3442
|
+
403: Error;
|
|
863
3443
|
/**
|
|
864
|
-
*
|
|
3444
|
+
* `not_found`: The resource does not exist in this organization.
|
|
865
3445
|
*/
|
|
866
|
-
|
|
867
|
-
};
|
|
868
|
-
/**
|
|
869
|
-
* Text and media work inside the channel reply window; a template (WhatsApp only) works any time.
|
|
870
|
-
*/
|
|
871
|
-
export type SendMessage = {
|
|
872
|
-
type: 'text';
|
|
3446
|
+
404: Error;
|
|
873
3447
|
/**
|
|
874
|
-
*
|
|
3448
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
3449
|
+
*
|
|
3450
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
875
3451
|
*/
|
|
876
|
-
|
|
877
|
-
} | {
|
|
878
|
-
type: 'template';
|
|
879
|
-
template: TemplateMessage;
|
|
880
|
-
} | {
|
|
881
|
-
type: 'media';
|
|
882
|
-
media: MediaMessage;
|
|
883
|
-
};
|
|
884
|
-
/**
|
|
885
|
-
* Sends a template to a phone number.
|
|
886
|
-
*/
|
|
887
|
-
export type StartConversation = {
|
|
3452
|
+
409: Error;
|
|
888
3453
|
/**
|
|
889
|
-
*
|
|
3454
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
890
3455
|
*/
|
|
891
|
-
|
|
3456
|
+
413: Error;
|
|
892
3457
|
/**
|
|
893
|
-
*
|
|
3458
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
894
3459
|
*/
|
|
895
|
-
|
|
896
|
-
template: TemplateMessage;
|
|
897
|
-
};
|
|
898
|
-
export type AssignConversation = {
|
|
3460
|
+
415: Error;
|
|
899
3461
|
/**
|
|
900
|
-
*
|
|
3462
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
901
3463
|
*/
|
|
902
|
-
|
|
3464
|
+
429: Error;
|
|
903
3465
|
/**
|
|
904
|
-
*
|
|
3466
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
905
3467
|
*/
|
|
906
|
-
|
|
3468
|
+
500: Error;
|
|
907
3469
|
};
|
|
908
|
-
export type
|
|
3470
|
+
export type CloseConversationError = CloseConversationErrors[keyof CloseConversationErrors];
|
|
3471
|
+
export type CloseConversationResponses = {
|
|
909
3472
|
/**
|
|
910
|
-
*
|
|
3473
|
+
* Success.
|
|
911
3474
|
*/
|
|
912
|
-
|
|
3475
|
+
200: {
|
|
3476
|
+
data: Conversation;
|
|
3477
|
+
};
|
|
913
3478
|
};
|
|
914
|
-
export type
|
|
3479
|
+
export type CloseConversationResponse = CloseConversationResponses[keyof CloseConversationResponses];
|
|
3480
|
+
export type ReopenConversationData = {
|
|
3481
|
+
body?: never;
|
|
3482
|
+
headers?: {
|
|
3483
|
+
/**
|
|
3484
|
+
* 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.
|
|
3485
|
+
*/
|
|
3486
|
+
'Idempotency-Key'?: string;
|
|
3487
|
+
};
|
|
3488
|
+
path: {
|
|
3489
|
+
/**
|
|
3490
|
+
* Conversation ID.
|
|
3491
|
+
*/
|
|
3492
|
+
conversation_id: string;
|
|
3493
|
+
};
|
|
3494
|
+
query?: never;
|
|
3495
|
+
url: '/conversations/{conversation_id}/reopen';
|
|
3496
|
+
};
|
|
3497
|
+
export type ReopenConversationErrors = {
|
|
915
3498
|
/**
|
|
916
|
-
*
|
|
3499
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
917
3500
|
*/
|
|
918
|
-
|
|
3501
|
+
400: Error;
|
|
919
3502
|
/**
|
|
920
|
-
*
|
|
3503
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
921
3504
|
*/
|
|
922
|
-
|
|
923
|
-
};
|
|
924
|
-
export type AddContactNote = {
|
|
3505
|
+
401: Error;
|
|
925
3506
|
/**
|
|
926
|
-
*
|
|
3507
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
927
3508
|
*/
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
3509
|
+
403: Error;
|
|
3510
|
+
/**
|
|
3511
|
+
* `not_found`: The resource does not exist in this organization.
|
|
3512
|
+
*/
|
|
3513
|
+
404: Error;
|
|
3514
|
+
/**
|
|
3515
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
3516
|
+
*
|
|
3517
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
3518
|
+
*/
|
|
3519
|
+
409: Error;
|
|
3520
|
+
/**
|
|
3521
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3522
|
+
*/
|
|
3523
|
+
429: Error;
|
|
931
3524
|
/**
|
|
932
|
-
*
|
|
3525
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
933
3526
|
*/
|
|
934
|
-
|
|
935
|
-
event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated'>;
|
|
3527
|
+
500: Error;
|
|
936
3528
|
};
|
|
937
|
-
export type
|
|
3529
|
+
export type ReopenConversationError = ReopenConversationErrors[keyof ReopenConversationErrors];
|
|
3530
|
+
export type ReopenConversationResponses = {
|
|
938
3531
|
/**
|
|
939
|
-
*
|
|
3532
|
+
* Success.
|
|
940
3533
|
*/
|
|
941
|
-
|
|
3534
|
+
200: {
|
|
3535
|
+
data: Conversation;
|
|
3536
|
+
};
|
|
942
3537
|
};
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
*/
|
|
946
|
-
export type IdempotencyKey = string;
|
|
947
|
-
export type ListContactsData = {
|
|
3538
|
+
export type ReopenConversationResponse = ReopenConversationResponses[keyof ReopenConversationResponses];
|
|
3539
|
+
export type ListMessagesData = {
|
|
948
3540
|
body?: never;
|
|
949
|
-
path
|
|
950
|
-
query?: {
|
|
3541
|
+
path: {
|
|
951
3542
|
/**
|
|
952
|
-
*
|
|
3543
|
+
* Conversation ID.
|
|
953
3544
|
*/
|
|
954
|
-
|
|
3545
|
+
conversation_id: string;
|
|
3546
|
+
};
|
|
3547
|
+
query?: {
|
|
955
3548
|
/**
|
|
956
3549
|
* `next_cursor` from the previous page. Use it unchanged.
|
|
957
3550
|
*/
|
|
958
3551
|
cursor?: string;
|
|
959
|
-
/**
|
|
960
|
-
* Text contained in the name, phone, email or company.
|
|
961
|
-
*/
|
|
962
|
-
query?: string;
|
|
963
|
-
/**
|
|
964
|
-
* Only contacts with this tag.
|
|
965
|
-
*/
|
|
966
|
-
tag_id?: string;
|
|
967
|
-
/**
|
|
968
|
-
* Only contacts this member owns.
|
|
969
|
-
*/
|
|
970
|
-
owner_user_id?: string;
|
|
971
|
-
/**
|
|
972
|
-
* Only contacts at this stage.
|
|
973
|
-
*/
|
|
974
|
-
lifecycle_stage?: 'subscriber' | 'lead' | 'marketing_qualified' | 'sales_qualified' | 'opportunity' | 'customer' | 'evangelist' | 'other';
|
|
975
|
-
/**
|
|
976
|
-
* Only contacts reachable on this channel.
|
|
977
|
-
*/
|
|
978
|
-
channel?: 'whatsapp' | 'instagram' | 'messenger';
|
|
979
3552
|
};
|
|
980
|
-
url: '/
|
|
3553
|
+
url: '/conversations/{conversation_id}/messages';
|
|
981
3554
|
};
|
|
982
|
-
export type
|
|
3555
|
+
export type ListMessagesErrors = {
|
|
983
3556
|
/**
|
|
984
3557
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
985
3558
|
*/
|
|
@@ -992,6 +3565,10 @@ export type ListContactsErrors = {
|
|
|
992
3565
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
993
3566
|
*/
|
|
994
3567
|
403: Error;
|
|
3568
|
+
/**
|
|
3569
|
+
* `not_found`: The resource does not exist in this organization.
|
|
3570
|
+
*/
|
|
3571
|
+
404: Error;
|
|
995
3572
|
/**
|
|
996
3573
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
997
3574
|
*/
|
|
@@ -1001,33 +3578,38 @@ export type ListContactsErrors = {
|
|
|
1001
3578
|
*/
|
|
1002
3579
|
500: Error;
|
|
1003
3580
|
};
|
|
1004
|
-
export type
|
|
1005
|
-
export type
|
|
3581
|
+
export type ListMessagesError = ListMessagesErrors[keyof ListMessagesErrors];
|
|
3582
|
+
export type ListMessagesResponses = {
|
|
1006
3583
|
/**
|
|
1007
3584
|
* Success.
|
|
1008
3585
|
*/
|
|
1009
3586
|
200: {
|
|
1010
|
-
data: Array<
|
|
3587
|
+
data: Array<Message>;
|
|
1011
3588
|
/**
|
|
1012
3589
|
* Pass as `cursor` for the next page; null on the last page.
|
|
1013
3590
|
*/
|
|
1014
3591
|
next_cursor: string | null;
|
|
1015
3592
|
};
|
|
1016
3593
|
};
|
|
1017
|
-
export type
|
|
1018
|
-
export type
|
|
1019
|
-
body:
|
|
3594
|
+
export type ListMessagesResponse = ListMessagesResponses[keyof ListMessagesResponses];
|
|
3595
|
+
export type SendMessageData = {
|
|
3596
|
+
body: SendMessage;
|
|
1020
3597
|
headers?: {
|
|
1021
3598
|
/**
|
|
1022
3599
|
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
1023
3600
|
*/
|
|
1024
3601
|
'Idempotency-Key'?: string;
|
|
1025
3602
|
};
|
|
1026
|
-
path
|
|
3603
|
+
path: {
|
|
3604
|
+
/**
|
|
3605
|
+
* Conversation ID.
|
|
3606
|
+
*/
|
|
3607
|
+
conversation_id: string;
|
|
3608
|
+
};
|
|
1027
3609
|
query?: never;
|
|
1028
|
-
url: '/
|
|
3610
|
+
url: '/conversations/{conversation_id}/messages';
|
|
1029
3611
|
};
|
|
1030
|
-
export type
|
|
3612
|
+
export type SendMessageErrors = {
|
|
1031
3613
|
/**
|
|
1032
3614
|
* `invalid_json`: The body is not valid JSON.
|
|
1033
3615
|
*
|
|
@@ -1042,12 +3624,14 @@ export type CreateContactErrors = {
|
|
|
1042
3624
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1043
3625
|
*/
|
|
1044
3626
|
403: Error;
|
|
3627
|
+
/**
|
|
3628
|
+
* `not_found`: The resource does not exist in this organization.
|
|
3629
|
+
*/
|
|
3630
|
+
404: Error;
|
|
1045
3631
|
/**
|
|
1046
3632
|
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1047
3633
|
*
|
|
1048
3634
|
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1049
|
-
*
|
|
1050
|
-
* `conflict`: The resource changed in a way that prevents the operation.
|
|
1051
3635
|
*/
|
|
1052
3636
|
409: Error;
|
|
1053
3637
|
/**
|
|
@@ -1058,6 +3642,12 @@ export type CreateContactErrors = {
|
|
|
1058
3642
|
* `unsupported_media_type`: The body must be `application/json`.
|
|
1059
3643
|
*/
|
|
1060
3644
|
415: Error;
|
|
3645
|
+
/**
|
|
3646
|
+
* `outside_messaging_window`: The channel only allows free-form text inside its reply window; send a template.
|
|
3647
|
+
*
|
|
3648
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
3649
|
+
*/
|
|
3650
|
+
422: Error;
|
|
1061
3651
|
/**
|
|
1062
3652
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1063
3653
|
*/
|
|
@@ -1066,29 +3656,88 @@ export type CreateContactErrors = {
|
|
|
1066
3656
|
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1067
3657
|
*/
|
|
1068
3658
|
500: Error;
|
|
3659
|
+
/**
|
|
3660
|
+
* `upstream_error`: The messaging provider failed. Retry later.
|
|
3661
|
+
*/
|
|
3662
|
+
502: Error;
|
|
3663
|
+
/**
|
|
3664
|
+
* `unavailable`: A dependency is temporarily unavailable. Retry later.
|
|
3665
|
+
*/
|
|
3666
|
+
503: Error;
|
|
1069
3667
|
};
|
|
1070
|
-
export type
|
|
1071
|
-
export type
|
|
3668
|
+
export type SendMessageError = SendMessageErrors[keyof SendMessageErrors];
|
|
3669
|
+
export type SendMessageResponses = {
|
|
3670
|
+
/**
|
|
3671
|
+
* Accepted.
|
|
3672
|
+
*/
|
|
3673
|
+
202: {
|
|
3674
|
+
data: Send;
|
|
3675
|
+
};
|
|
3676
|
+
};
|
|
3677
|
+
export type SendMessageResponse = SendMessageResponses[keyof SendMessageResponses];
|
|
3678
|
+
export type GetMessageData = {
|
|
3679
|
+
body?: never;
|
|
3680
|
+
path: {
|
|
3681
|
+
/**
|
|
3682
|
+
* Conversation ID.
|
|
3683
|
+
*/
|
|
3684
|
+
conversation_id: string;
|
|
3685
|
+
/**
|
|
3686
|
+
* Message ID.
|
|
3687
|
+
*/
|
|
3688
|
+
message_id: string;
|
|
3689
|
+
};
|
|
3690
|
+
query?: never;
|
|
3691
|
+
url: '/conversations/{conversation_id}/messages/{message_id}';
|
|
3692
|
+
};
|
|
3693
|
+
export type GetMessageErrors = {
|
|
3694
|
+
/**
|
|
3695
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
3696
|
+
*/
|
|
3697
|
+
400: Error;
|
|
3698
|
+
/**
|
|
3699
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3700
|
+
*/
|
|
3701
|
+
401: Error;
|
|
3702
|
+
/**
|
|
3703
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3704
|
+
*/
|
|
3705
|
+
403: Error;
|
|
3706
|
+
/**
|
|
3707
|
+
* `not_found`: The resource does not exist in this organization.
|
|
3708
|
+
*/
|
|
3709
|
+
404: Error;
|
|
3710
|
+
/**
|
|
3711
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3712
|
+
*/
|
|
3713
|
+
429: Error;
|
|
3714
|
+
/**
|
|
3715
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3716
|
+
*/
|
|
3717
|
+
500: Error;
|
|
3718
|
+
};
|
|
3719
|
+
export type GetMessageError = GetMessageErrors[keyof GetMessageErrors];
|
|
3720
|
+
export type GetMessageResponses = {
|
|
1072
3721
|
/**
|
|
1073
3722
|
* Success.
|
|
1074
3723
|
*/
|
|
1075
|
-
|
|
1076
|
-
data:
|
|
3724
|
+
200: {
|
|
3725
|
+
data: Message;
|
|
1077
3726
|
};
|
|
1078
3727
|
};
|
|
1079
|
-
export type
|
|
1080
|
-
export type
|
|
3728
|
+
export type GetMessageResponse = GetMessageResponses[keyof GetMessageResponses];
|
|
3729
|
+
export type GetSendData = {
|
|
1081
3730
|
body?: never;
|
|
1082
3731
|
path: {
|
|
1083
3732
|
/**
|
|
1084
|
-
*
|
|
3733
|
+
* Send ID.
|
|
1085
3734
|
*/
|
|
1086
|
-
|
|
3735
|
+
send_id: string;
|
|
1087
3736
|
};
|
|
1088
3737
|
query?: never;
|
|
1089
|
-
url: '/
|
|
3738
|
+
url: '/sends/{send_id}';
|
|
1090
3739
|
};
|
|
1091
|
-
export type
|
|
3740
|
+
export type GetSendErrors = {
|
|
1092
3741
|
/**
|
|
1093
3742
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1094
3743
|
*/
|
|
@@ -1114,40 +3763,99 @@ export type GetContactErrors = {
|
|
|
1114
3763
|
*/
|
|
1115
3764
|
500: Error;
|
|
1116
3765
|
};
|
|
1117
|
-
export type
|
|
1118
|
-
export type
|
|
3766
|
+
export type GetSendError = GetSendErrors[keyof GetSendErrors];
|
|
3767
|
+
export type GetSendResponses = {
|
|
1119
3768
|
/**
|
|
1120
3769
|
* Success.
|
|
1121
3770
|
*/
|
|
1122
3771
|
200: {
|
|
1123
|
-
data:
|
|
3772
|
+
data: Send;
|
|
1124
3773
|
};
|
|
1125
3774
|
};
|
|
1126
|
-
export type
|
|
1127
|
-
export type
|
|
1128
|
-
body
|
|
1129
|
-
|
|
3775
|
+
export type GetSendResponse = GetSendResponses[keyof GetSendResponses];
|
|
3776
|
+
export type ListChannelsData = {
|
|
3777
|
+
body?: never;
|
|
3778
|
+
path?: never;
|
|
3779
|
+
query?: never;
|
|
3780
|
+
url: '/channels';
|
|
3781
|
+
};
|
|
3782
|
+
export type ListChannelsErrors = {
|
|
3783
|
+
/**
|
|
3784
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3785
|
+
*/
|
|
3786
|
+
401: Error;
|
|
3787
|
+
/**
|
|
3788
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3789
|
+
*/
|
|
3790
|
+
403: Error;
|
|
3791
|
+
/**
|
|
3792
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3793
|
+
*/
|
|
3794
|
+
429: Error;
|
|
3795
|
+
/**
|
|
3796
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3797
|
+
*/
|
|
3798
|
+
500: Error;
|
|
3799
|
+
};
|
|
3800
|
+
export type ListChannelsError = ListChannelsErrors[keyof ListChannelsErrors];
|
|
3801
|
+
export type ListChannelsResponses = {
|
|
3802
|
+
/**
|
|
3803
|
+
* Success.
|
|
3804
|
+
*/
|
|
3805
|
+
200: {
|
|
3806
|
+
data: Array<Channel>;
|
|
1130
3807
|
/**
|
|
1131
|
-
*
|
|
3808
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
1132
3809
|
*/
|
|
1133
|
-
|
|
3810
|
+
next_cursor: string | null;
|
|
1134
3811
|
};
|
|
1135
|
-
|
|
3812
|
+
};
|
|
3813
|
+
export type ListChannelsResponse = ListChannelsResponses[keyof ListChannelsResponses];
|
|
3814
|
+
export type ListMembersData = {
|
|
3815
|
+
body?: never;
|
|
3816
|
+
path?: never;
|
|
3817
|
+
query?: never;
|
|
3818
|
+
url: '/members';
|
|
3819
|
+
};
|
|
3820
|
+
export type ListMembersErrors = {
|
|
3821
|
+
/**
|
|
3822
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
3823
|
+
*/
|
|
3824
|
+
401: Error;
|
|
3825
|
+
/**
|
|
3826
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
3827
|
+
*/
|
|
3828
|
+
403: Error;
|
|
3829
|
+
/**
|
|
3830
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
3831
|
+
*/
|
|
3832
|
+
429: Error;
|
|
3833
|
+
/**
|
|
3834
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
3835
|
+
*/
|
|
3836
|
+
500: Error;
|
|
3837
|
+
};
|
|
3838
|
+
export type ListMembersError = ListMembersErrors[keyof ListMembersErrors];
|
|
3839
|
+
export type ListMembersResponses = {
|
|
3840
|
+
/**
|
|
3841
|
+
* Success.
|
|
3842
|
+
*/
|
|
3843
|
+
200: {
|
|
3844
|
+
data: Array<Member>;
|
|
1136
3845
|
/**
|
|
1137
|
-
*
|
|
3846
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
1138
3847
|
*/
|
|
1139
|
-
|
|
3848
|
+
next_cursor: string | null;
|
|
1140
3849
|
};
|
|
3850
|
+
};
|
|
3851
|
+
export type ListMembersResponse = ListMembersResponses[keyof ListMembersResponses];
|
|
3852
|
+
export type ListTagsData = {
|
|
3853
|
+
body?: never;
|
|
3854
|
+
path?: never;
|
|
1141
3855
|
query?: never;
|
|
1142
|
-
url: '/
|
|
3856
|
+
url: '/tags';
|
|
1143
3857
|
};
|
|
1144
|
-
export type
|
|
1145
|
-
/**
|
|
1146
|
-
* `invalid_json`: The body is not valid JSON.
|
|
1147
|
-
*
|
|
1148
|
-
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1149
|
-
*/
|
|
1150
|
-
400: Error;
|
|
3858
|
+
export type ListTagsErrors = {
|
|
1151
3859
|
/**
|
|
1152
3860
|
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1153
3861
|
*/
|
|
@@ -1156,26 +3864,6 @@ export type UpdateContactErrors = {
|
|
|
1156
3864
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1157
3865
|
*/
|
|
1158
3866
|
403: Error;
|
|
1159
|
-
/**
|
|
1160
|
-
* `not_found`: The resource does not exist in this organization.
|
|
1161
|
-
*/
|
|
1162
|
-
404: Error;
|
|
1163
|
-
/**
|
|
1164
|
-
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1165
|
-
*
|
|
1166
|
-
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1167
|
-
*
|
|
1168
|
-
* `conflict`: The resource changed in a way that prevents the operation.
|
|
1169
|
-
*/
|
|
1170
|
-
409: Error;
|
|
1171
|
-
/**
|
|
1172
|
-
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1173
|
-
*/
|
|
1174
|
-
413: Error;
|
|
1175
|
-
/**
|
|
1176
|
-
* `unsupported_media_type`: The body must be `application/json`.
|
|
1177
|
-
*/
|
|
1178
|
-
415: Error;
|
|
1179
3867
|
/**
|
|
1180
3868
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1181
3869
|
*/
|
|
@@ -1185,34 +3873,33 @@ export type UpdateContactErrors = {
|
|
|
1185
3873
|
*/
|
|
1186
3874
|
500: Error;
|
|
1187
3875
|
};
|
|
1188
|
-
export type
|
|
1189
|
-
export type
|
|
3876
|
+
export type ListTagsError = ListTagsErrors[keyof ListTagsErrors];
|
|
3877
|
+
export type ListTagsResponses = {
|
|
1190
3878
|
/**
|
|
1191
3879
|
* Success.
|
|
1192
3880
|
*/
|
|
1193
3881
|
200: {
|
|
1194
|
-
data:
|
|
3882
|
+
data: Array<Tag>;
|
|
3883
|
+
/**
|
|
3884
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
3885
|
+
*/
|
|
3886
|
+
next_cursor: string | null;
|
|
1195
3887
|
};
|
|
1196
3888
|
};
|
|
1197
|
-
export type
|
|
1198
|
-
export type
|
|
1199
|
-
body:
|
|
3889
|
+
export type ListTagsResponse = ListTagsResponses[keyof ListTagsResponses];
|
|
3890
|
+
export type CreateTagData = {
|
|
3891
|
+
body: CreateTag;
|
|
1200
3892
|
headers?: {
|
|
1201
3893
|
/**
|
|
1202
3894
|
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
1203
3895
|
*/
|
|
1204
3896
|
'Idempotency-Key'?: string;
|
|
1205
3897
|
};
|
|
1206
|
-
path
|
|
1207
|
-
/**
|
|
1208
|
-
* Contact ID.
|
|
1209
|
-
*/
|
|
1210
|
-
contact_id: string;
|
|
1211
|
-
};
|
|
3898
|
+
path?: never;
|
|
1212
3899
|
query?: never;
|
|
1213
|
-
url: '/
|
|
3900
|
+
url: '/tags';
|
|
1214
3901
|
};
|
|
1215
|
-
export type
|
|
3902
|
+
export type CreateTagErrors = {
|
|
1216
3903
|
/**
|
|
1217
3904
|
* `invalid_json`: The body is not valid JSON.
|
|
1218
3905
|
*
|
|
@@ -1227,14 +3914,12 @@ export type AddContactNoteErrors = {
|
|
|
1227
3914
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1228
3915
|
*/
|
|
1229
3916
|
403: Error;
|
|
1230
|
-
/**
|
|
1231
|
-
* `not_found`: The resource does not exist in this organization.
|
|
1232
|
-
*/
|
|
1233
|
-
404: Error;
|
|
1234
3917
|
/**
|
|
1235
3918
|
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1236
3919
|
*
|
|
1237
3920
|
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
3921
|
+
*
|
|
3922
|
+
* `conflict`: The resource changed in a way that prevents the operation.
|
|
1238
3923
|
*/
|
|
1239
3924
|
409: Error;
|
|
1240
3925
|
/**
|
|
@@ -1254,23 +3939,23 @@ export type AddContactNoteErrors = {
|
|
|
1254
3939
|
*/
|
|
1255
3940
|
500: Error;
|
|
1256
3941
|
};
|
|
1257
|
-
export type
|
|
1258
|
-
export type
|
|
3942
|
+
export type CreateTagError = CreateTagErrors[keyof CreateTagErrors];
|
|
3943
|
+
export type CreateTagResponses = {
|
|
1259
3944
|
/**
|
|
1260
3945
|
* Success.
|
|
1261
3946
|
*/
|
|
1262
|
-
|
|
1263
|
-
data:
|
|
3947
|
+
201: {
|
|
3948
|
+
data: Tag;
|
|
1264
3949
|
};
|
|
1265
3950
|
};
|
|
1266
|
-
export type
|
|
1267
|
-
export type
|
|
3951
|
+
export type CreateTagResponse = CreateTagResponses[keyof CreateTagResponses];
|
|
3952
|
+
export type ListTemplatesData = {
|
|
1268
3953
|
body?: never;
|
|
1269
3954
|
path?: never;
|
|
1270
3955
|
query?: never;
|
|
1271
|
-
url: '/
|
|
3956
|
+
url: '/templates';
|
|
1272
3957
|
};
|
|
1273
|
-
export type
|
|
3958
|
+
export type ListTemplatesErrors = {
|
|
1274
3959
|
/**
|
|
1275
3960
|
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1276
3961
|
*/
|
|
@@ -1287,46 +3972,32 @@ export type ListContactFieldsErrors = {
|
|
|
1287
3972
|
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1288
3973
|
*/
|
|
1289
3974
|
500: Error;
|
|
3975
|
+
/**
|
|
3976
|
+
* `upstream_error`: The messaging provider failed. Retry later.
|
|
3977
|
+
*/
|
|
3978
|
+
502: Error;
|
|
1290
3979
|
};
|
|
1291
|
-
export type
|
|
1292
|
-
export type
|
|
3980
|
+
export type ListTemplatesError = ListTemplatesErrors[keyof ListTemplatesErrors];
|
|
3981
|
+
export type ListTemplatesResponses = {
|
|
1293
3982
|
/**
|
|
1294
3983
|
* Success.
|
|
1295
3984
|
*/
|
|
1296
3985
|
200: {
|
|
1297
|
-
data: Array<
|
|
3986
|
+
data: Array<Template>;
|
|
1298
3987
|
/**
|
|
1299
3988
|
* Pass as `cursor` for the next page; null on the last page.
|
|
1300
3989
|
*/
|
|
1301
3990
|
next_cursor: string | null;
|
|
1302
3991
|
};
|
|
1303
3992
|
};
|
|
1304
|
-
export type
|
|
1305
|
-
export type
|
|
3993
|
+
export type ListTemplatesResponse = ListTemplatesResponses[keyof ListTemplatesResponses];
|
|
3994
|
+
export type ListWebhooksData = {
|
|
1306
3995
|
body?: never;
|
|
1307
3996
|
path?: never;
|
|
1308
|
-
query?:
|
|
1309
|
-
|
|
1310
|
-
* Items per page.
|
|
1311
|
-
*/
|
|
1312
|
-
page_size?: number;
|
|
1313
|
-
/**
|
|
1314
|
-
* `next_cursor` from the previous page. Use it unchanged.
|
|
1315
|
-
*/
|
|
1316
|
-
cursor?: string;
|
|
1317
|
-
status?: 'all' | 'open' | 'closed';
|
|
1318
|
-
/**
|
|
1319
|
-
* Only conversations assigned to this member.
|
|
1320
|
-
*/
|
|
1321
|
-
assigned_user_id?: string;
|
|
1322
|
-
};
|
|
1323
|
-
url: '/conversations';
|
|
3997
|
+
query?: never;
|
|
3998
|
+
url: '/webhooks';
|
|
1324
3999
|
};
|
|
1325
|
-
export type
|
|
1326
|
-
/**
|
|
1327
|
-
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1328
|
-
*/
|
|
1329
|
-
400: Error;
|
|
4000
|
+
export type ListWebhooksErrors = {
|
|
1330
4001
|
/**
|
|
1331
4002
|
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1332
4003
|
*/
|
|
@@ -1344,33 +4015,27 @@ export type ListConversationsErrors = {
|
|
|
1344
4015
|
*/
|
|
1345
4016
|
500: Error;
|
|
1346
4017
|
};
|
|
1347
|
-
export type
|
|
1348
|
-
export type
|
|
4018
|
+
export type ListWebhooksError = ListWebhooksErrors[keyof ListWebhooksErrors];
|
|
4019
|
+
export type ListWebhooksResponses = {
|
|
1349
4020
|
/**
|
|
1350
4021
|
* Success.
|
|
1351
4022
|
*/
|
|
1352
4023
|
200: {
|
|
1353
|
-
data: Array<
|
|
4024
|
+
data: Array<Webhook>;
|
|
1354
4025
|
/**
|
|
1355
4026
|
* Pass as `cursor` for the next page; null on the last page.
|
|
1356
4027
|
*/
|
|
1357
4028
|
next_cursor: string | null;
|
|
1358
4029
|
};
|
|
1359
4030
|
};
|
|
1360
|
-
export type
|
|
1361
|
-
export type
|
|
1362
|
-
body:
|
|
1363
|
-
headers?: {
|
|
1364
|
-
/**
|
|
1365
|
-
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
1366
|
-
*/
|
|
1367
|
-
'Idempotency-Key'?: string;
|
|
1368
|
-
};
|
|
4031
|
+
export type ListWebhooksResponse = ListWebhooksResponses[keyof ListWebhooksResponses];
|
|
4032
|
+
export type CreateWebhookData = {
|
|
4033
|
+
body: CreateWebhook;
|
|
1369
4034
|
path?: never;
|
|
1370
4035
|
query?: never;
|
|
1371
|
-
url: '/
|
|
4036
|
+
url: '/webhooks';
|
|
1372
4037
|
};
|
|
1373
|
-
export type
|
|
4038
|
+
export type CreateWebhookErrors = {
|
|
1374
4039
|
/**
|
|
1375
4040
|
* `invalid_json`: The body is not valid JSON.
|
|
1376
4041
|
*
|
|
@@ -1385,16 +4050,6 @@ export type StartConversationErrors = {
|
|
|
1385
4050
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1386
4051
|
*/
|
|
1387
4052
|
403: Error;
|
|
1388
|
-
/**
|
|
1389
|
-
* `not_found`: The resource does not exist in this organization.
|
|
1390
|
-
*/
|
|
1391
|
-
404: Error;
|
|
1392
|
-
/**
|
|
1393
|
-
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1394
|
-
*
|
|
1395
|
-
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1396
|
-
*/
|
|
1397
|
-
409: Error;
|
|
1398
4053
|
/**
|
|
1399
4054
|
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1400
4055
|
*/
|
|
@@ -1403,12 +4058,6 @@ export type StartConversationErrors = {
|
|
|
1403
4058
|
* `unsupported_media_type`: The body must be `application/json`.
|
|
1404
4059
|
*/
|
|
1405
4060
|
415: Error;
|
|
1406
|
-
/**
|
|
1407
|
-
* `outside_messaging_window`: The channel only allows free-form text inside its reply window; send a template.
|
|
1408
|
-
*
|
|
1409
|
-
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
1410
|
-
*/
|
|
1411
|
-
422: Error;
|
|
1412
4061
|
/**
|
|
1413
4062
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1414
4063
|
*/
|
|
@@ -1417,37 +4066,29 @@ export type StartConversationErrors = {
|
|
|
1417
4066
|
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1418
4067
|
*/
|
|
1419
4068
|
500: Error;
|
|
1420
|
-
/**
|
|
1421
|
-
* `upstream_error`: The messaging provider failed. Retry later.
|
|
1422
|
-
*/
|
|
1423
|
-
502: Error;
|
|
1424
|
-
/**
|
|
1425
|
-
* `unavailable`: A dependency is temporarily unavailable. Retry later.
|
|
1426
|
-
*/
|
|
1427
|
-
503: Error;
|
|
1428
4069
|
};
|
|
1429
|
-
export type
|
|
1430
|
-
export type
|
|
4070
|
+
export type CreateWebhookError = CreateWebhookErrors[keyof CreateWebhookErrors];
|
|
4071
|
+
export type CreateWebhookResponses = {
|
|
1431
4072
|
/**
|
|
1432
|
-
*
|
|
4073
|
+
* Success.
|
|
1433
4074
|
*/
|
|
1434
|
-
|
|
1435
|
-
data:
|
|
4075
|
+
201: {
|
|
4076
|
+
data: CreatedWebhook;
|
|
1436
4077
|
};
|
|
1437
4078
|
};
|
|
1438
|
-
export type
|
|
1439
|
-
export type
|
|
4079
|
+
export type CreateWebhookResponse = CreateWebhookResponses[keyof CreateWebhookResponses];
|
|
4080
|
+
export type DisableWebhookData = {
|
|
1440
4081
|
body?: never;
|
|
1441
4082
|
path: {
|
|
1442
4083
|
/**
|
|
1443
|
-
*
|
|
4084
|
+
* Webhook ID.
|
|
1444
4085
|
*/
|
|
1445
|
-
|
|
4086
|
+
webhook_id: string;
|
|
1446
4087
|
};
|
|
1447
4088
|
query?: never;
|
|
1448
|
-
url: '/
|
|
4089
|
+
url: '/webhooks/{webhook_id}';
|
|
1449
4090
|
};
|
|
1450
|
-
export type
|
|
4091
|
+
export type DisableWebhookErrors = {
|
|
1451
4092
|
/**
|
|
1452
4093
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1453
4094
|
*/
|
|
@@ -1473,37 +4114,29 @@ export type GetConversationErrors = {
|
|
|
1473
4114
|
*/
|
|
1474
4115
|
500: Error;
|
|
1475
4116
|
};
|
|
1476
|
-
export type
|
|
1477
|
-
export type
|
|
4117
|
+
export type DisableWebhookError = DisableWebhookErrors[keyof DisableWebhookErrors];
|
|
4118
|
+
export type DisableWebhookResponses = {
|
|
1478
4119
|
/**
|
|
1479
4120
|
* Success.
|
|
1480
4121
|
*/
|
|
1481
4122
|
200: {
|
|
1482
|
-
data:
|
|
4123
|
+
data: Webhook;
|
|
1483
4124
|
};
|
|
1484
4125
|
};
|
|
1485
|
-
export type
|
|
1486
|
-
export type
|
|
1487
|
-
body
|
|
1488
|
-
headers?: {
|
|
1489
|
-
/**
|
|
1490
|
-
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
1491
|
-
*/
|
|
1492
|
-
'Idempotency-Key'?: string;
|
|
1493
|
-
};
|
|
4126
|
+
export type DisableWebhookResponse = DisableWebhookResponses[keyof DisableWebhookResponses];
|
|
4127
|
+
export type TestWebhookData = {
|
|
4128
|
+
body?: never;
|
|
1494
4129
|
path: {
|
|
1495
4130
|
/**
|
|
1496
|
-
*
|
|
4131
|
+
* Webhook ID.
|
|
1497
4132
|
*/
|
|
1498
|
-
|
|
4133
|
+
webhook_id: string;
|
|
1499
4134
|
};
|
|
1500
4135
|
query?: never;
|
|
1501
|
-
url: '/
|
|
4136
|
+
url: '/webhooks/{webhook_id}/test';
|
|
1502
4137
|
};
|
|
1503
|
-
export type
|
|
4138
|
+
export type TestWebhookErrors = {
|
|
1504
4139
|
/**
|
|
1505
|
-
* `invalid_json`: The body is not valid JSON.
|
|
1506
|
-
*
|
|
1507
4140
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1508
4141
|
*/
|
|
1509
4142
|
400: Error;
|
|
@@ -1519,24 +4152,6 @@ export type AssignConversationErrors = {
|
|
|
1519
4152
|
* `not_found`: The resource does not exist in this organization.
|
|
1520
4153
|
*/
|
|
1521
4154
|
404: Error;
|
|
1522
|
-
/**
|
|
1523
|
-
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1524
|
-
*
|
|
1525
|
-
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1526
|
-
*/
|
|
1527
|
-
409: Error;
|
|
1528
|
-
/**
|
|
1529
|
-
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1530
|
-
*/
|
|
1531
|
-
413: Error;
|
|
1532
|
-
/**
|
|
1533
|
-
* `unsupported_media_type`: The body must be `application/json`.
|
|
1534
|
-
*/
|
|
1535
|
-
415: Error;
|
|
1536
|
-
/**
|
|
1537
|
-
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
1538
|
-
*/
|
|
1539
|
-
422: Error;
|
|
1540
4155
|
/**
|
|
1541
4156
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1542
4157
|
*/
|
|
@@ -1546,34 +4161,28 @@ export type AssignConversationErrors = {
|
|
|
1546
4161
|
*/
|
|
1547
4162
|
500: Error;
|
|
1548
4163
|
};
|
|
1549
|
-
export type
|
|
1550
|
-
export type
|
|
4164
|
+
export type TestWebhookError = TestWebhookErrors[keyof TestWebhookErrors];
|
|
4165
|
+
export type TestWebhookResponses = {
|
|
1551
4166
|
/**
|
|
1552
4167
|
* Success.
|
|
1553
|
-
*/
|
|
1554
|
-
200: {
|
|
1555
|
-
data:
|
|
1556
|
-
};
|
|
1557
|
-
};
|
|
1558
|
-
export type AssignConversationResponse = AssignConversationResponses[keyof AssignConversationResponses];
|
|
1559
|
-
export type CloseConversationData = {
|
|
1560
|
-
body: CloseConversation;
|
|
1561
|
-
headers?: {
|
|
1562
|
-
/**
|
|
1563
|
-
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
1564
|
-
*/
|
|
1565
|
-
'Idempotency-Key'?: string;
|
|
4168
|
+
*/
|
|
4169
|
+
200: {
|
|
4170
|
+
data: WebhookTestResult;
|
|
1566
4171
|
};
|
|
4172
|
+
};
|
|
4173
|
+
export type TestWebhookResponse = TestWebhookResponses[keyof TestWebhookResponses];
|
|
4174
|
+
export type RotateWebhookSecretData = {
|
|
4175
|
+
body: RotateWebhookSecret;
|
|
1567
4176
|
path: {
|
|
1568
4177
|
/**
|
|
1569
|
-
*
|
|
4178
|
+
* Webhook ID.
|
|
1570
4179
|
*/
|
|
1571
|
-
|
|
4180
|
+
webhook_id: string;
|
|
1572
4181
|
};
|
|
1573
4182
|
query?: never;
|
|
1574
|
-
url: '/
|
|
4183
|
+
url: '/webhooks/{webhook_id}/rotate-secret';
|
|
1575
4184
|
};
|
|
1576
|
-
export type
|
|
4185
|
+
export type RotateWebhookSecretErrors = {
|
|
1577
4186
|
/**
|
|
1578
4187
|
* `invalid_json`: The body is not valid JSON.
|
|
1579
4188
|
*
|
|
@@ -1592,12 +4201,6 @@ export type CloseConversationErrors = {
|
|
|
1592
4201
|
* `not_found`: The resource does not exist in this organization.
|
|
1593
4202
|
*/
|
|
1594
4203
|
404: Error;
|
|
1595
|
-
/**
|
|
1596
|
-
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1597
|
-
*
|
|
1598
|
-
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1599
|
-
*/
|
|
1600
|
-
409: Error;
|
|
1601
4204
|
/**
|
|
1602
4205
|
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
1603
4206
|
*/
|
|
@@ -1615,34 +4218,28 @@ export type CloseConversationErrors = {
|
|
|
1615
4218
|
*/
|
|
1616
4219
|
500: Error;
|
|
1617
4220
|
};
|
|
1618
|
-
export type
|
|
1619
|
-
export type
|
|
4221
|
+
export type RotateWebhookSecretError = RotateWebhookSecretErrors[keyof RotateWebhookSecretErrors];
|
|
4222
|
+
export type RotateWebhookSecretResponses = {
|
|
1620
4223
|
/**
|
|
1621
4224
|
* Success.
|
|
1622
4225
|
*/
|
|
1623
4226
|
200: {
|
|
1624
|
-
data:
|
|
4227
|
+
data: CreatedWebhook;
|
|
1625
4228
|
};
|
|
1626
4229
|
};
|
|
1627
|
-
export type
|
|
1628
|
-
export type
|
|
4230
|
+
export type RotateWebhookSecretResponse = RotateWebhookSecretResponses[keyof RotateWebhookSecretResponses];
|
|
4231
|
+
export type ListWebhookDeliveriesData = {
|
|
1629
4232
|
body?: never;
|
|
1630
|
-
headers?: {
|
|
1631
|
-
/**
|
|
1632
|
-
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
1633
|
-
*/
|
|
1634
|
-
'Idempotency-Key'?: string;
|
|
1635
|
-
};
|
|
1636
4233
|
path: {
|
|
1637
4234
|
/**
|
|
1638
|
-
*
|
|
4235
|
+
* Webhook ID.
|
|
1639
4236
|
*/
|
|
1640
|
-
|
|
4237
|
+
webhook_id: string;
|
|
1641
4238
|
};
|
|
1642
4239
|
query?: never;
|
|
1643
|
-
url: '/
|
|
4240
|
+
url: '/webhooks/{webhook_id}/deliveries';
|
|
1644
4241
|
};
|
|
1645
|
-
export type
|
|
4242
|
+
export type ListWebhookDeliveriesErrors = {
|
|
1646
4243
|
/**
|
|
1647
4244
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1648
4245
|
*/
|
|
@@ -1659,12 +4256,6 @@ export type ReopenConversationErrors = {
|
|
|
1659
4256
|
* `not_found`: The resource does not exist in this organization.
|
|
1660
4257
|
*/
|
|
1661
4258
|
404: Error;
|
|
1662
|
-
/**
|
|
1663
|
-
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1664
|
-
*
|
|
1665
|
-
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
1666
|
-
*/
|
|
1667
|
-
409: Error;
|
|
1668
4259
|
/**
|
|
1669
4260
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1670
4261
|
*/
|
|
@@ -1674,33 +4265,36 @@ export type ReopenConversationErrors = {
|
|
|
1674
4265
|
*/
|
|
1675
4266
|
500: Error;
|
|
1676
4267
|
};
|
|
1677
|
-
export type
|
|
1678
|
-
export type
|
|
4268
|
+
export type ListWebhookDeliveriesError = ListWebhookDeliveriesErrors[keyof ListWebhookDeliveriesErrors];
|
|
4269
|
+
export type ListWebhookDeliveriesResponses = {
|
|
1679
4270
|
/**
|
|
1680
4271
|
* Success.
|
|
1681
4272
|
*/
|
|
1682
4273
|
200: {
|
|
1683
|
-
data:
|
|
4274
|
+
data: Array<WebhookDelivery>;
|
|
4275
|
+
/**
|
|
4276
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
4277
|
+
*/
|
|
4278
|
+
next_cursor: string | null;
|
|
1684
4279
|
};
|
|
1685
4280
|
};
|
|
1686
|
-
export type
|
|
1687
|
-
export type
|
|
4281
|
+
export type ListWebhookDeliveriesResponse = ListWebhookDeliveriesResponses[keyof ListWebhookDeliveriesResponses];
|
|
4282
|
+
export type RetryWebhookDeliveryData = {
|
|
1688
4283
|
body?: never;
|
|
1689
4284
|
path: {
|
|
1690
4285
|
/**
|
|
1691
|
-
*
|
|
4286
|
+
* Webhook ID.
|
|
1692
4287
|
*/
|
|
1693
|
-
|
|
1694
|
-
};
|
|
1695
|
-
query?: {
|
|
4288
|
+
webhook_id: string;
|
|
1696
4289
|
/**
|
|
1697
|
-
*
|
|
4290
|
+
* Delivery ID.
|
|
1698
4291
|
*/
|
|
1699
|
-
|
|
4292
|
+
delivery_id: string;
|
|
1700
4293
|
};
|
|
1701
|
-
|
|
4294
|
+
query?: never;
|
|
4295
|
+
url: '/webhooks/{webhook_id}/deliveries/{delivery_id}/retry';
|
|
1702
4296
|
};
|
|
1703
|
-
export type
|
|
4297
|
+
export type RetryWebhookDeliveryErrors = {
|
|
1704
4298
|
/**
|
|
1705
4299
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1706
4300
|
*/
|
|
@@ -1726,38 +4320,67 @@ export type ListMessagesErrors = {
|
|
|
1726
4320
|
*/
|
|
1727
4321
|
500: Error;
|
|
1728
4322
|
};
|
|
1729
|
-
export type
|
|
1730
|
-
export type
|
|
4323
|
+
export type RetryWebhookDeliveryError = RetryWebhookDeliveryErrors[keyof RetryWebhookDeliveryErrors];
|
|
4324
|
+
export type RetryWebhookDeliveryResponses = {
|
|
1731
4325
|
/**
|
|
1732
4326
|
* Success.
|
|
1733
4327
|
*/
|
|
1734
4328
|
200: {
|
|
1735
|
-
data:
|
|
4329
|
+
data: WebhookDelivery;
|
|
4330
|
+
};
|
|
4331
|
+
};
|
|
4332
|
+
export type RetryWebhookDeliveryResponse = RetryWebhookDeliveryResponses[keyof RetryWebhookDeliveryResponses];
|
|
4333
|
+
export type ListWorkflowsData = {
|
|
4334
|
+
body?: never;
|
|
4335
|
+
path?: never;
|
|
4336
|
+
query?: never;
|
|
4337
|
+
url: '/workflows';
|
|
4338
|
+
};
|
|
4339
|
+
export type ListWorkflowsErrors = {
|
|
4340
|
+
/**
|
|
4341
|
+
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
4342
|
+
*/
|
|
4343
|
+
401: Error;
|
|
4344
|
+
/**
|
|
4345
|
+
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
4346
|
+
*/
|
|
4347
|
+
403: Error;
|
|
4348
|
+
/**
|
|
4349
|
+
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
4350
|
+
*/
|
|
4351
|
+
429: Error;
|
|
4352
|
+
/**
|
|
4353
|
+
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
4354
|
+
*/
|
|
4355
|
+
500: Error;
|
|
4356
|
+
};
|
|
4357
|
+
export type ListWorkflowsError = ListWorkflowsErrors[keyof ListWorkflowsErrors];
|
|
4358
|
+
export type ListWorkflowsResponses = {
|
|
4359
|
+
/**
|
|
4360
|
+
* Success.
|
|
4361
|
+
*/
|
|
4362
|
+
200: {
|
|
4363
|
+
data: Array<Workflow>;
|
|
1736
4364
|
/**
|
|
1737
4365
|
* Pass as `cursor` for the next page; null on the last page.
|
|
1738
4366
|
*/
|
|
1739
4367
|
next_cursor: string | null;
|
|
1740
4368
|
};
|
|
1741
4369
|
};
|
|
1742
|
-
export type
|
|
1743
|
-
export type
|
|
1744
|
-
body:
|
|
4370
|
+
export type ListWorkflowsResponse = ListWorkflowsResponses[keyof ListWorkflowsResponses];
|
|
4371
|
+
export type CreateWorkflowData = {
|
|
4372
|
+
body: CreateWorkflow;
|
|
1745
4373
|
headers?: {
|
|
1746
4374
|
/**
|
|
1747
4375
|
* Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as `order-10482-ready`. Retrying with the same key and body replays the first response instead of repeating the write.
|
|
1748
4376
|
*/
|
|
1749
4377
|
'Idempotency-Key'?: string;
|
|
1750
4378
|
};
|
|
1751
|
-
path
|
|
1752
|
-
/**
|
|
1753
|
-
* Conversation ID.
|
|
1754
|
-
*/
|
|
1755
|
-
conversation_id: string;
|
|
1756
|
-
};
|
|
4379
|
+
path?: never;
|
|
1757
4380
|
query?: never;
|
|
1758
|
-
url: '/
|
|
4381
|
+
url: '/workflows';
|
|
1759
4382
|
};
|
|
1760
|
-
export type
|
|
4383
|
+
export type CreateWorkflowErrors = {
|
|
1761
4384
|
/**
|
|
1762
4385
|
* `invalid_json`: The body is not valid JSON.
|
|
1763
4386
|
*
|
|
@@ -1772,10 +4395,6 @@ export type SendMessageErrors = {
|
|
|
1772
4395
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1773
4396
|
*/
|
|
1774
4397
|
403: Error;
|
|
1775
|
-
/**
|
|
1776
|
-
* `not_found`: The resource does not exist in this organization.
|
|
1777
|
-
*/
|
|
1778
|
-
404: Error;
|
|
1779
4398
|
/**
|
|
1780
4399
|
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
1781
4400
|
*
|
|
@@ -1790,12 +4409,6 @@ export type SendMessageErrors = {
|
|
|
1790
4409
|
* `unsupported_media_type`: The body must be `application/json`.
|
|
1791
4410
|
*/
|
|
1792
4411
|
415: Error;
|
|
1793
|
-
/**
|
|
1794
|
-
* `outside_messaging_window`: The channel only allows free-form text inside its reply window; send a template.
|
|
1795
|
-
*
|
|
1796
|
-
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
1797
|
-
*/
|
|
1798
|
-
422: Error;
|
|
1799
4412
|
/**
|
|
1800
4413
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1801
4414
|
*/
|
|
@@ -1804,41 +4417,29 @@ export type SendMessageErrors = {
|
|
|
1804
4417
|
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
1805
4418
|
*/
|
|
1806
4419
|
500: Error;
|
|
1807
|
-
/**
|
|
1808
|
-
* `upstream_error`: The messaging provider failed. Retry later.
|
|
1809
|
-
*/
|
|
1810
|
-
502: Error;
|
|
1811
|
-
/**
|
|
1812
|
-
* `unavailable`: A dependency is temporarily unavailable. Retry later.
|
|
1813
|
-
*/
|
|
1814
|
-
503: Error;
|
|
1815
4420
|
};
|
|
1816
|
-
export type
|
|
1817
|
-
export type
|
|
4421
|
+
export type CreateWorkflowError = CreateWorkflowErrors[keyof CreateWorkflowErrors];
|
|
4422
|
+
export type CreateWorkflowResponses = {
|
|
1818
4423
|
/**
|
|
1819
|
-
*
|
|
4424
|
+
* Success.
|
|
1820
4425
|
*/
|
|
1821
|
-
|
|
1822
|
-
data:
|
|
4426
|
+
201: {
|
|
4427
|
+
data: Workflow;
|
|
1823
4428
|
};
|
|
1824
4429
|
};
|
|
1825
|
-
export type
|
|
1826
|
-
export type
|
|
4430
|
+
export type CreateWorkflowResponse = CreateWorkflowResponses[keyof CreateWorkflowResponses];
|
|
4431
|
+
export type DeleteWorkflowData = {
|
|
1827
4432
|
body?: never;
|
|
1828
4433
|
path: {
|
|
1829
4434
|
/**
|
|
1830
|
-
*
|
|
1831
|
-
*/
|
|
1832
|
-
conversation_id: string;
|
|
1833
|
-
/**
|
|
1834
|
-
* Message ID.
|
|
4435
|
+
* Workflow ID.
|
|
1835
4436
|
*/
|
|
1836
|
-
|
|
4437
|
+
workflow_id: string;
|
|
1837
4438
|
};
|
|
1838
4439
|
query?: never;
|
|
1839
|
-
url: '/
|
|
4440
|
+
url: '/workflows/{workflow_id}';
|
|
1840
4441
|
};
|
|
1841
|
-
export type
|
|
4442
|
+
export type DeleteWorkflowErrors = {
|
|
1842
4443
|
/**
|
|
1843
4444
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1844
4445
|
*/
|
|
@@ -1864,28 +4465,28 @@ export type GetMessageErrors = {
|
|
|
1864
4465
|
*/
|
|
1865
4466
|
500: Error;
|
|
1866
4467
|
};
|
|
1867
|
-
export type
|
|
1868
|
-
export type
|
|
4468
|
+
export type DeleteWorkflowError = DeleteWorkflowErrors[keyof DeleteWorkflowErrors];
|
|
4469
|
+
export type DeleteWorkflowResponses = {
|
|
1869
4470
|
/**
|
|
1870
4471
|
* Success.
|
|
1871
4472
|
*/
|
|
1872
4473
|
200: {
|
|
1873
|
-
data:
|
|
4474
|
+
data: Workflow;
|
|
1874
4475
|
};
|
|
1875
4476
|
};
|
|
1876
|
-
export type
|
|
1877
|
-
export type
|
|
4477
|
+
export type DeleteWorkflowResponse = DeleteWorkflowResponses[keyof DeleteWorkflowResponses];
|
|
4478
|
+
export type GetWorkflowData = {
|
|
1878
4479
|
body?: never;
|
|
1879
4480
|
path: {
|
|
1880
4481
|
/**
|
|
1881
|
-
*
|
|
4482
|
+
* Workflow ID.
|
|
1882
4483
|
*/
|
|
1883
|
-
|
|
4484
|
+
workflow_id: string;
|
|
1884
4485
|
};
|
|
1885
4486
|
query?: never;
|
|
1886
|
-
url: '/
|
|
4487
|
+
url: '/workflows/{workflow_id}';
|
|
1887
4488
|
};
|
|
1888
|
-
export type
|
|
4489
|
+
export type GetWorkflowErrors = {
|
|
1889
4490
|
/**
|
|
1890
4491
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
1891
4492
|
*/
|
|
@@ -1911,23 +4512,40 @@ export type GetSendErrors = {
|
|
|
1911
4512
|
*/
|
|
1912
4513
|
500: Error;
|
|
1913
4514
|
};
|
|
1914
|
-
export type
|
|
1915
|
-
export type
|
|
4515
|
+
export type GetWorkflowError = GetWorkflowErrors[keyof GetWorkflowErrors];
|
|
4516
|
+
export type GetWorkflowResponses = {
|
|
1916
4517
|
/**
|
|
1917
4518
|
* Success.
|
|
1918
4519
|
*/
|
|
1919
4520
|
200: {
|
|
1920
|
-
data:
|
|
4521
|
+
data: Workflow;
|
|
1921
4522
|
};
|
|
1922
4523
|
};
|
|
1923
|
-
export type
|
|
1924
|
-
export type
|
|
1925
|
-
body
|
|
1926
|
-
|
|
4524
|
+
export type GetWorkflowResponse = GetWorkflowResponses[keyof GetWorkflowResponses];
|
|
4525
|
+
export type UpdateWorkflowData = {
|
|
4526
|
+
body: UpdateWorkflow;
|
|
4527
|
+
headers?: {
|
|
4528
|
+
/**
|
|
4529
|
+
* 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.
|
|
4530
|
+
*/
|
|
4531
|
+
'Idempotency-Key'?: string;
|
|
4532
|
+
};
|
|
4533
|
+
path: {
|
|
4534
|
+
/**
|
|
4535
|
+
* Workflow ID.
|
|
4536
|
+
*/
|
|
4537
|
+
workflow_id: string;
|
|
4538
|
+
};
|
|
1927
4539
|
query?: never;
|
|
1928
|
-
url: '/
|
|
4540
|
+
url: '/workflows/{workflow_id}';
|
|
1929
4541
|
};
|
|
1930
|
-
export type
|
|
4542
|
+
export type UpdateWorkflowErrors = {
|
|
4543
|
+
/**
|
|
4544
|
+
* `invalid_json`: The body is not valid JSON.
|
|
4545
|
+
*
|
|
4546
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
4547
|
+
*/
|
|
4548
|
+
400: Error;
|
|
1931
4549
|
/**
|
|
1932
4550
|
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1933
4551
|
*/
|
|
@@ -1936,6 +4554,28 @@ export type ListChannelsErrors = {
|
|
|
1936
4554
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1937
4555
|
*/
|
|
1938
4556
|
403: Error;
|
|
4557
|
+
/**
|
|
4558
|
+
* `not_found`: The resource does not exist in this organization.
|
|
4559
|
+
*/
|
|
4560
|
+
404: Error;
|
|
4561
|
+
/**
|
|
4562
|
+
* `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
|
|
4563
|
+
*
|
|
4564
|
+
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
4565
|
+
*/
|
|
4566
|
+
409: Error;
|
|
4567
|
+
/**
|
|
4568
|
+
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
4569
|
+
*/
|
|
4570
|
+
413: Error;
|
|
4571
|
+
/**
|
|
4572
|
+
* `unsupported_media_type`: The body must be `application/json`.
|
|
4573
|
+
*/
|
|
4574
|
+
415: Error;
|
|
4575
|
+
/**
|
|
4576
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
4577
|
+
*/
|
|
4578
|
+
422: Error;
|
|
1939
4579
|
/**
|
|
1940
4580
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1941
4581
|
*/
|
|
@@ -1945,27 +4585,32 @@ export type ListChannelsErrors = {
|
|
|
1945
4585
|
*/
|
|
1946
4586
|
500: Error;
|
|
1947
4587
|
};
|
|
1948
|
-
export type
|
|
1949
|
-
export type
|
|
4588
|
+
export type UpdateWorkflowError = UpdateWorkflowErrors[keyof UpdateWorkflowErrors];
|
|
4589
|
+
export type UpdateWorkflowResponses = {
|
|
1950
4590
|
/**
|
|
1951
4591
|
* Success.
|
|
1952
4592
|
*/
|
|
1953
4593
|
200: {
|
|
1954
|
-
data:
|
|
1955
|
-
/**
|
|
1956
|
-
* Pass as `cursor` for the next page; null on the last page.
|
|
1957
|
-
*/
|
|
1958
|
-
next_cursor: string | null;
|
|
4594
|
+
data: Workflow;
|
|
1959
4595
|
};
|
|
1960
4596
|
};
|
|
1961
|
-
export type
|
|
1962
|
-
export type
|
|
4597
|
+
export type UpdateWorkflowResponse = UpdateWorkflowResponses[keyof UpdateWorkflowResponses];
|
|
4598
|
+
export type ActivateWorkflowData = {
|
|
1963
4599
|
body?: never;
|
|
1964
|
-
path
|
|
4600
|
+
path: {
|
|
4601
|
+
/**
|
|
4602
|
+
* Workflow ID.
|
|
4603
|
+
*/
|
|
4604
|
+
workflow_id: string;
|
|
4605
|
+
};
|
|
1965
4606
|
query?: never;
|
|
1966
|
-
url: '/
|
|
4607
|
+
url: '/workflows/{workflow_id}/activate';
|
|
1967
4608
|
};
|
|
1968
|
-
export type
|
|
4609
|
+
export type ActivateWorkflowErrors = {
|
|
4610
|
+
/**
|
|
4611
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
4612
|
+
*/
|
|
4613
|
+
400: Error;
|
|
1969
4614
|
/**
|
|
1970
4615
|
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
1971
4616
|
*/
|
|
@@ -1974,6 +4619,14 @@ export type ListMembersErrors = {
|
|
|
1974
4619
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
1975
4620
|
*/
|
|
1976
4621
|
403: Error;
|
|
4622
|
+
/**
|
|
4623
|
+
* `not_found`: The resource does not exist in this organization.
|
|
4624
|
+
*/
|
|
4625
|
+
404: Error;
|
|
4626
|
+
/**
|
|
4627
|
+
* `rule_violation`: The request breaks a business rule; `message` says which.
|
|
4628
|
+
*/
|
|
4629
|
+
422: Error;
|
|
1977
4630
|
/**
|
|
1978
4631
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
1979
4632
|
*/
|
|
@@ -1983,27 +4636,32 @@ export type ListMembersErrors = {
|
|
|
1983
4636
|
*/
|
|
1984
4637
|
500: Error;
|
|
1985
4638
|
};
|
|
1986
|
-
export type
|
|
1987
|
-
export type
|
|
4639
|
+
export type ActivateWorkflowError = ActivateWorkflowErrors[keyof ActivateWorkflowErrors];
|
|
4640
|
+
export type ActivateWorkflowResponses = {
|
|
1988
4641
|
/**
|
|
1989
4642
|
* Success.
|
|
1990
4643
|
*/
|
|
1991
4644
|
200: {
|
|
1992
|
-
data:
|
|
1993
|
-
/**
|
|
1994
|
-
* Pass as `cursor` for the next page; null on the last page.
|
|
1995
|
-
*/
|
|
1996
|
-
next_cursor: string | null;
|
|
4645
|
+
data: Workflow;
|
|
1997
4646
|
};
|
|
1998
4647
|
};
|
|
1999
|
-
export type
|
|
2000
|
-
export type
|
|
4648
|
+
export type ActivateWorkflowResponse = ActivateWorkflowResponses[keyof ActivateWorkflowResponses];
|
|
4649
|
+
export type PauseWorkflowData = {
|
|
2001
4650
|
body?: never;
|
|
2002
|
-
path
|
|
4651
|
+
path: {
|
|
4652
|
+
/**
|
|
4653
|
+
* Workflow ID.
|
|
4654
|
+
*/
|
|
4655
|
+
workflow_id: string;
|
|
4656
|
+
};
|
|
2003
4657
|
query?: never;
|
|
2004
|
-
url: '/
|
|
4658
|
+
url: '/workflows/{workflow_id}/pause';
|
|
2005
4659
|
};
|
|
2006
|
-
export type
|
|
4660
|
+
export type PauseWorkflowErrors = {
|
|
4661
|
+
/**
|
|
4662
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
4663
|
+
*/
|
|
4664
|
+
400: Error;
|
|
2007
4665
|
/**
|
|
2008
4666
|
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2009
4667
|
*/
|
|
@@ -2012,6 +4670,10 @@ export type ListTagsErrors = {
|
|
|
2012
4670
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2013
4671
|
*/
|
|
2014
4672
|
403: Error;
|
|
4673
|
+
/**
|
|
4674
|
+
* `not_found`: The resource does not exist in this organization.
|
|
4675
|
+
*/
|
|
4676
|
+
404: Error;
|
|
2015
4677
|
/**
|
|
2016
4678
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2017
4679
|
*/
|
|
@@ -2021,36 +4683,38 @@ export type ListTagsErrors = {
|
|
|
2021
4683
|
*/
|
|
2022
4684
|
500: Error;
|
|
2023
4685
|
};
|
|
2024
|
-
export type
|
|
2025
|
-
export type
|
|
4686
|
+
export type PauseWorkflowError = PauseWorkflowErrors[keyof PauseWorkflowErrors];
|
|
4687
|
+
export type PauseWorkflowResponses = {
|
|
2026
4688
|
/**
|
|
2027
4689
|
* Success.
|
|
2028
4690
|
*/
|
|
2029
4691
|
200: {
|
|
2030
|
-
data:
|
|
4692
|
+
data: Workflow;
|
|
4693
|
+
};
|
|
4694
|
+
};
|
|
4695
|
+
export type PauseWorkflowResponse = PauseWorkflowResponses[keyof PauseWorkflowResponses];
|
|
4696
|
+
export type ListWorkflowExecutionsData = {
|
|
4697
|
+
body?: never;
|
|
4698
|
+
path: {
|
|
2031
4699
|
/**
|
|
2032
|
-
*
|
|
4700
|
+
* Workflow ID.
|
|
2033
4701
|
*/
|
|
2034
|
-
|
|
4702
|
+
workflow_id: string;
|
|
2035
4703
|
};
|
|
2036
|
-
|
|
2037
|
-
export type ListTagsResponse = ListTagsResponses[keyof ListTagsResponses];
|
|
2038
|
-
export type CreateTagData = {
|
|
2039
|
-
body: CreateTag;
|
|
2040
|
-
headers?: {
|
|
4704
|
+
query?: {
|
|
2041
4705
|
/**
|
|
2042
|
-
*
|
|
4706
|
+
* Items per page.
|
|
2043
4707
|
*/
|
|
2044
|
-
|
|
4708
|
+
page_size?: number;
|
|
4709
|
+
/**
|
|
4710
|
+
* `next_cursor` from the previous page. Use it unchanged.
|
|
4711
|
+
*/
|
|
4712
|
+
cursor?: string;
|
|
2045
4713
|
};
|
|
2046
|
-
|
|
2047
|
-
query?: never;
|
|
2048
|
-
url: '/tags';
|
|
4714
|
+
url: '/workflows/{workflow_id}/executions';
|
|
2049
4715
|
};
|
|
2050
|
-
export type
|
|
4716
|
+
export type ListWorkflowExecutionsErrors = {
|
|
2051
4717
|
/**
|
|
2052
|
-
* `invalid_json`: The body is not valid JSON.
|
|
2053
|
-
*
|
|
2054
4718
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2055
4719
|
*/
|
|
2056
4720
|
400: Error;
|
|
@@ -2063,21 +4727,9 @@ export type CreateTagErrors = {
|
|
|
2063
4727
|
*/
|
|
2064
4728
|
403: Error;
|
|
2065
4729
|
/**
|
|
2066
|
-
* `
|
|
2067
|
-
*
|
|
2068
|
-
* `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
|
|
2069
|
-
*
|
|
2070
|
-
* `conflict`: The resource changed in a way that prevents the operation.
|
|
2071
|
-
*/
|
|
2072
|
-
409: Error;
|
|
2073
|
-
/**
|
|
2074
|
-
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
2075
|
-
*/
|
|
2076
|
-
413: Error;
|
|
2077
|
-
/**
|
|
2078
|
-
* `unsupported_media_type`: The body must be `application/json`.
|
|
4730
|
+
* `not_found`: The resource does not exist in this organization.
|
|
2079
4731
|
*/
|
|
2080
|
-
|
|
4732
|
+
404: Error;
|
|
2081
4733
|
/**
|
|
2082
4734
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2083
4735
|
*/
|
|
@@ -2087,23 +4739,27 @@ export type CreateTagErrors = {
|
|
|
2087
4739
|
*/
|
|
2088
4740
|
500: Error;
|
|
2089
4741
|
};
|
|
2090
|
-
export type
|
|
2091
|
-
export type
|
|
4742
|
+
export type ListWorkflowExecutionsError = ListWorkflowExecutionsErrors[keyof ListWorkflowExecutionsErrors];
|
|
4743
|
+
export type ListWorkflowExecutionsResponses = {
|
|
2092
4744
|
/**
|
|
2093
4745
|
* Success.
|
|
2094
4746
|
*/
|
|
2095
|
-
|
|
2096
|
-
data:
|
|
4747
|
+
200: {
|
|
4748
|
+
data: Array<WorkflowExecution>;
|
|
4749
|
+
/**
|
|
4750
|
+
* Pass as `cursor` for the next page; null on the last page.
|
|
4751
|
+
*/
|
|
4752
|
+
next_cursor: string | null;
|
|
2097
4753
|
};
|
|
2098
4754
|
};
|
|
2099
|
-
export type
|
|
2100
|
-
export type
|
|
4755
|
+
export type ListWorkflowExecutionsResponse = ListWorkflowExecutionsResponses[keyof ListWorkflowExecutionsResponses];
|
|
4756
|
+
export type GetDashboardReportData = {
|
|
2101
4757
|
body?: never;
|
|
2102
4758
|
path?: never;
|
|
2103
4759
|
query?: never;
|
|
2104
|
-
url: '/
|
|
4760
|
+
url: '/reports/dashboard';
|
|
2105
4761
|
};
|
|
2106
|
-
export type
|
|
4762
|
+
export type GetDashboardReportErrors = {
|
|
2107
4763
|
/**
|
|
2108
4764
|
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2109
4765
|
*/
|
|
@@ -2120,32 +4776,41 @@ export type ListTemplatesErrors = {
|
|
|
2120
4776
|
* `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
|
|
2121
4777
|
*/
|
|
2122
4778
|
500: Error;
|
|
2123
|
-
/**
|
|
2124
|
-
* `upstream_error`: The messaging provider failed. Retry later.
|
|
2125
|
-
*/
|
|
2126
|
-
502: Error;
|
|
2127
4779
|
};
|
|
2128
|
-
export type
|
|
2129
|
-
export type
|
|
4780
|
+
export type GetDashboardReportError = GetDashboardReportErrors[keyof GetDashboardReportErrors];
|
|
4781
|
+
export type GetDashboardReportResponses = {
|
|
2130
4782
|
/**
|
|
2131
4783
|
* Success.
|
|
2132
4784
|
*/
|
|
2133
4785
|
200: {
|
|
2134
|
-
data:
|
|
2135
|
-
/**
|
|
2136
|
-
* Pass as `cursor` for the next page; null on the last page.
|
|
2137
|
-
*/
|
|
2138
|
-
next_cursor: string | null;
|
|
4786
|
+
data: DashboardReport;
|
|
2139
4787
|
};
|
|
2140
4788
|
};
|
|
2141
|
-
export type
|
|
2142
|
-
export type
|
|
4789
|
+
export type GetDashboardReportResponse = GetDashboardReportResponses[keyof GetDashboardReportResponses];
|
|
4790
|
+
export type GetConversationsReportData = {
|
|
2143
4791
|
body?: never;
|
|
2144
4792
|
path?: never;
|
|
2145
|
-
query?:
|
|
2146
|
-
|
|
4793
|
+
query?: {
|
|
4794
|
+
/**
|
|
4795
|
+
* First day, `YYYY-MM-DD`, America/Panama, inclusive. Send it with `to`; without both, the report covers the last 7 days including today.
|
|
4796
|
+
*/
|
|
4797
|
+
from?: string;
|
|
4798
|
+
/**
|
|
4799
|
+
* Last day, `YYYY-MM-DD`, America/Panama, inclusive. A day after today counts as today. The period is at most 366 days.
|
|
4800
|
+
*/
|
|
4801
|
+
to?: string;
|
|
4802
|
+
/**
|
|
4803
|
+
* Only this channel.
|
|
4804
|
+
*/
|
|
4805
|
+
channel?: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
4806
|
+
};
|
|
4807
|
+
url: '/reports/conversations';
|
|
2147
4808
|
};
|
|
2148
|
-
export type
|
|
4809
|
+
export type GetConversationsReportErrors = {
|
|
4810
|
+
/**
|
|
4811
|
+
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
4812
|
+
*/
|
|
4813
|
+
400: Error;
|
|
2149
4814
|
/**
|
|
2150
4815
|
* `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
|
|
2151
4816
|
*/
|
|
@@ -2163,30 +4828,37 @@ export type ListWebhooksErrors = {
|
|
|
2163
4828
|
*/
|
|
2164
4829
|
500: Error;
|
|
2165
4830
|
};
|
|
2166
|
-
export type
|
|
2167
|
-
export type
|
|
4831
|
+
export type GetConversationsReportError = GetConversationsReportErrors[keyof GetConversationsReportErrors];
|
|
4832
|
+
export type GetConversationsReportResponses = {
|
|
2168
4833
|
/**
|
|
2169
4834
|
* Success.
|
|
2170
4835
|
*/
|
|
2171
4836
|
200: {
|
|
2172
|
-
data:
|
|
2173
|
-
/**
|
|
2174
|
-
* Pass as `cursor` for the next page; null on the last page.
|
|
2175
|
-
*/
|
|
2176
|
-
next_cursor: string | null;
|
|
4837
|
+
data: ConversationsReport;
|
|
2177
4838
|
};
|
|
2178
4839
|
};
|
|
2179
|
-
export type
|
|
2180
|
-
export type
|
|
2181
|
-
body
|
|
4840
|
+
export type GetConversationsReportResponse = GetConversationsReportResponses[keyof GetConversationsReportResponses];
|
|
4841
|
+
export type GetMessagesReportData = {
|
|
4842
|
+
body?: never;
|
|
2182
4843
|
path?: never;
|
|
2183
|
-
query?:
|
|
2184
|
-
|
|
4844
|
+
query?: {
|
|
4845
|
+
/**
|
|
4846
|
+
* First day, `YYYY-MM-DD`, America/Panama, inclusive. Send it with `to`; without both, the report covers the last 7 days including today.
|
|
4847
|
+
*/
|
|
4848
|
+
from?: string;
|
|
4849
|
+
/**
|
|
4850
|
+
* Last day, `YYYY-MM-DD`, America/Panama, inclusive. A day after today counts as today. The period is at most 366 days.
|
|
4851
|
+
*/
|
|
4852
|
+
to?: string;
|
|
4853
|
+
/**
|
|
4854
|
+
* Only this channel.
|
|
4855
|
+
*/
|
|
4856
|
+
channel?: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
4857
|
+
};
|
|
4858
|
+
url: '/reports/messages';
|
|
2185
4859
|
};
|
|
2186
|
-
export type
|
|
4860
|
+
export type GetMessagesReportErrors = {
|
|
2187
4861
|
/**
|
|
2188
|
-
* `invalid_json`: The body is not valid JSON.
|
|
2189
|
-
*
|
|
2190
4862
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2191
4863
|
*/
|
|
2192
4864
|
400: Error;
|
|
@@ -2198,14 +4870,6 @@ export type CreateWebhookErrors = {
|
|
|
2198
4870
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2199
4871
|
*/
|
|
2200
4872
|
403: Error;
|
|
2201
|
-
/**
|
|
2202
|
-
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
2203
|
-
*/
|
|
2204
|
-
413: Error;
|
|
2205
|
-
/**
|
|
2206
|
-
* `unsupported_media_type`: The body must be `application/json`.
|
|
2207
|
-
*/
|
|
2208
|
-
415: Error;
|
|
2209
4873
|
/**
|
|
2210
4874
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2211
4875
|
*/
|
|
@@ -2215,28 +4879,40 @@ export type CreateWebhookErrors = {
|
|
|
2215
4879
|
*/
|
|
2216
4880
|
500: Error;
|
|
2217
4881
|
};
|
|
2218
|
-
export type
|
|
2219
|
-
export type
|
|
4882
|
+
export type GetMessagesReportError = GetMessagesReportErrors[keyof GetMessagesReportErrors];
|
|
4883
|
+
export type GetMessagesReportResponses = {
|
|
2220
4884
|
/**
|
|
2221
4885
|
* Success.
|
|
2222
4886
|
*/
|
|
2223
|
-
|
|
2224
|
-
data:
|
|
4887
|
+
200: {
|
|
4888
|
+
data: MessagesReport;
|
|
2225
4889
|
};
|
|
2226
4890
|
};
|
|
2227
|
-
export type
|
|
2228
|
-
export type
|
|
4891
|
+
export type GetMessagesReportResponse = GetMessagesReportResponses[keyof GetMessagesReportResponses];
|
|
4892
|
+
export type GetResponsesReportData = {
|
|
2229
4893
|
body?: never;
|
|
2230
|
-
path
|
|
4894
|
+
path?: never;
|
|
4895
|
+
query?: {
|
|
2231
4896
|
/**
|
|
2232
|
-
*
|
|
4897
|
+
* First day, `YYYY-MM-DD`, America/Panama, inclusive. Send it with `to`; without both, the report covers the last 7 days including today.
|
|
2233
4898
|
*/
|
|
2234
|
-
|
|
4899
|
+
from?: string;
|
|
4900
|
+
/**
|
|
4901
|
+
* Last day, `YYYY-MM-DD`, America/Panama, inclusive. A day after today counts as today. The period is at most 366 days.
|
|
4902
|
+
*/
|
|
4903
|
+
to?: string;
|
|
4904
|
+
/**
|
|
4905
|
+
* Only this channel.
|
|
4906
|
+
*/
|
|
4907
|
+
channel?: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
4908
|
+
/**
|
|
4909
|
+
* Only responses from people, in Ricky or in the channel's own app (`humans`), from AI agents (`agents`), or from one member or AI agent by ID.
|
|
4910
|
+
*/
|
|
4911
|
+
responder?: 'all' | 'humans' | 'agents' | string;
|
|
2235
4912
|
};
|
|
2236
|
-
|
|
2237
|
-
url: '/webhooks/{webhook_id}';
|
|
4913
|
+
url: '/reports/responses';
|
|
2238
4914
|
};
|
|
2239
|
-
export type
|
|
4915
|
+
export type GetResponsesReportErrors = {
|
|
2240
4916
|
/**
|
|
2241
4917
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2242
4918
|
*/
|
|
@@ -2249,10 +4925,6 @@ export type DisableWebhookErrors = {
|
|
|
2249
4925
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2250
4926
|
*/
|
|
2251
4927
|
403: Error;
|
|
2252
|
-
/**
|
|
2253
|
-
* `not_found`: The resource does not exist in this organization.
|
|
2254
|
-
*/
|
|
2255
|
-
404: Error;
|
|
2256
4928
|
/**
|
|
2257
4929
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2258
4930
|
*/
|
|
@@ -2262,28 +4934,36 @@ export type DisableWebhookErrors = {
|
|
|
2262
4934
|
*/
|
|
2263
4935
|
500: Error;
|
|
2264
4936
|
};
|
|
2265
|
-
export type
|
|
2266
|
-
export type
|
|
4937
|
+
export type GetResponsesReportError = GetResponsesReportErrors[keyof GetResponsesReportErrors];
|
|
4938
|
+
export type GetResponsesReportResponses = {
|
|
2267
4939
|
/**
|
|
2268
4940
|
* Success.
|
|
2269
4941
|
*/
|
|
2270
4942
|
200: {
|
|
2271
|
-
data:
|
|
4943
|
+
data: ResponsesReport;
|
|
2272
4944
|
};
|
|
2273
4945
|
};
|
|
2274
|
-
export type
|
|
2275
|
-
export type
|
|
4946
|
+
export type GetResponsesReportResponse = GetResponsesReportResponses[keyof GetResponsesReportResponses];
|
|
4947
|
+
export type GetResolutionsReportData = {
|
|
2276
4948
|
body?: never;
|
|
2277
|
-
path
|
|
4949
|
+
path?: never;
|
|
4950
|
+
query?: {
|
|
2278
4951
|
/**
|
|
2279
|
-
*
|
|
4952
|
+
* First day, `YYYY-MM-DD`, America/Panama, inclusive. Send it with `to`; without both, the report covers the last 7 days including today.
|
|
2280
4953
|
*/
|
|
2281
|
-
|
|
4954
|
+
from?: string;
|
|
4955
|
+
/**
|
|
4956
|
+
* Last day, `YYYY-MM-DD`, America/Panama, inclusive. A day after today counts as today. The period is at most 366 days.
|
|
4957
|
+
*/
|
|
4958
|
+
to?: string;
|
|
4959
|
+
/**
|
|
4960
|
+
* Only this channel.
|
|
4961
|
+
*/
|
|
4962
|
+
channel?: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
2282
4963
|
};
|
|
2283
|
-
|
|
2284
|
-
url: '/webhooks/{webhook_id}/test';
|
|
4964
|
+
url: '/reports/resolutions';
|
|
2285
4965
|
};
|
|
2286
|
-
export type
|
|
4966
|
+
export type GetResolutionsReportErrors = {
|
|
2287
4967
|
/**
|
|
2288
4968
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2289
4969
|
*/
|
|
@@ -2296,10 +4976,6 @@ export type TestWebhookErrors = {
|
|
|
2296
4976
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2297
4977
|
*/
|
|
2298
4978
|
403: Error;
|
|
2299
|
-
/**
|
|
2300
|
-
* `not_found`: The resource does not exist in this organization.
|
|
2301
|
-
*/
|
|
2302
|
-
404: Error;
|
|
2303
4979
|
/**
|
|
2304
4980
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2305
4981
|
*/
|
|
@@ -2309,31 +4985,37 @@ export type TestWebhookErrors = {
|
|
|
2309
4985
|
*/
|
|
2310
4986
|
500: Error;
|
|
2311
4987
|
};
|
|
2312
|
-
export type
|
|
2313
|
-
export type
|
|
4988
|
+
export type GetResolutionsReportError = GetResolutionsReportErrors[keyof GetResolutionsReportErrors];
|
|
4989
|
+
export type GetResolutionsReportResponses = {
|
|
2314
4990
|
/**
|
|
2315
4991
|
* Success.
|
|
2316
4992
|
*/
|
|
2317
4993
|
200: {
|
|
2318
|
-
data:
|
|
4994
|
+
data: ResolutionsReport;
|
|
2319
4995
|
};
|
|
2320
4996
|
};
|
|
2321
|
-
export type
|
|
2322
|
-
export type
|
|
2323
|
-
body
|
|
2324
|
-
path
|
|
4997
|
+
export type GetResolutionsReportResponse = GetResolutionsReportResponses[keyof GetResolutionsReportResponses];
|
|
4998
|
+
export type GetTeamReportData = {
|
|
4999
|
+
body?: never;
|
|
5000
|
+
path?: never;
|
|
5001
|
+
query?: {
|
|
2325
5002
|
/**
|
|
2326
|
-
*
|
|
5003
|
+
* First day, `YYYY-MM-DD`, America/Panama, inclusive. Send it with `to`; without both, the report covers the last 7 days including today.
|
|
2327
5004
|
*/
|
|
2328
|
-
|
|
5005
|
+
from?: string;
|
|
5006
|
+
/**
|
|
5007
|
+
* Last day, `YYYY-MM-DD`, America/Panama, inclusive. A day after today counts as today. The period is at most 366 days.
|
|
5008
|
+
*/
|
|
5009
|
+
to?: string;
|
|
5010
|
+
/**
|
|
5011
|
+
* Only this channel.
|
|
5012
|
+
*/
|
|
5013
|
+
channel?: 'all' | 'whatsapp' | 'instagram' | 'messenger';
|
|
2329
5014
|
};
|
|
2330
|
-
|
|
2331
|
-
url: '/webhooks/{webhook_id}/rotate-secret';
|
|
5015
|
+
url: '/reports/team';
|
|
2332
5016
|
};
|
|
2333
|
-
export type
|
|
5017
|
+
export type GetTeamReportErrors = {
|
|
2334
5018
|
/**
|
|
2335
|
-
* `invalid_json`: The body is not valid JSON.
|
|
2336
|
-
*
|
|
2337
5019
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2338
5020
|
*/
|
|
2339
5021
|
400: Error;
|
|
@@ -2345,18 +5027,6 @@ export type RotateWebhookSecretErrors = {
|
|
|
2345
5027
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2346
5028
|
*/
|
|
2347
5029
|
403: Error;
|
|
2348
|
-
/**
|
|
2349
|
-
* `not_found`: The resource does not exist in this organization.
|
|
2350
|
-
*/
|
|
2351
|
-
404: Error;
|
|
2352
|
-
/**
|
|
2353
|
-
* `body_too_large`: The JSON body exceeds 64 KiB.
|
|
2354
|
-
*/
|
|
2355
|
-
413: Error;
|
|
2356
|
-
/**
|
|
2357
|
-
* `unsupported_media_type`: The body must be `application/json`.
|
|
2358
|
-
*/
|
|
2359
|
-
415: Error;
|
|
2360
5030
|
/**
|
|
2361
5031
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2362
5032
|
*/
|
|
@@ -2366,28 +5036,32 @@ export type RotateWebhookSecretErrors = {
|
|
|
2366
5036
|
*/
|
|
2367
5037
|
500: Error;
|
|
2368
5038
|
};
|
|
2369
|
-
export type
|
|
2370
|
-
export type
|
|
5039
|
+
export type GetTeamReportError = GetTeamReportErrors[keyof GetTeamReportErrors];
|
|
5040
|
+
export type GetTeamReportResponses = {
|
|
2371
5041
|
/**
|
|
2372
5042
|
* Success.
|
|
2373
5043
|
*/
|
|
2374
5044
|
200: {
|
|
2375
|
-
data:
|
|
5045
|
+
data: TeamReport;
|
|
2376
5046
|
};
|
|
2377
5047
|
};
|
|
2378
|
-
export type
|
|
2379
|
-
export type
|
|
5048
|
+
export type GetTeamReportResponse = GetTeamReportResponses[keyof GetTeamReportResponses];
|
|
5049
|
+
export type GetBroadcastsReportData = {
|
|
2380
5050
|
body?: never;
|
|
2381
|
-
path
|
|
5051
|
+
path?: never;
|
|
5052
|
+
query?: {
|
|
2382
5053
|
/**
|
|
2383
|
-
*
|
|
5054
|
+
* First day, `YYYY-MM-DD`, America/Panama, inclusive. Send it with `to`; without both, the report covers the last 7 days including today.
|
|
2384
5055
|
*/
|
|
2385
|
-
|
|
5056
|
+
from?: string;
|
|
5057
|
+
/**
|
|
5058
|
+
* Last day, `YYYY-MM-DD`, America/Panama, inclusive. A day after today counts as today. The period is at most 366 days.
|
|
5059
|
+
*/
|
|
5060
|
+
to?: string;
|
|
2386
5061
|
};
|
|
2387
|
-
|
|
2388
|
-
url: '/webhooks/{webhook_id}/deliveries';
|
|
5062
|
+
url: '/reports/broadcasts';
|
|
2389
5063
|
};
|
|
2390
|
-
export type
|
|
5064
|
+
export type GetBroadcastsReportErrors = {
|
|
2391
5065
|
/**
|
|
2392
5066
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2393
5067
|
*/
|
|
@@ -2400,10 +5074,6 @@ export type ListWebhookDeliveriesErrors = {
|
|
|
2400
5074
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2401
5075
|
*/
|
|
2402
5076
|
403: Error;
|
|
2403
|
-
/**
|
|
2404
|
-
* `not_found`: The resource does not exist in this organization.
|
|
2405
|
-
*/
|
|
2406
|
-
404: Error;
|
|
2407
5077
|
/**
|
|
2408
5078
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2409
5079
|
*/
|
|
@@ -2413,36 +5083,32 @@ export type ListWebhookDeliveriesErrors = {
|
|
|
2413
5083
|
*/
|
|
2414
5084
|
500: Error;
|
|
2415
5085
|
};
|
|
2416
|
-
export type
|
|
2417
|
-
export type
|
|
5086
|
+
export type GetBroadcastsReportError = GetBroadcastsReportErrors[keyof GetBroadcastsReportErrors];
|
|
5087
|
+
export type GetBroadcastsReportResponses = {
|
|
2418
5088
|
/**
|
|
2419
5089
|
* Success.
|
|
2420
5090
|
*/
|
|
2421
5091
|
200: {
|
|
2422
|
-
data:
|
|
2423
|
-
/**
|
|
2424
|
-
* Pass as `cursor` for the next page; null on the last page.
|
|
2425
|
-
*/
|
|
2426
|
-
next_cursor: string | null;
|
|
5092
|
+
data: BroadcastsReport;
|
|
2427
5093
|
};
|
|
2428
5094
|
};
|
|
2429
|
-
export type
|
|
2430
|
-
export type
|
|
5095
|
+
export type GetBroadcastsReportResponse = GetBroadcastsReportResponses[keyof GetBroadcastsReportResponses];
|
|
5096
|
+
export type GetAdsReportData = {
|
|
2431
5097
|
body?: never;
|
|
2432
|
-
path
|
|
5098
|
+
path?: never;
|
|
5099
|
+
query?: {
|
|
2433
5100
|
/**
|
|
2434
|
-
*
|
|
5101
|
+
* First day, `YYYY-MM-DD`, America/Panama, inclusive. Send it with `to`; without both, the report covers the last 7 days including today.
|
|
2435
5102
|
*/
|
|
2436
|
-
|
|
5103
|
+
from?: string;
|
|
2437
5104
|
/**
|
|
2438
|
-
*
|
|
5105
|
+
* Last day, `YYYY-MM-DD`, America/Panama, inclusive. A day after today counts as today. The period is at most 366 days.
|
|
2439
5106
|
*/
|
|
2440
|
-
|
|
5107
|
+
to?: string;
|
|
2441
5108
|
};
|
|
2442
|
-
|
|
2443
|
-
url: '/webhooks/{webhook_id}/deliveries/{delivery_id}/retry';
|
|
5109
|
+
url: '/reports/ads';
|
|
2444
5110
|
};
|
|
2445
|
-
export type
|
|
5111
|
+
export type GetAdsReportErrors = {
|
|
2446
5112
|
/**
|
|
2447
5113
|
* `invalid_input`: A parameter or body field is invalid; `param` names it when known.
|
|
2448
5114
|
*/
|
|
@@ -2455,10 +5121,6 @@ export type RetryWebhookDeliveryErrors = {
|
|
|
2455
5121
|
* `insufficient_scope`: The key lacks the scope this operation requires.
|
|
2456
5122
|
*/
|
|
2457
5123
|
403: Error;
|
|
2458
|
-
/**
|
|
2459
|
-
* `not_found`: The resource does not exist in this organization.
|
|
2460
|
-
*/
|
|
2461
|
-
404: Error;
|
|
2462
5124
|
/**
|
|
2463
5125
|
* `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
|
|
2464
5126
|
*/
|
|
@@ -2468,16 +5130,16 @@ export type RetryWebhookDeliveryErrors = {
|
|
|
2468
5130
|
*/
|
|
2469
5131
|
500: Error;
|
|
2470
5132
|
};
|
|
2471
|
-
export type
|
|
2472
|
-
export type
|
|
5133
|
+
export type GetAdsReportError = GetAdsReportErrors[keyof GetAdsReportErrors];
|
|
5134
|
+
export type GetAdsReportResponses = {
|
|
2473
5135
|
/**
|
|
2474
5136
|
* Success.
|
|
2475
5137
|
*/
|
|
2476
5138
|
200: {
|
|
2477
|
-
data:
|
|
5139
|
+
data: AdsReport;
|
|
2478
5140
|
};
|
|
2479
5141
|
};
|
|
2480
|
-
export type
|
|
5142
|
+
export type GetAdsReportResponse = GetAdsReportResponses[keyof GetAdsReportResponses];
|
|
2481
5143
|
export type WebhookMessageReceivedWebhookPayload = WebhookEvent;
|
|
2482
5144
|
export type WebhookMessageReceivedWebhookRequest = {
|
|
2483
5145
|
body: WebhookMessageReceivedWebhookPayload;
|