getricky 0.1.8 → 0.1.10

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.
@@ -1,7 +1,7 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: 'https://getricky.ai/api/v1' | (string & {});
3
3
  };
4
- export type Webhooks = WebhookMessageReceivedWebhookRequest | WebhookMessageSentWebhookRequest | WebhookMessageDeliveredWebhookRequest | WebhookMessageReadWebhookRequest | WebhookMessageFailedWebhookRequest | WebhookConversationOpenedWebhookRequest | WebhookConversationClosedWebhookRequest | WebhookConversationAssignmentChangedWebhookRequest | WebhookContactCreatedWebhookRequest | WebhookContactUpdatedWebhookRequest | WebhookWebhookTestWebhookRequest;
4
+ export type Webhooks = WebhookMessageReceivedWebhookRequest | WebhookMessageSentWebhookRequest | WebhookMessageDeliveredWebhookRequest | WebhookMessageReadWebhookRequest | WebhookMessageFailedWebhookRequest | WebhookConversationOpenedWebhookRequest | WebhookConversationClosedWebhookRequest | WebhookConversationAssignmentChangedWebhookRequest | WebhookConversationAgentChangedWebhookRequest | WebhookConversationHandoffRequestedWebhookRequest | WebhookConversationHandoffResolvedWebhookRequest | WebhookContactCreatedWebhookRequest | WebhookContactUpdatedWebhookRequest | WebhookContactTagsChangedWebhookRequest | WebhookBroadcastCompletedWebhookRequest | WebhookBroadcastFailedWebhookRequest | WebhookTemplateStatusChangedWebhookRequest | WebhookWorkflowExecutionFailedWebhookRequest | WebhookKnowledgeFileReadyWebhookRequest | WebhookWebhookTestWebhookRequest;
5
5
  /**
6
6
  * Every non-2xx response.
7
7
  */
@@ -330,6 +330,36 @@ export type Channel = {
330
330
  */
331
331
  connected_at: string | null;
332
332
  };
333
+ /**
334
+ * A request for a person to take over from the AI agent, not resolved yet.
335
+ */
336
+ export type ConversationHandoff = {
337
+ /**
338
+ * Handoff ID.
339
+ */
340
+ id: string;
341
+ /**
342
+ * `requested` until a member takes it; `assigned` once someone is responsible.
343
+ */
344
+ status: 'requested' | 'assigned';
345
+ /**
346
+ * Whether the AI agent or a member asked for it.
347
+ */
348
+ requested_by: 'agent' | 'operator';
349
+ /**
350
+ * Why the conversation needs a person.
351
+ */
352
+ reason: 'customer_requested' | 'low_confidence' | 'manual_takeover' | 'out_of_scope' | 'sensitive' | 'other';
353
+ /**
354
+ * What the person taking over needs to know.
355
+ */
356
+ summary: string;
357
+ assigned_user_id: string | null;
358
+ /**
359
+ * When it was requested.
360
+ */
361
+ requested_at: string;
362
+ };
333
363
  /**
334
364
  * One contact talking to the organization on one channel.
335
365
  */
@@ -387,6 +417,14 @@ export type Conversation = {
387
417
  * Text of the latest message.
388
418
  */
389
419
  last_activity_preview: string | null;
420
+ /**
421
+ * Whether it has messages the team has not read.
422
+ */
423
+ unread: boolean;
424
+ /**
425
+ * The handoff to a person waiting to be resolved; null when there is none.
426
+ */
427
+ active_handoff: ConversationHandoff | null;
390
428
  };
391
429
  /**
392
430
  * One message in a conversation.
@@ -696,6 +734,203 @@ export type BroadcastRecipient = {
696
734
  */
697
735
  status_updated_at: string | null;
698
736
  };
737
+ /**
738
+ * A branch or place the agents can send as a WhatsApp location.
739
+ */
740
+ export type KnowledgeLocation = {
741
+ /**
742
+ * Location ID.
743
+ */
744
+ id: string;
745
+ /**
746
+ * Name customers know it by.
747
+ */
748
+ name: string;
749
+ /**
750
+ * Full address as customers read it.
751
+ */
752
+ address: string;
753
+ /**
754
+ * Latitude of the map pin.
755
+ */
756
+ latitude: number;
757
+ /**
758
+ * Longitude of the map pin.
759
+ */
760
+ longitude: number;
761
+ /**
762
+ * Street.
763
+ */
764
+ street: string | null;
765
+ /**
766
+ * City.
767
+ */
768
+ city: string | null;
769
+ /**
770
+ * State, province or region.
771
+ */
772
+ state: string | null;
773
+ /**
774
+ * Postal code.
775
+ */
776
+ postal_code: string | null;
777
+ /**
778
+ * Country.
779
+ */
780
+ country: string | null;
781
+ /**
782
+ * Country code, ISO 3166-1 alpha-2.
783
+ */
784
+ country_code: string | null;
785
+ /**
786
+ * Phone in E.164.
787
+ */
788
+ phone: string | null;
789
+ /**
790
+ * Email.
791
+ */
792
+ email: string | null;
793
+ /**
794
+ * Opening hours, as free text.
795
+ */
796
+ hours: string | null;
797
+ };
798
+ /**
799
+ * A contact card in the knowledge directory, which agents can send to customers.
800
+ */
801
+ export type KnowledgeContact = {
802
+ /**
803
+ * Knowledge contact ID.
804
+ */
805
+ id: string;
806
+ /**
807
+ * Name shown on the contact card.
808
+ */
809
+ display_name: string;
810
+ /**
811
+ * First name.
812
+ */
813
+ first_name: string | null;
814
+ /**
815
+ * Last name.
816
+ */
817
+ last_name: string | null;
818
+ /**
819
+ * Name prefix, such as `Dr.`.
820
+ */
821
+ prefix: string | null;
822
+ /**
823
+ * Name suffix.
824
+ */
825
+ suffix: string | null;
826
+ /**
827
+ * Company.
828
+ */
829
+ company: string | null;
830
+ /**
831
+ * Department.
832
+ */
833
+ department: string | null;
834
+ /**
835
+ * Job title.
836
+ */
837
+ job_title: string | null;
838
+ /**
839
+ * When the agents should share it.
840
+ */
841
+ description: string | null;
842
+ /**
843
+ * Phone in E.164.
844
+ */
845
+ phone: string | null;
846
+ /**
847
+ * `CELL`, `WORK` or `HOME`.
848
+ */
849
+ phone_type: string | null;
850
+ /**
851
+ * Email.
852
+ */
853
+ email: string | null;
854
+ /**
855
+ * `WORK` or `PERSONAL`.
856
+ */
857
+ email_type: string | null;
858
+ };
859
+ /**
860
+ * A document or image the agents can consult or send.
861
+ */
862
+ export type KnowledgeFile = {
863
+ /**
864
+ * File ID.
865
+ */
866
+ id: string;
867
+ /**
868
+ * Title the agents see.
869
+ */
870
+ title: string;
871
+ /**
872
+ * When the agents should use it; may be empty.
873
+ */
874
+ description: string;
875
+ /**
876
+ * Original file name.
877
+ */
878
+ filename: string;
879
+ /**
880
+ * File type.
881
+ */
882
+ mime_type: 'application/pdf' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'image/jpeg' | 'image/png';
883
+ /**
884
+ * Size in bytes.
885
+ */
886
+ size_bytes: number;
887
+ /**
888
+ * `uploading` until `POST /knowledge/files/{file_id}/complete` reads it; then `ready`.
889
+ */
890
+ status: 'uploading' | 'ready' | 'failed';
891
+ /**
892
+ * Agents may read it to answer.
893
+ */
894
+ consult_enabled: boolean;
895
+ /**
896
+ * Agents may send the file itself to customers.
897
+ */
898
+ send_enabled: boolean;
899
+ /**
900
+ * Pages of a PDF; null otherwise.
901
+ */
902
+ page_count: number | null;
903
+ /**
904
+ * Start of the text Ricky read from it.
905
+ */
906
+ preview: string | null;
907
+ /**
908
+ * Why Ricky could not read useful content; null when it could.
909
+ */
910
+ extraction_error: string | null;
911
+ /**
912
+ * Signed download URL, valid for five minutes. Only `GET /knowledge/files/{file_id}` of a `ready` file carries it; null elsewhere.
913
+ */
914
+ download_url: string | null;
915
+ /**
916
+ * When the upload began.
917
+ */
918
+ created_at: string;
919
+ /**
920
+ * Last change.
921
+ */
922
+ updated_at: string;
923
+ };
924
+ /**
925
+ * A file waiting for its bytes, and where to put them.
926
+ */
927
+ export type KnowledgeFileUpload = {
928
+ file: KnowledgeFile;
929
+ /**
930
+ * Signed URL valid for two hours. `PUT` the file bytes to it with `Content-Type` set to `mime_type`, then call `POST /knowledge/files/{file_id}/complete`.
931
+ */
932
+ upload_url: string;
933
+ };
699
934
  /**
700
935
  * A webhook subscription.
701
936
  */
@@ -708,7 +943,7 @@ export type Webhook = {
708
943
  * HTTPS endpoint Ricky posts to.
709
944
  */
710
945
  url: string;
711
- event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated'>;
946
+ event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'conversation.agent_changed' | 'conversation.handoff_requested' | 'conversation.handoff_resolved' | 'contact.created' | 'contact.updated' | 'contact.tags_changed' | 'broadcast.completed' | 'broadcast.failed' | 'template.status_changed' | 'workflow.execution_failed' | 'knowledge_file.ready'>;
712
947
  status: 'active' | 'disabled';
713
948
  /**
714
949
  * When it was created.
@@ -731,7 +966,7 @@ export type CreatedWebhook = {
731
966
  * HTTPS endpoint Ricky posts to.
732
967
  */
733
968
  url: string;
734
- event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated'>;
969
+ event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'conversation.agent_changed' | 'conversation.handoff_requested' | 'conversation.handoff_resolved' | 'contact.created' | 'contact.updated' | 'contact.tags_changed' | 'broadcast.completed' | 'broadcast.failed' | 'template.status_changed' | 'workflow.execution_failed' | 'knowledge_file.ready'>;
735
970
  status: 'active' | 'disabled';
736
971
  /**
737
972
  * When it was created.
@@ -754,7 +989,7 @@ export type WebhookDelivery = {
754
989
  * Delivery ID; equals the event `id` and `X-Ricky-Delivery-Id`.
755
990
  */
756
991
  id: string;
757
- event_type: 'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated';
992
+ event_type: 'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'conversation.agent_changed' | 'conversation.handoff_requested' | 'conversation.handoff_resolved' | 'contact.created' | 'contact.updated' | 'contact.tags_changed' | 'broadcast.completed' | 'broadcast.failed' | 'template.status_changed' | 'workflow.execution_failed' | 'knowledge_file.ready';
758
993
  status: 'pending' | 'processing' | 'delivered' | 'failed';
759
994
  /**
760
995
  * Delivery attempts so far; Ricky makes at most ten.
@@ -789,7 +1024,7 @@ export type WebhookEvent = {
789
1024
  * Delivery ID. Deduplicate by it.
790
1025
  */
791
1026
  id: string;
792
- type: 'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated' | 'webhook.test';
1027
+ type: 'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'conversation.agent_changed' | 'conversation.handoff_requested' | 'conversation.handoff_resolved' | 'contact.created' | 'contact.updated' | 'contact.tags_changed' | 'broadcast.completed' | 'broadcast.failed' | 'template.status_changed' | 'workflow.execution_failed' | 'knowledge_file.ready' | 'webhook.test';
793
1028
  /**
794
1029
  * When it happened.
795
1030
  */
@@ -811,6 +1046,26 @@ export type WebhookEvent = {
811
1046
  * Contact, for `contact.*` events.
812
1047
  */
813
1048
  contact_id?: string;
1049
+ /**
1050
+ * Broadcast, for `broadcast.*` events.
1051
+ */
1052
+ broadcast_id?: string;
1053
+ /**
1054
+ * Template ID at Meta, for `template.status_changed`.
1055
+ */
1056
+ template_id?: string;
1057
+ /**
1058
+ * Workflow, for `workflow.execution_failed`.
1059
+ */
1060
+ workflow_id?: string;
1061
+ /**
1062
+ * Execution, for `workflow.execution_failed`.
1063
+ */
1064
+ workflow_execution_id?: string;
1065
+ /**
1066
+ * Knowledge file, for `knowledge_file.ready`.
1067
+ */
1068
+ knowledge_file_id?: string;
814
1069
  /**
815
1070
  * Webhook, for `webhook.test`.
816
1071
  */
@@ -913,201 +1168,21 @@ export type QuickReply = {
913
1168
  body: string;
914
1169
  };
915
1170
  /**
916
- * A branch or place the agents can send as a WhatsApp location.
917
- */
918
- export type KnowledgeLocation = {
919
- /**
920
- * Location ID.
921
- */
922
- id: string;
923
- /**
924
- * Name customers know it by.
925
- */
926
- name: string;
927
- /**
928
- * Full address as customers read it.
929
- */
930
- address: string;
931
- /**
932
- * Latitude of the map pin.
933
- */
934
- latitude: number;
935
- /**
936
- * Longitude of the map pin.
937
- */
938
- longitude: number;
939
- /**
940
- * Street.
941
- */
942
- street: string | null;
943
- /**
944
- * City.
945
- */
946
- city: string | null;
947
- /**
948
- * State, province or region.
949
- */
950
- state: string | null;
951
- /**
952
- * Postal code.
953
- */
954
- postal_code: string | null;
955
- /**
956
- * Country.
957
- */
958
- country: string | null;
959
- /**
960
- * Country code, ISO 3166-1 alpha-2.
961
- */
962
- country_code: string | null;
963
- /**
964
- * Phone in E.164.
965
- */
966
- phone: string | null;
967
- /**
968
- * Email.
969
- */
970
- email: string | null;
971
- /**
972
- * Opening hours, as free text.
973
- */
974
- hours: string | null;
975
- };
976
- /**
977
- * A contact card in the knowledge directory, which agents can send to customers.
978
- */
979
- export type KnowledgeContact = {
980
- /**
981
- * Knowledge contact ID.
982
- */
983
- id: string;
984
- /**
985
- * Name shown on the contact card.
986
- */
987
- display_name: string;
988
- /**
989
- * First name.
990
- */
991
- first_name: string | null;
992
- /**
993
- * Last name.
994
- */
995
- last_name: string | null;
996
- /**
997
- * Name prefix, such as `Dr.`.
998
- */
999
- prefix: string | null;
1000
- /**
1001
- * Name suffix.
1002
- */
1003
- suffix: string | null;
1004
- /**
1005
- * Company.
1006
- */
1007
- company: string | null;
1008
- /**
1009
- * Department.
1010
- */
1011
- department: string | null;
1012
- /**
1013
- * Job title.
1014
- */
1015
- job_title: string | null;
1016
- /**
1017
- * When the agents should share it.
1018
- */
1019
- description: string | null;
1020
- /**
1021
- * Phone in E.164.
1022
- */
1023
- phone: string | null;
1024
- /**
1025
- * `CELL`, `WORK` or `HOME`.
1026
- */
1027
- phone_type: string | null;
1028
- /**
1029
- * Email.
1030
- */
1031
- email: string | null;
1032
- /**
1033
- * `WORK` or `PERSONAL`.
1034
- */
1035
- email_type: string | null;
1036
- };
1037
- /**
1038
- * A document or image the agents can consult or send.
1171
+ * What a bulk assignment did to one conversation.
1039
1172
  */
1040
- export type KnowledgeFile = {
1173
+ export type ConversationAssignmentResult = {
1041
1174
  /**
1042
- * File ID.
1043
- */
1044
- id: string;
1045
- /**
1046
- * Title the agents see.
1047
- */
1048
- title: string;
1049
- /**
1050
- * When the agents should use it; may be empty.
1051
- */
1052
- description: string;
1053
- /**
1054
- * Original file name.
1055
- */
1056
- filename: string;
1057
- /**
1058
- * File type.
1059
- */
1060
- mime_type: 'application/pdf' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'image/jpeg' | 'image/png';
1061
- /**
1062
- * Size in bytes.
1063
- */
1064
- size_bytes: number;
1065
- /**
1066
- * `uploading` until `POST /knowledge/files/{file_id}/complete` reads it; then `ready`.
1067
- */
1068
- status: 'uploading' | 'ready' | 'failed';
1069
- /**
1070
- * Agents may read it to answer.
1071
- */
1072
- consult_enabled: boolean;
1073
- /**
1074
- * Agents may send the file itself to customers.
1075
- */
1076
- send_enabled: boolean;
1077
- /**
1078
- * Pages of a PDF; null otherwise.
1079
- */
1080
- page_count: number | null;
1081
- /**
1082
- * Start of the text Ricky read from it.
1083
- */
1084
- preview: string | null;
1085
- /**
1086
- * Why Ricky could not read useful content; null when it could.
1087
- */
1088
- extraction_error: string | null;
1089
- /**
1090
- * Signed download URL, valid for five minutes. Only `GET /knowledge/files/{file_id}` of a `ready` file carries it; null elsewhere.
1091
- */
1092
- download_url: string | null;
1093
- /**
1094
- * When the upload began.
1175
+ * Conversation ID.
1095
1176
  */
1096
- created_at: string;
1177
+ conversation_id: string;
1097
1178
  /**
1098
- * Last change.
1179
+ * Member it was to be assigned to.
1099
1180
  */
1100
- updated_at: string;
1101
- };
1102
- /**
1103
- * A file waiting for its bytes, and where to put them.
1104
- */
1105
- export type KnowledgeFileUpload = {
1106
- file: KnowledgeFile;
1181
+ assigned_user_id: string;
1107
1182
  /**
1108
- * Signed URL valid for two hours. `PUT` the file bytes to it with `Content-Type` set to `mime_type`, then call `POST /knowledge/files/{file_id}/complete`.
1183
+ * `assigned`; `not_found` when the organization has no such conversation; `failed` when Ricky could not save it, so retry that conversation.
1109
1184
  */
1110
- upload_url: string;
1185
+ status: 'assigned' | 'not_found' | 'failed';
1111
1186
  };
1112
1187
  /**
1113
1188
  * The days a report covers, in America/Panama time, and the period it is compared with.
@@ -2690,6 +2765,33 @@ export type AssignConversationAgent = {
2690
2765
  */
2691
2766
  agent_id: string | null;
2692
2767
  };
2768
+ /**
2769
+ * How the handoff ends.
2770
+ */
2771
+ export type ResolveHandoff = {
2772
+ /**
2773
+ * `returned_to_ai` gives the conversation back to the AI agent that asked for the handoff and unassigns the member; `stayed_with_human` leaves it with the member.
2774
+ */
2775
+ resolution: 'returned_to_ai' | 'stayed_with_human';
2776
+ };
2777
+ /**
2778
+ * Makes members responsible for many conversations at once. Each member also becomes the contact's owner.
2779
+ */
2780
+ export type AssignConversations = {
2781
+ /**
2782
+ * Up to 100 conversations, each once, with the member for each.
2783
+ */
2784
+ assignments: Array<{
2785
+ /**
2786
+ * Conversation to assign.
2787
+ */
2788
+ conversation_id: string;
2789
+ /**
2790
+ * Member who becomes responsible for it.
2791
+ */
2792
+ assigned_user_id: string;
2793
+ }>;
2794
+ };
2693
2795
  /**
2694
2796
  * A contact needs at least a name, a phone or an email.
2695
2797
  */
@@ -2964,12 +3066,20 @@ export type SendMessage = {
2964
3066
  * Message text.
2965
3067
  */
2966
3068
  text: string;
3069
+ /**
3070
+ * Message of this conversation to quote, from `GET /conversations/{conversation_id}/messages`. WhatsApp only.
3071
+ */
3072
+ reply_to_message_id?: string;
2967
3073
  } | {
2968
3074
  type: 'template';
2969
3075
  template: TemplateMessage;
2970
3076
  } | {
2971
3077
  type: 'media';
2972
3078
  media: MediaMessage;
3079
+ /**
3080
+ * Message of this conversation to quote, from `GET /conversations/{conversation_id}/messages`. WhatsApp only.
3081
+ */
3082
+ reply_to_message_id?: string;
2973
3083
  };
2974
3084
  /**
2975
3085
  * Sends a template to a phone number.
@@ -3022,7 +3132,7 @@ export type CreateWebhook = {
3022
3132
  * Public HTTPS endpoint.
3023
3133
  */
3024
3134
  url: string;
3025
- event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'contact.created' | 'contact.updated'>;
3135
+ event_types: Array<'message.received' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.failed' | 'conversation.opened' | 'conversation.closed' | 'conversation.assignment_changed' | 'conversation.agent_changed' | 'conversation.handoff_requested' | 'conversation.handoff_resolved' | 'contact.created' | 'contact.updated' | 'contact.tags_changed' | 'broadcast.completed' | 'broadcast.failed' | 'template.status_changed' | 'workflow.execution_failed' | 'knowledge_file.ready'>;
3026
3136
  };
3027
3137
  export type RotateWebhookSecret = {
3028
3138
  /**
@@ -4562,6 +4672,34 @@ export type ListConversationsData = {
4562
4672
  * Only conversations assigned to this member.
4563
4673
  */
4564
4674
  assigned_user_id?: string;
4675
+ /**
4676
+ * Only conversations this AI agent answers and no member is assigned to.
4677
+ */
4678
+ agent_id?: string;
4679
+ /**
4680
+ * `true`: only conversations with no member and no AI agent assigned.
4681
+ */
4682
+ unassigned?: 'true' | 'false';
4683
+ /**
4684
+ * Only conversations on this channel, including earlier connections of the same number or account. See `GET /channels`.
4685
+ */
4686
+ channel_id?: string;
4687
+ /**
4688
+ * Only conversations whose contact has this tag.
4689
+ */
4690
+ tag_id?: string;
4691
+ /**
4692
+ * `true`: only conversations with messages the team has not read.
4693
+ */
4694
+ unread?: 'true' | 'false';
4695
+ /**
4696
+ * `true`: only conversations with a handoff to a person not resolved yet.
4697
+ */
4698
+ pending_handoff?: 'true' | 'false';
4699
+ /**
4700
+ * `customer`: only conversations whose latest message came from the contact.
4701
+ */
4702
+ last_message_from?: 'customer';
4565
4703
  };
4566
4704
  url: '/conversations';
4567
4705
  };
@@ -8098,6 +8236,65 @@ export type ChangeConversationTagsResponses = {
8098
8236
  };
8099
8237
  };
8100
8238
  export type ChangeConversationTagsResponse = ChangeConversationTagsResponses[keyof ChangeConversationTagsResponses];
8239
+ export type MarkConversationUnreadData = {
8240
+ body?: never;
8241
+ headers?: {
8242
+ /**
8243
+ * 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.
8244
+ */
8245
+ 'Idempotency-Key'?: string;
8246
+ };
8247
+ path: {
8248
+ /**
8249
+ * Conversation ID.
8250
+ */
8251
+ conversation_id: string;
8252
+ };
8253
+ query?: never;
8254
+ url: '/conversations/{conversation_id}/read';
8255
+ };
8256
+ export type MarkConversationUnreadErrors = {
8257
+ /**
8258
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
8259
+ */
8260
+ 400: Error;
8261
+ /**
8262
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
8263
+ */
8264
+ 401: Error;
8265
+ /**
8266
+ * `insufficient_scope`: The key lacks the scope this operation requires.
8267
+ */
8268
+ 403: Error;
8269
+ /**
8270
+ * `not_found`: The resource does not exist in this organization.
8271
+ */
8272
+ 404: Error;
8273
+ /**
8274
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
8275
+ *
8276
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
8277
+ */
8278
+ 409: Error;
8279
+ /**
8280
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
8281
+ */
8282
+ 429: Error;
8283
+ /**
8284
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
8285
+ */
8286
+ 500: Error;
8287
+ };
8288
+ export type MarkConversationUnreadError = MarkConversationUnreadErrors[keyof MarkConversationUnreadErrors];
8289
+ export type MarkConversationUnreadResponses = {
8290
+ /**
8291
+ * Success.
8292
+ */
8293
+ 200: {
8294
+ data: Conversation;
8295
+ };
8296
+ };
8297
+ export type MarkConversationUnreadResponse = MarkConversationUnreadResponses[keyof MarkConversationUnreadResponses];
8101
8298
  export type MarkConversationReadData = {
8102
8299
  body?: never;
8103
8300
  headers?: {
@@ -9230,6 +9427,202 @@ export type ListBroadcastRecipientsResponses = {
9230
9427
  };
9231
9428
  };
9232
9429
  export type ListBroadcastRecipientsResponse = ListBroadcastRecipientsResponses[keyof ListBroadcastRecipientsResponses];
9430
+ export type AssignConversationsData = {
9431
+ body: AssignConversations;
9432
+ headers?: {
9433
+ /**
9434
+ * 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.
9435
+ */
9436
+ 'Idempotency-Key'?: string;
9437
+ };
9438
+ path?: never;
9439
+ query?: never;
9440
+ url: '/conversations/assignments';
9441
+ };
9442
+ export type AssignConversationsErrors = {
9443
+ /**
9444
+ * `invalid_json`: The body is not valid JSON.
9445
+ *
9446
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9447
+ */
9448
+ 400: Error;
9449
+ /**
9450
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9451
+ */
9452
+ 401: Error;
9453
+ /**
9454
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9455
+ */
9456
+ 403: Error;
9457
+ /**
9458
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9459
+ *
9460
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9461
+ */
9462
+ 409: Error;
9463
+ /**
9464
+ * `body_too_large`: The JSON body exceeds 64 KiB.
9465
+ */
9466
+ 413: Error;
9467
+ /**
9468
+ * `unsupported_media_type`: The body must be `application/json`.
9469
+ */
9470
+ 415: Error;
9471
+ /**
9472
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9473
+ */
9474
+ 429: Error;
9475
+ /**
9476
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9477
+ */
9478
+ 500: Error;
9479
+ };
9480
+ export type AssignConversationsError = AssignConversationsErrors[keyof AssignConversationsErrors];
9481
+ export type AssignConversationsResponses = {
9482
+ /**
9483
+ * Success.
9484
+ */
9485
+ 200: {
9486
+ data: Array<ConversationAssignmentResult>;
9487
+ /**
9488
+ * Pass as `cursor` for the next page; null on the last page.
9489
+ */
9490
+ next_cursor: string | null;
9491
+ };
9492
+ };
9493
+ export type AssignConversationsResponse = AssignConversationsResponses[keyof AssignConversationsResponses];
9494
+ export type ResolveConversationHandoffData = {
9495
+ body: ResolveHandoff;
9496
+ headers?: {
9497
+ /**
9498
+ * 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.
9499
+ */
9500
+ 'Idempotency-Key'?: string;
9501
+ };
9502
+ path: {
9503
+ /**
9504
+ * Conversation ID.
9505
+ */
9506
+ conversation_id: string;
9507
+ };
9508
+ query?: never;
9509
+ url: '/conversations/{conversation_id}/handoff/resolve';
9510
+ };
9511
+ export type ResolveConversationHandoffErrors = {
9512
+ /**
9513
+ * `invalid_json`: The body is not valid JSON.
9514
+ *
9515
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9516
+ */
9517
+ 400: Error;
9518
+ /**
9519
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9520
+ */
9521
+ 401: Error;
9522
+ /**
9523
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9524
+ */
9525
+ 403: Error;
9526
+ /**
9527
+ * `not_found`: The resource does not exist in this organization.
9528
+ */
9529
+ 404: Error;
9530
+ /**
9531
+ * `idempotency_conflict`: The `Idempotency-Key` was used for a different request.
9532
+ *
9533
+ * `request_processing`: A request with this `Idempotency-Key` is still processing or ended in an unknown state.
9534
+ */
9535
+ 409: Error;
9536
+ /**
9537
+ * `body_too_large`: The JSON body exceeds 64 KiB.
9538
+ */
9539
+ 413: Error;
9540
+ /**
9541
+ * `unsupported_media_type`: The body must be `application/json`.
9542
+ */
9543
+ 415: Error;
9544
+ /**
9545
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9546
+ */
9547
+ 422: Error;
9548
+ /**
9549
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9550
+ */
9551
+ 429: Error;
9552
+ /**
9553
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9554
+ */
9555
+ 500: Error;
9556
+ };
9557
+ export type ResolveConversationHandoffError = ResolveConversationHandoffErrors[keyof ResolveConversationHandoffErrors];
9558
+ export type ResolveConversationHandoffResponses = {
9559
+ /**
9560
+ * Success.
9561
+ */
9562
+ 200: {
9563
+ data: Conversation;
9564
+ };
9565
+ };
9566
+ export type ResolveConversationHandoffResponse = ResolveConversationHandoffResponses[keyof ResolveConversationHandoffResponses];
9567
+ export type FetchMessageMediaData = {
9568
+ body?: never;
9569
+ path: {
9570
+ /**
9571
+ * Conversation ID.
9572
+ */
9573
+ conversation_id: string;
9574
+ /**
9575
+ * Message ID.
9576
+ */
9577
+ message_id: string;
9578
+ };
9579
+ query?: never;
9580
+ url: '/conversations/{conversation_id}/messages/{message_id}/media';
9581
+ };
9582
+ export type FetchMessageMediaErrors = {
9583
+ /**
9584
+ * `invalid_input`: A parameter or body field is invalid; `param` names it when known.
9585
+ */
9586
+ 400: Error;
9587
+ /**
9588
+ * `unauthorized`: The `Authorization` header is missing, malformed, expired or revoked.
9589
+ */
9590
+ 401: Error;
9591
+ /**
9592
+ * `insufficient_scope`: The key lacks the scope this operation requires.
9593
+ */
9594
+ 403: Error;
9595
+ /**
9596
+ * `not_found`: The resource does not exist in this organization.
9597
+ */
9598
+ 404: Error;
9599
+ /**
9600
+ * `rule_violation`: The request breaks a business rule; `message` says which.
9601
+ */
9602
+ 422: Error;
9603
+ /**
9604
+ * `rate_limited`: More than 120 requests this minute with this key; see `Retry-After`.
9605
+ */
9606
+ 429: Error;
9607
+ /**
9608
+ * `internal_error`: Ricky failed. Retry a read. Before retrying a write, read the resource: the same `Idempotency-Key` answers `request_processing`.
9609
+ */
9610
+ 500: Error;
9611
+ /**
9612
+ * `upstream_error`: The messaging provider failed. Retry later.
9613
+ */
9614
+ 502: Error;
9615
+ };
9616
+ export type FetchMessageMediaError = FetchMessageMediaErrors[keyof FetchMessageMediaErrors];
9617
+ export type FetchMessageMediaResponses = {
9618
+ /**
9619
+ * Success.
9620
+ */
9621
+ 200: {
9622
+ data: Message;
9623
+ };
9624
+ };
9625
+ export type FetchMessageMediaResponse = FetchMessageMediaResponses[keyof FetchMessageMediaResponses];
9233
9626
  export type WebhookMessageReceivedWebhookPayload = WebhookEvent;
9234
9627
  export type WebhookMessageReceivedWebhookRequest = {
9235
9628
  body: WebhookMessageReceivedWebhookPayload;
@@ -9286,6 +9679,27 @@ export type WebhookConversationAssignmentChangedWebhookRequest = {
9286
9679
  path?: never;
9287
9680
  query?: never;
9288
9681
  };
9682
+ export type WebhookConversationAgentChangedWebhookPayload = WebhookEvent;
9683
+ export type WebhookConversationAgentChangedWebhookRequest = {
9684
+ body: WebhookConversationAgentChangedWebhookPayload;
9685
+ key: 'conversation.agent_changed';
9686
+ path?: never;
9687
+ query?: never;
9688
+ };
9689
+ export type WebhookConversationHandoffRequestedWebhookPayload = WebhookEvent;
9690
+ export type WebhookConversationHandoffRequestedWebhookRequest = {
9691
+ body: WebhookConversationHandoffRequestedWebhookPayload;
9692
+ key: 'conversation.handoff_requested';
9693
+ path?: never;
9694
+ query?: never;
9695
+ };
9696
+ export type WebhookConversationHandoffResolvedWebhookPayload = WebhookEvent;
9697
+ export type WebhookConversationHandoffResolvedWebhookRequest = {
9698
+ body: WebhookConversationHandoffResolvedWebhookPayload;
9699
+ key: 'conversation.handoff_resolved';
9700
+ path?: never;
9701
+ query?: never;
9702
+ };
9289
9703
  export type WebhookContactCreatedWebhookPayload = WebhookEvent;
9290
9704
  export type WebhookContactCreatedWebhookRequest = {
9291
9705
  body: WebhookContactCreatedWebhookPayload;
@@ -9300,6 +9714,48 @@ export type WebhookContactUpdatedWebhookRequest = {
9300
9714
  path?: never;
9301
9715
  query?: never;
9302
9716
  };
9717
+ export type WebhookContactTagsChangedWebhookPayload = WebhookEvent;
9718
+ export type WebhookContactTagsChangedWebhookRequest = {
9719
+ body: WebhookContactTagsChangedWebhookPayload;
9720
+ key: 'contact.tags_changed';
9721
+ path?: never;
9722
+ query?: never;
9723
+ };
9724
+ export type WebhookBroadcastCompletedWebhookPayload = WebhookEvent;
9725
+ export type WebhookBroadcastCompletedWebhookRequest = {
9726
+ body: WebhookBroadcastCompletedWebhookPayload;
9727
+ key: 'broadcast.completed';
9728
+ path?: never;
9729
+ query?: never;
9730
+ };
9731
+ export type WebhookBroadcastFailedWebhookPayload = WebhookEvent;
9732
+ export type WebhookBroadcastFailedWebhookRequest = {
9733
+ body: WebhookBroadcastFailedWebhookPayload;
9734
+ key: 'broadcast.failed';
9735
+ path?: never;
9736
+ query?: never;
9737
+ };
9738
+ export type WebhookTemplateStatusChangedWebhookPayload = WebhookEvent;
9739
+ export type WebhookTemplateStatusChangedWebhookRequest = {
9740
+ body: WebhookTemplateStatusChangedWebhookPayload;
9741
+ key: 'template.status_changed';
9742
+ path?: never;
9743
+ query?: never;
9744
+ };
9745
+ export type WebhookWorkflowExecutionFailedWebhookPayload = WebhookEvent;
9746
+ export type WebhookWorkflowExecutionFailedWebhookRequest = {
9747
+ body: WebhookWorkflowExecutionFailedWebhookPayload;
9748
+ key: 'workflow.execution_failed';
9749
+ path?: never;
9750
+ query?: never;
9751
+ };
9752
+ export type WebhookKnowledgeFileReadyWebhookPayload = WebhookEvent;
9753
+ export type WebhookKnowledgeFileReadyWebhookRequest = {
9754
+ body: WebhookKnowledgeFileReadyWebhookPayload;
9755
+ key: 'knowledge_file.ready';
9756
+ path?: never;
9757
+ query?: never;
9758
+ };
9303
9759
  export type WebhookWebhookTestWebhookPayload = WebhookEvent;
9304
9760
  export type WebhookWebhookTestWebhookRequest = {
9305
9761
  body: WebhookWebhookTestWebhookPayload;