Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(openapi): declare the 400 responses of webhook create and update

Yudhi Armyndharis6efdcc204deb
diff --git a/src/modules/webhook/webhook.controller.ts b/src/modules/webhook/webhook.controller.ts
index 2261e7bf9..fa85850be 100644
--- a/src/modules/webhook/webhook.controller.ts
+++ b/src/modules/webhook/webhook.controller.ts
@@ -19,6 +19,11 @@ export class WebhookController {
description: 'Webhook created',
type: WebhookResponseDto,
})
+ @ApiResponse({
+ status: 400,
+ description:
+ 'Invalid body, the URL embeds credentials or is blocked by the SSRF policy, or the per-session webhook limit is reached',
+ })
@ApiResponse({ status: 404, description: 'Session not found' })
async create(@Param('sessionId') sessionId: string, @Body() dto: CreateWebhookDto): Promise<WebhookResponseDto> {
return WebhookResponseDto.fromEntity(await this.webhookService.create(sessionId, dto));
@@ -62,6 +67,10 @@ export class WebhookController {
description: 'Webhook updated',
type: WebhookResponseDto,
})
+ @ApiResponse({
+ status: 400,
+ description: 'Invalid body, or a changed URL embeds credentials or is blocked by the SSRF policy',
+ })
@ApiResponse({ status: 404, description: 'Webhook not found' })
async update(
@Param('sessionId') sessionId: string,