@@ -24,12 +24,23 @@ export class Webhooks extends APIResource {
2424 }
2525}
2626
27- export interface UploadPostTransformErrorEvent {
27+ export interface BaseWebhookEvent {
2828 /**
2929 * Unique identifier for the event.
3030 */
3131 id : string ;
3232
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 {
3344 /**
3445 * Timestamp of when the event occurred in ISO8601 format.
3546 */
@@ -111,12 +122,12 @@ export namespace UploadPostTransformErrorEvent {
111122 }
112123}
113124
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 {
120131 /**
121132 * Timestamp of when the event occurred in ISO8601 format.
122133 */
@@ -176,12 +187,11 @@ export namespace UploadPostTransformSuccessEvent {
176187 }
177188}
178189
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 {
185195 /**
186196 * Timestamp of when the event occurred in ISO8601 format.
187197 */
@@ -237,12 +247,12 @@ export namespace UploadPreTransformErrorEvent {
237247 }
238248}
239249
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 {
246256 /**
247257 * Timestamp of when the event occurred in ISO8601 format.
248258 */
@@ -481,12 +491,12 @@ export namespace UploadPreTransformSuccessEvent {
481491 }
482492}
483493
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 {
490500 /**
491501 * Timestamp when the event was created in ISO8601 format.
492502 */
@@ -610,12 +620,13 @@ export namespace VideoTransformationAcceptedEvent {
610620 }
611621}
612622
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 {
619630 /**
620631 * Timestamp when the event was created in ISO8601 format.
621632 */
@@ -752,12 +763,13 @@ export namespace VideoTransformationErrorEvent {
752763 }
753764}
754765
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 {
761773 /**
762774 * Timestamp when the event was created in ISO8601 format.
763775 */
@@ -943,6 +955,11 @@ export namespace VideoTransformationReadyEvent {
943955 }
944956}
945957
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+ */
946963export type UnsafeUnwrapWebhookEvent =
947964 | VideoTransformationAcceptedEvent
948965 | VideoTransformationReadyEvent
@@ -952,6 +969,11 @@ export type UnsafeUnwrapWebhookEvent =
952969 | UploadPostTransformSuccessEvent
953970 | UploadPostTransformErrorEvent ;
954971
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+ */
955977export type UnwrapWebhookEvent =
956978 | VideoTransformationAcceptedEvent
957979 | VideoTransformationReadyEvent
@@ -963,6 +985,7 @@ export type UnwrapWebhookEvent =
963985
964986export declare namespace Webhooks {
965987 export {
988+ type BaseWebhookEvent as BaseWebhookEvent ,
966989 type UploadPostTransformErrorEvent as UploadPostTransformErrorEvent ,
967990 type UploadPostTransformSuccessEvent as UploadPostTransformSuccessEvent ,
968991 type UploadPreTransformErrorEvent as UploadPreTransformErrorEvent ,
0 commit comments