@@ -23,12 +23,23 @@ export class Webhooks extends APIResource {
2323 }
2424}
2525
26- export interface UploadPostTransformErrorEvent {
26+ export interface BaseWebhookEvent {
2727 /**
2828 * Unique identifier for the event.
2929 */
3030 id : string ;
3131
32+ /**
33+ * The type of webhook event.
34+ */
35+ type : string ;
36+ }
37+
38+ /**
39+ * Triggered when a post-transformation fails. The original file remains available,
40+ * but the requested transformation could not be generated.
41+ */
42+ export interface UploadPostTransformErrorEvent extends BaseWebhookEvent {
3243 /**
3344 * Timestamp of when the event occurred in ISO8601 format.
3445 */
@@ -110,12 +121,12 @@ export namespace UploadPostTransformErrorEvent {
110121 }
111122}
112123
113- export interface UploadPostTransformSuccessEvent {
114- /**
115- * Unique identifier for the event.
116- */
117- id : string ;
118-
124+ /**
125+ * Triggered when a post-transformation completes successfully. The transformed
126+ * version of the file is now ready and can be accessed via the provided URL. Note
127+ * that each post-transformation generates a separate webhook event.
128+ */
129+ export interface UploadPostTransformSuccessEvent extends BaseWebhookEvent {
119130 /**
120131 * Timestamp of when the event occurred in ISO8601 format.
121132 */
@@ -175,12 +186,11 @@ export namespace UploadPostTransformSuccessEvent {
175186 }
176187}
177188
178- export interface UploadPreTransformErrorEvent {
179- /**
180- * Unique identifier for the event.
181- */
182- id : string ;
183-
189+ /**
190+ * Triggered when a pre-transformation fails. The file upload may have been
191+ * accepted, but the requested transformation could not be applied.
192+ */
193+ export interface UploadPreTransformErrorEvent extends BaseWebhookEvent {
184194 /**
185195 * Timestamp of when the event occurred in ISO8601 format.
186196 */
@@ -236,12 +246,12 @@ export namespace UploadPreTransformErrorEvent {
236246 }
237247}
238248
239- export interface UploadPreTransformSuccessEvent {
240- /**
241- * Unique identifier for the event.
242- */
243- id : string ;
244-
249+ /**
250+ * Triggered when a pre-transformation completes successfully. The file has been
251+ * processed with the requested transformation and is now available in the Media
252+ * Library.
253+ */
254+ export interface UploadPreTransformSuccessEvent extends BaseWebhookEvent {
245255 /**
246256 * Timestamp of when the event occurred in ISO8601 format.
247257 */
@@ -480,12 +490,12 @@ export namespace UploadPreTransformSuccessEvent {
480490 }
481491}
482492
483- export interface VideoTransformationAcceptedEvent {
484- /**
485- * Unique identifier for the event.
486- */
487- id : string ;
488-
493+ /**
494+ * Triggered when a new video transformation request is accepted for processing.
495+ * This event confirms that ImageKit has received and queued your transformation
496+ * request. Use this for debugging and tracking transformation lifecycle.
497+ */
498+ export interface VideoTransformationAcceptedEvent extends BaseWebhookEvent {
489499 /**
490500 * Timestamp when the event was created in ISO8601 format.
491501 */
@@ -609,12 +619,13 @@ export namespace VideoTransformationAcceptedEvent {
609619 }
610620}
611621
612- export interface VideoTransformationErrorEvent {
613- /**
614- * Unique identifier for the event.
615- */
616- id : string ;
617-
622+ /**
623+ * Triggered when an error occurs during video encoding. Listen to this webhook to
624+ * log error reasons and debug issues. Check your origin and URL endpoint settings
625+ * if the reason is related to download failure. For other errors, contact ImageKit
626+ * support.
627+ */
628+ export interface VideoTransformationErrorEvent extends BaseWebhookEvent {
618629 /**
619630 * Timestamp when the event was created in ISO8601 format.
620631 */
@@ -751,12 +762,13 @@ export namespace VideoTransformationErrorEvent {
751762 }
752763}
753764
754- export interface VideoTransformationReadyEvent {
755- /**
756- * Unique identifier for the event.
757- */
758- id : string ;
759-
765+ /**
766+ * Triggered when video encoding is finished and the transformed resource is ready
767+ * to be served. This is the key event to listen for - update your database or CMS
768+ * flags when you receive this so your application can start showing the
769+ * transformed video to users.
770+ */
771+ export interface VideoTransformationReadyEvent extends BaseWebhookEvent {
760772 /**
761773 * Timestamp when the event was created in ISO8601 format.
762774 */
@@ -942,6 +954,11 @@ export namespace VideoTransformationReadyEvent {
942954 }
943955}
944956
957+ /**
958+ * Triggered when a new video transformation request is accepted for processing.
959+ * This event confirms that ImageKit has received and queued your transformation
960+ * request. Use this for debugging and tracking transformation lifecycle.
961+ */
945962export type UnsafeUnwrapWebhookEvent =
946963 | VideoTransformationAcceptedEvent
947964 | VideoTransformationReadyEvent
@@ -951,6 +968,11 @@ export type UnsafeUnwrapWebhookEvent =
951968 | UploadPostTransformSuccessEvent
952969 | UploadPostTransformErrorEvent ;
953970
971+ /**
972+ * Triggered when a new video transformation request is accepted for processing.
973+ * This event confirms that ImageKit has received and queued your transformation
974+ * request. Use this for debugging and tracking transformation lifecycle.
975+ */
954976export type UnwrapWebhookEvent =
955977 | VideoTransformationAcceptedEvent
956978 | VideoTransformationReadyEvent
@@ -962,6 +984,7 @@ export type UnwrapWebhookEvent =
962984
963985export declare namespace Webhooks {
964986 export {
987+ type BaseWebhookEvent as BaseWebhookEvent ,
965988 type UploadPostTransformErrorEvent as UploadPostTransformErrorEvent ,
966989 type UploadPostTransformSuccessEvent as UploadPostTransformSuccessEvent ,
967990 type UploadPreTransformErrorEvent as UploadPreTransformErrorEvent ,
0 commit comments