From 1a0435d3881d444f53997f6d47ec7c67710cd78e Mon Sep 17 00:00:00 2001 From: Piyush Aryan Date: Tue, 3 Feb 2026 14:58:29 +0530 Subject: [PATCH 1/6] feat: add webhook events for file and folder operations including creation, update, and deletion --- openapi/v1.0.0.yaml | 164 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/openapi/v1.0.0.yaml b/openapi/v1.0.0.yaml index 96d64fc..e319904 100644 --- a/openapi/v1.0.0.yaml +++ b/openapi/v1.0.0.yaml @@ -6849,6 +6849,74 @@ components: required: [fileId, url, name, path, transformation] required: [type, created_at, request, data] + FileNonDeleteEvent: + type: object + properties: + type: + type: string + description: The type of the webhook event. Enum: [file.created, file.updated]. + clientNumber: + type: string + description: The client number to identify the client. + timestamp: + type: number + description: The timestamp of the webhook event. + fileDetails: + $ref: "#/components/schemas/FileDetails" + + FileDeleteEvent: + type: object + properties: + type: + type: string + description: The type of the webhook event. Enum: [file.deleted]. + clientNumber: + type: string + description: The client number to identify the client. + timestamp: + type: number + description: The timestamp of the webhook event. + fileDetails: + type: object + properties: + fileId: + type: string + description: The unique `fileId` of the deleted file. + + FolderNonDeleteEvent: + type: object + properties: + type: + type: string + description: The type of the webhook event. Enum: [folder.created, folder.updated]. + clientNumber: + type: string + description: The client number to identify the client. + timestamp: + type: number + description: The timestamp of the webhook event. + folderDetails: + $ref: "#/components/schemas/FolderDetails" + + FolderDeleteEvent: + type: object + properties: + type: + type: string + description: The type of the webhook event. Enum: [folder.deleted]. + clientNumber: + type: string + description: The client number to identify the client. + timestamp: + type: number + description: The timestamp of the webhook event. + folderDetails: + type: object + properties: + folderId: + type: string + description: The unique `folderId` of the deleted folder. + SrcOptions: title: Source Options description: Options for generating ImageKit URLs with transformations. See the [Transformations guide](https://imagekit.io/docs/transformations). @@ -8510,5 +8578,101 @@ webhooks: "200": description: Acknowledge + file.updated: + post: + operationId: file-updated + summary: File updated + description: | + Triggered when a file is updated. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/FileNonDeleteEvent" + responses: + "200": + description: Acknowledge + + file.created: + post: + operationId: file-created + summary: File created + description: | + Triggered when a file is created. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/FileNonDeleteEvent" + responses: + "200": + description: Acknowledge + + file.deleted: + post: + operationId: file-deleted + summary: File deleted + description: | + Triggered when a file is deleted. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/FileDeleteEvent" + responses: + "200": + description: Acknowledge + + folder.created: + post: + operationId: folder-created + summary: Folder created + description: | + Triggered when a folder is created. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/FolderNonDeleteEvent" + responses: + "200": + description: Acknowledge + + folder.updated: + post: + operationId: folder-updated + summary: Folder updated + description: | + Triggered when a folder is updated. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/FolderNonDeleteEvent" + responses: + "200": + description: Acknowledge + + folder.deleted: + post: + operationId: folder-deleted + summary: Folder deleted + description: | + Triggered when a folder is deleted. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/FolderDeleteEvent" + responses: + "200": + description: Acknowledge + security: - basicAuth: [] From dc8a1fa4135f0f748147cdb3e07b7b2b22e1a342 Mon Sep 17 00:00:00 2001 From: Piyush Aryan Date: Tue, 3 Feb 2026 21:06:29 +0530 Subject: [PATCH 2/6] refactor: enhance webhook event schemas for file and folder operations with improved structure and required fields --- openapi/v1.0.0.yaml | 140 ++++++++++++++++++++----------------- stainless-config/main.yaml | 4 ++ 2 files changed, 81 insertions(+), 63 deletions(-) diff --git a/openapi/v1.0.0.yaml b/openapi/v1.0.0.yaml index e319904..c555f46 100644 --- a/openapi/v1.0.0.yaml +++ b/openapi/v1.0.0.yaml @@ -6849,73 +6849,87 @@ components: required: [fileId, url, name, path, transformation] required: [type, created_at, request, data] - FileNonDeleteEvent: - type: object - properties: - type: - type: string - description: The type of the webhook event. Enum: [file.created, file.updated]. - clientNumber: - type: string - description: The client number to identify the client. - timestamp: - type: number - description: The timestamp of the webhook event. - fileDetails: - $ref: "#/components/schemas/FileDetails" + FileCreateUpdateEvent: + allOf: + - $ref: "#/components/schemas/BaseWebhookEvent" + - type: object + description: | + Triggered when a file is created or updated. + properties: + created_at: + type: string + format: date-time + description: Timestamp of when the event occurred in ISO8601 format. + clientNumber: + type: string + description: The client number to identify the client. + fileDetails: + $ref: "#/components/schemas/FileDetails" + required: [created_at, clientNumber, fileDetails] FileDeleteEvent: - type: object - properties: - type: - type: string - description: The type of the webhook event. Enum: [file.deleted]. - clientNumber: - type: string - description: The client number to identify the client. - timestamp: - type: number - description: The timestamp of the webhook event. - fileDetails: - type: object + allOf: + - $ref: "#/components/schemas/BaseWebhookEvent" + - type: object + description: | + Triggered when a file is deleted. properties: - fileId: + created_at: type: string - description: The unique `fileId` of the deleted file. - - FolderNonDeleteEvent: - type: object - properties: - type: - type: string - description: The type of the webhook event. Enum: [folder.created, folder.updated]. - clientNumber: - type: string - description: The client number to identify the client. - timestamp: - type: number - description: The timestamp of the webhook event. - folderDetails: - $ref: "#/components/schemas/FolderDetails" + format: date-time + description: Timestamp of when the event occurred in ISO8601 format. + clientNumber: + type: string + description: The client number to identify the client. + fileDetails: + type: object + properties: + fileId: + type: string + description: The unique `fileId` of the deleted file. + required: [fileId] + required: [created_at, clientNumber, fileDetails] + + FolderCreateUpdateEvent: + allOf: + - $ref: "#/components/schemas/BaseWebhookEvent" + - type: object + description: | + Triggered when a folder is created or updated. + properties: + created_at: + type: string + format: date-time + description: Timestamp of when the event occurred in ISO8601 format. + clientNumber: + type: string + description: The client number to identify the client. + folderDetails: + $ref: "#/components/schemas/FolderDetails" + required: [created_at, clientNumber, folderDetails] FolderDeleteEvent: - type: object - properties: - type: - type: string - description: The type of the webhook event. Enum: [folder.deleted]. - clientNumber: - type: string - description: The client number to identify the client. - timestamp: - type: number - description: The timestamp of the webhook event. - folderDetails: - type: object + allOf: + - $ref: "#/components/schemas/BaseWebhookEvent" + - type: object + description: | + Triggered when a folder is deleted. properties: - folderId: + created_at: + type: string + format: date-time + description: Timestamp of when the event occurred in ISO8601 format. + clientNumber: type: string - description: The unique `folderId` of the deleted folder. + description: The client number to identify the client. + folderDetails: + type: object + properties: + folderId: + type: string + description: The unique `folderId` of the deleted folder. + required: [folderId] + required: [created_at, clientNumber, folderDetails] SrcOptions: title: Source Options @@ -8589,7 +8603,7 @@ webhooks: content: application/json: schema: - $ref: "#/components/schemas/FileNonDeleteEvent" + $ref: "#/components/schemas/FileCreateUpdateEvent" responses: "200": description: Acknowledge @@ -8605,7 +8619,7 @@ webhooks: content: application/json: schema: - $ref: "#/components/schemas/FileNonDeleteEvent" + $ref: "#/components/schemas/FileCreateUpdateEvent" responses: "200": description: Acknowledge @@ -8637,7 +8651,7 @@ webhooks: content: application/json: schema: - $ref: "#/components/schemas/FolderNonDeleteEvent" + $ref: "#/components/schemas/FolderCreateUpdateEvent" responses: "200": description: Acknowledge @@ -8653,7 +8667,7 @@ webhooks: content: application/json: schema: - $ref: "#/components/schemas/FolderNonDeleteEvent" + $ref: "#/components/schemas/FolderCreateUpdateEvent" responses: "200": description: Acknowledge diff --git a/stainless-config/main.yaml b/stainless-config/main.yaml index e746d1a..2f88b7c 100644 --- a/stainless-config/main.yaml +++ b/stainless-config/main.yaml @@ -251,6 +251,10 @@ resources: UploadPreTransformErrorEvent: '#/components/schemas/UploadPreTransformErrorEvent' UploadPostTransformSuccessEvent: '#/components/schemas/UploadPostTransformSuccessEvent' UploadPostTransformErrorEvent: '#/components/schemas/UploadPostTransformErrorEvent' + FileCreateUpdateEvent: '#/components/schemas/FileCreateUpdateEvent' + FileDeleteEvent: '#/components/schemas/FileDeleteEvent' + FolderCreateUpdateEvent: '#/components/schemas/FolderCreateUpdateEvent' + FolderDeleteEvent: '#/components/schemas/FolderDeleteEvent' methods: unwrap: From 5c855fc7dc2a77edea516aace923357cef5485ef Mon Sep 17 00:00:00 2001 From: Piyush Aryan Date: Wed, 4 Feb 2026 12:10:15 +0530 Subject: [PATCH 3/6] refactor: rename and restructure webhook event schemas --- openapi/v1.0.0.yaml | 150 ++++++++++++-------------------------------- 1 file changed, 41 insertions(+), 109 deletions(-) diff --git a/openapi/v1.0.0.yaml b/openapi/v1.0.0.yaml index c555f46..6928ea5 100644 --- a/openapi/v1.0.0.yaml +++ b/openapi/v1.0.0.yaml @@ -6849,87 +6849,67 @@ components: required: [fileId, url, name, path, transformation] required: [type, created_at, request, data] - FileCreateUpdateEvent: + DamFileCreateEvent: allOf: - $ref: "#/components/schemas/BaseWebhookEvent" - type: object description: | - Triggered when a file is created or updated. + Triggered when a file is created. properties: + type: + type: string + const: "file.created" + description: Type of the webhook event. created_at: type: string format: date-time description: Timestamp of when the event occurred in ISO8601 format. - clientNumber: - type: string - description: The client number to identify the client. - fileDetails: + data: $ref: "#/components/schemas/FileDetails" - required: [created_at, clientNumber, fileDetails] + required: [type, created_at, data] - FileDeleteEvent: + DamFileUpdateEvent: allOf: - $ref: "#/components/schemas/BaseWebhookEvent" - type: object description: | - Triggered when a file is deleted. + Triggered when a file is created. properties: - created_at: - type: string - format: date-time - description: Timestamp of when the event occurred in ISO8601 format. - clientNumber: + type: type: string - description: The client number to identify the client. - fileDetails: - type: object - properties: - fileId: - type: string - description: The unique `fileId` of the deleted file. - required: [fileId] - required: [created_at, clientNumber, fileDetails] - - FolderCreateUpdateEvent: - allOf: - - $ref: "#/components/schemas/BaseWebhookEvent" - - type: object - description: | - Triggered when a folder is created or updated. - properties: + const: "file.updated" + description: Type of the webhook event. created_at: type: string format: date-time description: Timestamp of when the event occurred in ISO8601 format. - clientNumber: - type: string - description: The client number to identify the client. - folderDetails: - $ref: "#/components/schemas/FolderDetails" - required: [created_at, clientNumber, folderDetails] + data: + $ref: "#/components/schemas/FileDetails" + required: [type, created_at, data] - FolderDeleteEvent: + DamFileDeleteEvent: allOf: - $ref: "#/components/schemas/BaseWebhookEvent" - type: object description: | - Triggered when a folder is deleted. + Triggered when a file is deleted. properties: + type: + type: string + const: "file.deleted" + description: Type of the webhook event. created_at: type: string format: date-time description: Timestamp of when the event occurred in ISO8601 format. - clientNumber: - type: string - description: The client number to identify the client. - folderDetails: + data: type: object properties: - folderId: + fileId: type: string - description: The unique `folderId` of the deleted folder. - required: [folderId] - required: [created_at, clientNumber, folderDetails] + description: The unique `fileId` of the deleted file. + required: [fileId] + required: [type, created_at, data] SrcOptions: title: Source Options @@ -8592,23 +8572,7 @@ webhooks: "200": description: Acknowledge - file.updated: - post: - operationId: file-updated - summary: File updated - description: | - Triggered when a file is updated. - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/FileCreateUpdateEvent" - responses: - "200": - description: Acknowledge - - file.created: + dam.file.created: post: operationId: file-created summary: File created @@ -8619,74 +8583,42 @@ webhooks: content: application/json: schema: - $ref: "#/components/schemas/FileCreateUpdateEvent" + $ref: "#/components/schemas/DamFileCreateEvent" responses: "200": description: Acknowledge - file.deleted: + dam.file.updated: post: - operationId: file-deleted - summary: File deleted - description: | - Triggered when a file is deleted. - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/FileDeleteEvent" - responses: - "200": - description: Acknowledge - - folder.created: - post: - operationId: folder-created - summary: Folder created - description: | - Triggered when a folder is created. - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/FolderCreateUpdateEvent" - responses: - "200": - description: Acknowledge - - folder.updated: - post: - operationId: folder-updated - summary: Folder updated + operationId: file-updated + summary: File updated description: | - Triggered when a folder is updated. + Triggered when a file is updated. requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/FolderCreateUpdateEvent" + $ref: "#/components/schemas/DamFileUpdateEvent" responses: "200": description: Acknowledge - - folder.deleted: + + dam.file.deleted: post: - operationId: folder-deleted - summary: Folder deleted + operationId: file-deleted + summary: File deleted description: | - Triggered when a folder is deleted. + Triggered when a file is deleted. requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/FolderDeleteEvent" + $ref: "#/components/schemas/DamFileDeleteEvent" responses: "200": description: Acknowledge - + security: - basicAuth: [] From ecfd1836813820592bf639117cc52e0039bd83c2 Mon Sep 17 00:00:00 2001 From: Piyush Aryan Date: Wed, 4 Feb 2026 12:12:30 +0530 Subject: [PATCH 4/6] refactor: update operationIds for file-related webhook events to include 'dam-' prefix --- openapi/v1.0.0.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/v1.0.0.yaml b/openapi/v1.0.0.yaml index 6928ea5..0b3c6cf 100644 --- a/openapi/v1.0.0.yaml +++ b/openapi/v1.0.0.yaml @@ -8574,7 +8574,7 @@ webhooks: dam.file.created: post: - operationId: file-created + operationId: dam-file-created summary: File created description: | Triggered when a file is created. @@ -8590,7 +8590,7 @@ webhooks: dam.file.updated: post: - operationId: file-updated + operationId: dam-file-updated summary: File updated description: | Triggered when a file is updated. @@ -8606,7 +8606,7 @@ webhooks: dam.file.deleted: post: - operationId: file-deleted + operationId: dam-file-deleted summary: File deleted description: | Triggered when a file is deleted. From 1d51a28d96a25be90acb21ce83b5f236f12c0b5f Mon Sep 17 00:00:00 2001 From: Piyush Aryan Date: Wed, 4 Feb 2026 12:17:35 +0530 Subject: [PATCH 5/6] refactor: replace file-related webhook event schemas with dam-prefixed equivalents, remove folder events --- stainless-config/main.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stainless-config/main.yaml b/stainless-config/main.yaml index 2f88b7c..a9e0c0f 100644 --- a/stainless-config/main.yaml +++ b/stainless-config/main.yaml @@ -251,10 +251,9 @@ resources: UploadPreTransformErrorEvent: '#/components/schemas/UploadPreTransformErrorEvent' UploadPostTransformSuccessEvent: '#/components/schemas/UploadPostTransformSuccessEvent' UploadPostTransformErrorEvent: '#/components/schemas/UploadPostTransformErrorEvent' - FileCreateUpdateEvent: '#/components/schemas/FileCreateUpdateEvent' - FileDeleteEvent: '#/components/schemas/FileDeleteEvent' - FolderCreateUpdateEvent: '#/components/schemas/FolderCreateUpdateEvent' - FolderDeleteEvent: '#/components/schemas/FolderDeleteEvent' + DamFileCreateEvent: '#/components/schemas/DamFileCreateEvent' + DamFileUpdateEvent: '#/components/schemas/DamFileUpdateEvent' + DamFileDeleteEvent: '#/components/schemas/DamFileDeleteEvent' methods: unwrap: From 985312368fe8e29f0a44dc0d47b9f097d3defaa9 Mon Sep 17 00:00:00 2001 From: Piyush Aryan Date: Wed, 4 Feb 2026 18:42:38 +0530 Subject: [PATCH 6/6] refactor: update description for file update webhook event in schema --- openapi/v1.0.0.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/v1.0.0.yaml b/openapi/v1.0.0.yaml index 0b3c6cf..1675df0 100644 --- a/openapi/v1.0.0.yaml +++ b/openapi/v1.0.0.yaml @@ -6873,7 +6873,7 @@ components: - $ref: "#/components/schemas/BaseWebhookEvent" - type: object description: | - Triggered when a file is created. + Triggered when a file is updated. properties: type: type: string