ruby/resources/webhooks/index.md +0 −1043 deleted
File Deleted View Diff
1# Webhooks
2
3##
4
5`webhooks.unwrap() -> void`
6
7**** ``
8
9Validates that the given payload was sent by OpenAI and parses the payload.
10
11### Example
12
13```ruby
14require "openai"
15
16openai = OpenAI::Client.new(api_key: "My API Key")
17
18result = openai.webhooks.unwrap
19
20puts(result)
21```
22
23## Domain Types
24
25### Batch Cancelled Webhook Event
26
27- `class BatchCancelledWebhookEvent`
28
29 Sent when a batch API request has been cancelled.
30
31 - `id: String`
32
33 The unique ID of the event.
34
35 - `created_at: Integer`
36
37 The Unix timestamp (in seconds) of when the batch API request was cancelled.
38
39 - `data: Data{ id}`
40
41 Event data payload.
42
43 - `id: String`
44
45 The unique ID of the batch API request.
46
47 - `type: :"batch.cancelled"`
48
49 The type of the event. Always `batch.cancelled`.
50
51 - `:"batch.cancelled"`
52
53 - `object: :event`
54
55 The object of the event. Always `event`.
56
57 - `:event`
58
59### Batch Completed Webhook Event
60
61- `class BatchCompletedWebhookEvent`
62
63 Sent when a batch API request has been completed.
64
65 - `id: String`
66
67 The unique ID of the event.
68
69 - `created_at: Integer`
70
71 The Unix timestamp (in seconds) of when the batch API request was completed.
72
73 - `data: Data{ id}`
74
75 Event data payload.
76
77 - `id: String`
78
79 The unique ID of the batch API request.
80
81 - `type: :"batch.completed"`
82
83 The type of the event. Always `batch.completed`.
84
85 - `:"batch.completed"`
86
87 - `object: :event`
88
89 The object of the event. Always `event`.
90
91 - `:event`
92
93### Batch Expired Webhook Event
94
95- `class BatchExpiredWebhookEvent`
96
97 Sent when a batch API request has expired.
98
99 - `id: String`
100
101 The unique ID of the event.
102
103 - `created_at: Integer`
104
105 The Unix timestamp (in seconds) of when the batch API request expired.
106
107 - `data: Data{ id}`
108
109 Event data payload.
110
111 - `id: String`
112
113 The unique ID of the batch API request.
114
115 - `type: :"batch.expired"`
116
117 The type of the event. Always `batch.expired`.
118
119 - `:"batch.expired"`
120
121 - `object: :event`
122
123 The object of the event. Always `event`.
124
125 - `:event`
126
127### Batch Failed Webhook Event
128
129- `class BatchFailedWebhookEvent`
130
131 Sent when a batch API request has failed.
132
133 - `id: String`
134
135 The unique ID of the event.
136
137 - `created_at: Integer`
138
139 The Unix timestamp (in seconds) of when the batch API request failed.
140
141 - `data: Data{ id}`
142
143 Event data payload.
144
145 - `id: String`
146
147 The unique ID of the batch API request.
148
149 - `type: :"batch.failed"`
150
151 The type of the event. Always `batch.failed`.
152
153 - `:"batch.failed"`
154
155 - `object: :event`
156
157 The object of the event. Always `event`.
158
159 - `:event`
160
161### Eval Run Canceled Webhook Event
162
163- `class EvalRunCanceledWebhookEvent`
164
165 Sent when an eval run has been canceled.
166
167 - `id: String`
168
169 The unique ID of the event.
170
171 - `created_at: Integer`
172
173 The Unix timestamp (in seconds) of when the eval run was canceled.
174
175 - `data: Data{ id}`
176
177 Event data payload.
178
179 - `id: String`
180
181 The unique ID of the eval run.
182
183 - `type: :"eval.run.canceled"`
184
185 The type of the event. Always `eval.run.canceled`.
186
187 - `:"eval.run.canceled"`
188
189 - `object: :event`
190
191 The object of the event. Always `event`.
192
193 - `:event`
194
195### Eval Run Failed Webhook Event
196
197- `class EvalRunFailedWebhookEvent`
198
199 Sent when an eval run has failed.
200
201 - `id: String`
202
203 The unique ID of the event.
204
205 - `created_at: Integer`
206
207 The Unix timestamp (in seconds) of when the eval run failed.
208
209 - `data: Data{ id}`
210
211 Event data payload.
212
213 - `id: String`
214
215 The unique ID of the eval run.
216
217 - `type: :"eval.run.failed"`
218
219 The type of the event. Always `eval.run.failed`.
220
221 - `:"eval.run.failed"`
222
223 - `object: :event`
224
225 The object of the event. Always `event`.
226
227 - `:event`
228
229### Eval Run Succeeded Webhook Event
230
231- `class EvalRunSucceededWebhookEvent`
232
233 Sent when an eval run has succeeded.
234
235 - `id: String`
236
237 The unique ID of the event.
238
239 - `created_at: Integer`
240
241 The Unix timestamp (in seconds) of when the eval run succeeded.
242
243 - `data: Data{ id}`
244
245 Event data payload.
246
247 - `id: String`
248
249 The unique ID of the eval run.
250
251 - `type: :"eval.run.succeeded"`
252
253 The type of the event. Always `eval.run.succeeded`.
254
255 - `:"eval.run.succeeded"`
256
257 - `object: :event`
258
259 The object of the event. Always `event`.
260
261 - `:event`
262
263### Fine Tuning Job Cancelled Webhook Event
264
265- `class FineTuningJobCancelledWebhookEvent`
266
267 Sent when a fine-tuning job has been cancelled.
268
269 - `id: String`
270
271 The unique ID of the event.
272
273 - `created_at: Integer`
274
275 The Unix timestamp (in seconds) of when the fine-tuning job was cancelled.
276
277 - `data: Data{ id}`
278
279 Event data payload.
280
281 - `id: String`
282
283 The unique ID of the fine-tuning job.
284
285 - `type: :"fine_tuning.job.cancelled"`
286
287 The type of the event. Always `fine_tuning.job.cancelled`.
288
289 - `:"fine_tuning.job.cancelled"`
290
291 - `object: :event`
292
293 The object of the event. Always `event`.
294
295 - `:event`
296
297### Fine Tuning Job Failed Webhook Event
298
299- `class FineTuningJobFailedWebhookEvent`
300
301 Sent when a fine-tuning job has failed.
302
303 - `id: String`
304
305 The unique ID of the event.
306
307 - `created_at: Integer`
308
309 The Unix timestamp (in seconds) of when the fine-tuning job failed.
310
311 - `data: Data{ id}`
312
313 Event data payload.
314
315 - `id: String`
316
317 The unique ID of the fine-tuning job.
318
319 - `type: :"fine_tuning.job.failed"`
320
321 The type of the event. Always `fine_tuning.job.failed`.
322
323 - `:"fine_tuning.job.failed"`
324
325 - `object: :event`
326
327 The object of the event. Always `event`.
328
329 - `:event`
330
331### Fine Tuning Job Succeeded Webhook Event
332
333- `class FineTuningJobSucceededWebhookEvent`
334
335 Sent when a fine-tuning job has succeeded.
336
337 - `id: String`
338
339 The unique ID of the event.
340
341 - `created_at: Integer`
342
343 The Unix timestamp (in seconds) of when the fine-tuning job succeeded.
344
345 - `data: Data{ id}`
346
347 Event data payload.
348
349 - `id: String`
350
351 The unique ID of the fine-tuning job.
352
353 - `type: :"fine_tuning.job.succeeded"`
354
355 The type of the event. Always `fine_tuning.job.succeeded`.
356
357 - `:"fine_tuning.job.succeeded"`
358
359 - `object: :event`
360
361 The object of the event. Always `event`.
362
363 - `:event`
364
365### Realtime Call Incoming Webhook Event
366
367- `class RealtimeCallIncomingWebhookEvent`
368
369 Sent when Realtime API Receives a incoming SIP call.
370
371 - `id: String`
372
373 The unique ID of the event.
374
375 - `created_at: Integer`
376
377 The Unix timestamp (in seconds) of when the model response was completed.
378
379 - `data: Data{ call_id, sip_headers}`
380
381 Event data payload.
382
383 - `call_id: String`
384
385 The unique ID of this call.
386
387 - `sip_headers: Array[SipHeader{ name, value}]`
388
389 Headers from the SIP Invite.
390
391 - `name: String`
392
393 Name of the SIP Header.
394
395 - `value: String`
396
397 Value of the SIP Header.
398
399 - `type: :"realtime.call.incoming"`
400
401 The type of the event. Always `realtime.call.incoming`.
402
403 - `:"realtime.call.incoming"`
404
405 - `object: :event`
406
407 The object of the event. Always `event`.
408
409 - `:event`
410
411### Response Cancelled Webhook Event
412
413- `class ResponseCancelledWebhookEvent`
414
415 Sent when a background response has been cancelled.
416
417 - `id: String`
418
419 The unique ID of the event.
420
421 - `created_at: Integer`
422
423 The Unix timestamp (in seconds) of when the model response was cancelled.
424
425 - `data: Data{ id}`
426
427 Event data payload.
428
429 - `id: String`
430
431 The unique ID of the model response.
432
433 - `type: :"response.cancelled"`
434
435 The type of the event. Always `response.cancelled`.
436
437 - `:"response.cancelled"`
438
439 - `object: :event`
440
441 The object of the event. Always `event`.
442
443 - `:event`
444
445### Response Completed Webhook Event
446
447- `class ResponseCompletedWebhookEvent`
448
449 Sent when a background response has been completed.
450
451 - `id: String`
452
453 The unique ID of the event.
454
455 - `created_at: Integer`
456
457 The Unix timestamp (in seconds) of when the model response was completed.
458
459 - `data: Data{ id}`
460
461 Event data payload.
462
463 - `id: String`
464
465 The unique ID of the model response.
466
467 - `type: :"response.completed"`
468
469 The type of the event. Always `response.completed`.
470
471 - `:"response.completed"`
472
473 - `object: :event`
474
475 The object of the event. Always `event`.
476
477 - `:event`
478
479### Response Failed Webhook Event
480
481- `class ResponseFailedWebhookEvent`
482
483 Sent when a background response has failed.
484
485 - `id: String`
486
487 The unique ID of the event.
488
489 - `created_at: Integer`
490
491 The Unix timestamp (in seconds) of when the model response failed.
492
493 - `data: Data{ id}`
494
495 Event data payload.
496
497 - `id: String`
498
499 The unique ID of the model response.
500
501 - `type: :"response.failed"`
502
503 The type of the event. Always `response.failed`.
504
505 - `:"response.failed"`
506
507 - `object: :event`
508
509 The object of the event. Always `event`.
510
511 - `:event`
512
513### Response Incomplete Webhook Event
514
515- `class ResponseIncompleteWebhookEvent`
516
517 Sent when a background response has been interrupted.
518
519 - `id: String`
520
521 The unique ID of the event.
522
523 - `created_at: Integer`
524
525 The Unix timestamp (in seconds) of when the model response was interrupted.
526
527 - `data: Data{ id}`
528
529 Event data payload.
530
531 - `id: String`
532
533 The unique ID of the model response.
534
535 - `type: :"response.incomplete"`
536
537 The type of the event. Always `response.incomplete`.
538
539 - `:"response.incomplete"`
540
541 - `object: :event`
542
543 The object of the event. Always `event`.
544
545 - `:event`
546
547### Unwrap Webhook Event
548
549- `UnwrapWebhookEvent = BatchCancelledWebhookEvent | BatchCompletedWebhookEvent | BatchExpiredWebhookEvent | 12 more`
550
551 Sent when a batch API request has been cancelled.
552
553 - `class BatchCancelledWebhookEvent`
554
555 Sent when a batch API request has been cancelled.
556
557 - `id: String`
558
559 The unique ID of the event.
560
561 - `created_at: Integer`
562
563 The Unix timestamp (in seconds) of when the batch API request was cancelled.
564
565 - `data: Data{ id}`
566
567 Event data payload.
568
569 - `id: String`
570
571 The unique ID of the batch API request.
572
573 - `type: :"batch.cancelled"`
574
575 The type of the event. Always `batch.cancelled`.
576
577 - `:"batch.cancelled"`
578
579 - `object: :event`
580
581 The object of the event. Always `event`.
582
583 - `:event`
584
585 - `class BatchCompletedWebhookEvent`
586
587 Sent when a batch API request has been completed.
588
589 - `id: String`
590
591 The unique ID of the event.
592
593 - `created_at: Integer`
594
595 The Unix timestamp (in seconds) of when the batch API request was completed.
596
597 - `data: Data{ id}`
598
599 Event data payload.
600
601 - `id: String`
602
603 The unique ID of the batch API request.
604
605 - `type: :"batch.completed"`
606
607 The type of the event. Always `batch.completed`.
608
609 - `:"batch.completed"`
610
611 - `object: :event`
612
613 The object of the event. Always `event`.
614
615 - `:event`
616
617 - `class BatchExpiredWebhookEvent`
618
619 Sent when a batch API request has expired.
620
621 - `id: String`
622
623 The unique ID of the event.
624
625 - `created_at: Integer`
626
627 The Unix timestamp (in seconds) of when the batch API request expired.
628
629 - `data: Data{ id}`
630
631 Event data payload.
632
633 - `id: String`
634
635 The unique ID of the batch API request.
636
637 - `type: :"batch.expired"`
638
639 The type of the event. Always `batch.expired`.
640
641 - `:"batch.expired"`
642
643 - `object: :event`
644
645 The object of the event. Always `event`.
646
647 - `:event`
648
649 - `class BatchFailedWebhookEvent`
650
651 Sent when a batch API request has failed.
652
653 - `id: String`
654
655 The unique ID of the event.
656
657 - `created_at: Integer`
658
659 The Unix timestamp (in seconds) of when the batch API request failed.
660
661 - `data: Data{ id}`
662
663 Event data payload.
664
665 - `id: String`
666
667 The unique ID of the batch API request.
668
669 - `type: :"batch.failed"`
670
671 The type of the event. Always `batch.failed`.
672
673 - `:"batch.failed"`
674
675 - `object: :event`
676
677 The object of the event. Always `event`.
678
679 - `:event`
680
681 - `class EvalRunCanceledWebhookEvent`
682
683 Sent when an eval run has been canceled.
684
685 - `id: String`
686
687 The unique ID of the event.
688
689 - `created_at: Integer`
690
691 The Unix timestamp (in seconds) of when the eval run was canceled.
692
693 - `data: Data{ id}`
694
695 Event data payload.
696
697 - `id: String`
698
699 The unique ID of the eval run.
700
701 - `type: :"eval.run.canceled"`
702
703 The type of the event. Always `eval.run.canceled`.
704
705 - `:"eval.run.canceled"`
706
707 - `object: :event`
708
709 The object of the event. Always `event`.
710
711 - `:event`
712
713 - `class EvalRunFailedWebhookEvent`
714
715 Sent when an eval run has failed.
716
717 - `id: String`
718
719 The unique ID of the event.
720
721 - `created_at: Integer`
722
723 The Unix timestamp (in seconds) of when the eval run failed.
724
725 - `data: Data{ id}`
726
727 Event data payload.
728
729 - `id: String`
730
731 The unique ID of the eval run.
732
733 - `type: :"eval.run.failed"`
734
735 The type of the event. Always `eval.run.failed`.
736
737 - `:"eval.run.failed"`
738
739 - `object: :event`
740
741 The object of the event. Always `event`.
742
743 - `:event`
744
745 - `class EvalRunSucceededWebhookEvent`
746
747 Sent when an eval run has succeeded.
748
749 - `id: String`
750
751 The unique ID of the event.
752
753 - `created_at: Integer`
754
755 The Unix timestamp (in seconds) of when the eval run succeeded.
756
757 - `data: Data{ id}`
758
759 Event data payload.
760
761 - `id: String`
762
763 The unique ID of the eval run.
764
765 - `type: :"eval.run.succeeded"`
766
767 The type of the event. Always `eval.run.succeeded`.
768
769 - `:"eval.run.succeeded"`
770
771 - `object: :event`
772
773 The object of the event. Always `event`.
774
775 - `:event`
776
777 - `class FineTuningJobCancelledWebhookEvent`
778
779 Sent when a fine-tuning job has been cancelled.
780
781 - `id: String`
782
783 The unique ID of the event.
784
785 - `created_at: Integer`
786
787 The Unix timestamp (in seconds) of when the fine-tuning job was cancelled.
788
789 - `data: Data{ id}`
790
791 Event data payload.
792
793 - `id: String`
794
795 The unique ID of the fine-tuning job.
796
797 - `type: :"fine_tuning.job.cancelled"`
798
799 The type of the event. Always `fine_tuning.job.cancelled`.
800
801 - `:"fine_tuning.job.cancelled"`
802
803 - `object: :event`
804
805 The object of the event. Always `event`.
806
807 - `:event`
808
809 - `class FineTuningJobFailedWebhookEvent`
810
811 Sent when a fine-tuning job has failed.
812
813 - `id: String`
814
815 The unique ID of the event.
816
817 - `created_at: Integer`
818
819 The Unix timestamp (in seconds) of when the fine-tuning job failed.
820
821 - `data: Data{ id}`
822
823 Event data payload.
824
825 - `id: String`
826
827 The unique ID of the fine-tuning job.
828
829 - `type: :"fine_tuning.job.failed"`
830
831 The type of the event. Always `fine_tuning.job.failed`.
832
833 - `:"fine_tuning.job.failed"`
834
835 - `object: :event`
836
837 The object of the event. Always `event`.
838
839 - `:event`
840
841 - `class FineTuningJobSucceededWebhookEvent`
842
843 Sent when a fine-tuning job has succeeded.
844
845 - `id: String`
846
847 The unique ID of the event.
848
849 - `created_at: Integer`
850
851 The Unix timestamp (in seconds) of when the fine-tuning job succeeded.
852
853 - `data: Data{ id}`
854
855 Event data payload.
856
857 - `id: String`
858
859 The unique ID of the fine-tuning job.
860
861 - `type: :"fine_tuning.job.succeeded"`
862
863 The type of the event. Always `fine_tuning.job.succeeded`.
864
865 - `:"fine_tuning.job.succeeded"`
866
867 - `object: :event`
868
869 The object of the event. Always `event`.
870
871 - `:event`
872
873 - `class RealtimeCallIncomingWebhookEvent`
874
875 Sent when Realtime API Receives a incoming SIP call.
876
877 - `id: String`
878
879 The unique ID of the event.
880
881 - `created_at: Integer`
882
883 The Unix timestamp (in seconds) of when the model response was completed.
884
885 - `data: Data{ call_id, sip_headers}`
886
887 Event data payload.
888
889 - `call_id: String`
890
891 The unique ID of this call.
892
893 - `sip_headers: Array[SipHeader{ name, value}]`
894
895 Headers from the SIP Invite.
896
897 - `name: String`
898
899 Name of the SIP Header.
900
901 - `value: String`
902
903 Value of the SIP Header.
904
905 - `type: :"realtime.call.incoming"`
906
907 The type of the event. Always `realtime.call.incoming`.
908
909 - `:"realtime.call.incoming"`
910
911 - `object: :event`
912
913 The object of the event. Always `event`.
914
915 - `:event`
916
917 - `class ResponseCancelledWebhookEvent`
918
919 Sent when a background response has been cancelled.
920
921 - `id: String`
922
923 The unique ID of the event.
924
925 - `created_at: Integer`
926
927 The Unix timestamp (in seconds) of when the model response was cancelled.
928
929 - `data: Data{ id}`
930
931 Event data payload.
932
933 - `id: String`
934
935 The unique ID of the model response.
936
937 - `type: :"response.cancelled"`
938
939 The type of the event. Always `response.cancelled`.
940
941 - `:"response.cancelled"`
942
943 - `object: :event`
944
945 The object of the event. Always `event`.
946
947 - `:event`
948
949 - `class ResponseCompletedWebhookEvent`
950
951 Sent when a background response has been completed.
952
953 - `id: String`
954
955 The unique ID of the event.
956
957 - `created_at: Integer`
958
959 The Unix timestamp (in seconds) of when the model response was completed.
960
961 - `data: Data{ id}`
962
963 Event data payload.
964
965 - `id: String`
966
967 The unique ID of the model response.
968
969 - `type: :"response.completed"`
970
971 The type of the event. Always `response.completed`.
972
973 - `:"response.completed"`
974
975 - `object: :event`
976
977 The object of the event. Always `event`.
978
979 - `:event`
980
981 - `class ResponseFailedWebhookEvent`
982
983 Sent when a background response has failed.
984
985 - `id: String`
986
987 The unique ID of the event.
988
989 - `created_at: Integer`
990
991 The Unix timestamp (in seconds) of when the model response failed.
992
993 - `data: Data{ id}`
994
995 Event data payload.
996
997 - `id: String`
998
999 The unique ID of the model response.
1000
1001 - `type: :"response.failed"`
1002
1003 The type of the event. Always `response.failed`.
1004
1005 - `:"response.failed"`
1006
1007 - `object: :event`
1008
1009 The object of the event. Always `event`.
1010
1011 - `:event`
1012
1013 - `class ResponseIncompleteWebhookEvent`
1014
1015 Sent when a background response has been interrupted.
1016
1017 - `id: String`
1018
1019 The unique ID of the event.
1020
1021 - `created_at: Integer`
1022
1023 The Unix timestamp (in seconds) of when the model response was interrupted.
1024
1025 - `data: Data{ id}`
1026
1027 Event data payload.
1028
1029 - `id: String`
1030
1031 The unique ID of the model response.
1032
1033 - `type: :"response.incomplete"`
1034
1035 The type of the event. Always `response.incomplete`.
1036
1037 - `:"response.incomplete"`
1038
1039 - `object: :event`
1040
1041 The object of the event. Always `event`.
1042
1043 - `:event`