@@ -24,12 +24,23 @@ export class Webhooks extends APIResource {
24
24
}
25
25
}
26
26
27
- export interface UploadPostTransformErrorEvent {
27
+ export interface BaseWebhookEvent {
28
28
/**
29
29
* Unique identifier for the event.
30
30
*/
31
31
id : string ;
32
32
33
+ /**
34
+ * The type of webhook event.
35
+ */
36
+ type : string ;
37
+ }
38
+
39
+ /**
40
+ * Triggered when a post-transformation fails. The original file remains available,
41
+ * but the requested transformation could not be generated.
42
+ */
43
+ export interface UploadPostTransformErrorEvent extends BaseWebhookEvent {
33
44
/**
34
45
* Timestamp of when the event occurred in ISO8601 format.
35
46
*/
@@ -111,12 +122,12 @@ export namespace UploadPostTransformErrorEvent {
111
122
}
112
123
}
113
124
114
- export interface UploadPostTransformSuccessEvent {
115
- /**
116
- * Unique identifier for the event.
117
- */
118
- id : string ;
119
-
125
+ /**
126
+ * Triggered when a post-transformation completes successfully. The transformed
127
+ * version of the file is now ready and can be accessed via the provided URL. Note
128
+ * that each post-transformation generates a separate webhook event.
129
+ */
130
+ export interface UploadPostTransformSuccessEvent extends BaseWebhookEvent {
120
131
/**
121
132
* Timestamp of when the event occurred in ISO8601 format.
122
133
*/
@@ -176,12 +187,11 @@ export namespace UploadPostTransformSuccessEvent {
176
187
}
177
188
}
178
189
179
- export interface UploadPreTransformErrorEvent {
180
- /**
181
- * Unique identifier for the event.
182
- */
183
- id : string ;
184
-
190
+ /**
191
+ * Triggered when a pre-transformation fails. The file upload may have been
192
+ * accepted, but the requested transformation could not be applied.
193
+ */
194
+ export interface UploadPreTransformErrorEvent extends BaseWebhookEvent {
185
195
/**
186
196
* Timestamp of when the event occurred in ISO8601 format.
187
197
*/
@@ -237,12 +247,12 @@ export namespace UploadPreTransformErrorEvent {
237
247
}
238
248
}
239
249
240
- export interface UploadPreTransformSuccessEvent {
241
- /**
242
- * Unique identifier for the event.
243
- */
244
- id : string ;
245
-
250
+ /**
251
+ * Triggered when a pre-transformation completes successfully. The file has been
252
+ * processed with the requested transformation and is now available in the Media
253
+ * Library.
254
+ */
255
+ export interface UploadPreTransformSuccessEvent extends BaseWebhookEvent {
246
256
/**
247
257
* Timestamp of when the event occurred in ISO8601 format.
248
258
*/
@@ -481,12 +491,12 @@ export namespace UploadPreTransformSuccessEvent {
481
491
}
482
492
}
483
493
484
- export interface VideoTransformationAcceptedEvent {
485
- /**
486
- * Unique identifier for the event.
487
- */
488
- id : string ;
489
-
494
+ /**
495
+ * Triggered when a new video transformation request is accepted for processing.
496
+ * This event confirms that ImageKit has received and queued your transformation
497
+ * request. Use this for debugging and tracking transformation lifecycle.
498
+ */
499
+ export interface VideoTransformationAcceptedEvent extends BaseWebhookEvent {
490
500
/**
491
501
* Timestamp when the event was created in ISO8601 format.
492
502
*/
@@ -610,12 +620,13 @@ export namespace VideoTransformationAcceptedEvent {
610
620
}
611
621
}
612
622
613
- export interface VideoTransformationErrorEvent {
614
- /**
615
- * Unique identifier for the event.
616
- */
617
- id : string ;
618
-
623
+ /**
624
+ * Triggered when an error occurs during video encoding. Listen to this webhook to
625
+ * log error reasons and debug issues. Check your origin and URL endpoint settings
626
+ * if the reason is related to download failure. For other errors, contact ImageKit
627
+ * support.
628
+ */
629
+ export interface VideoTransformationErrorEvent extends BaseWebhookEvent {
619
630
/**
620
631
* Timestamp when the event was created in ISO8601 format.
621
632
*/
@@ -752,12 +763,13 @@ export namespace VideoTransformationErrorEvent {
752
763
}
753
764
}
754
765
755
- export interface VideoTransformationReadyEvent {
756
- /**
757
- * Unique identifier for the event.
758
- */
759
- id : string ;
760
-
766
+ /**
767
+ * Triggered when video encoding is finished and the transformed resource is ready
768
+ * to be served. This is the key event to listen for - update your database or CMS
769
+ * flags when you receive this so your application can start showing the
770
+ * transformed video to users.
771
+ */
772
+ export interface VideoTransformationReadyEvent extends BaseWebhookEvent {
761
773
/**
762
774
* Timestamp when the event was created in ISO8601 format.
763
775
*/
@@ -943,6 +955,11 @@ export namespace VideoTransformationReadyEvent {
943
955
}
944
956
}
945
957
958
+ /**
959
+ * Triggered when a new video transformation request is accepted for processing.
960
+ * This event confirms that ImageKit has received and queued your transformation
961
+ * request. Use this for debugging and tracking transformation lifecycle.
962
+ */
946
963
export type UnsafeUnwrapWebhookEvent =
947
964
| VideoTransformationAcceptedEvent
948
965
| VideoTransformationReadyEvent
@@ -952,6 +969,11 @@ export type UnsafeUnwrapWebhookEvent =
952
969
| UploadPostTransformSuccessEvent
953
970
| UploadPostTransformErrorEvent ;
954
971
972
+ /**
973
+ * Triggered when a new video transformation request is accepted for processing.
974
+ * This event confirms that ImageKit has received and queued your transformation
975
+ * request. Use this for debugging and tracking transformation lifecycle.
976
+ */
955
977
export type UnwrapWebhookEvent =
956
978
| VideoTransformationAcceptedEvent
957
979
| VideoTransformationReadyEvent
@@ -963,6 +985,7 @@ export type UnwrapWebhookEvent =
963
985
964
986
export declare namespace Webhooks {
965
987
export {
988
+ type BaseWebhookEvent as BaseWebhookEvent ,
966
989
type UploadPostTransformErrorEvent as UploadPostTransformErrorEvent ,
967
990
type UploadPostTransformSuccessEvent as UploadPostTransformSuccessEvent ,
968
991
type UploadPreTransformErrorEvent as UploadPreTransformErrorEvent ,
0 commit comments