From 64d219edecd11125f47ea23565398952ad630311 Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Mon, 6 Nov 2023 20:36:29 +0100 Subject: [PATCH] Limit 178fcf913a API access to conversations (#2408) --- .../api/v1/w/[wId]/assistant/conversations/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/front/pages/api/v1/w/[wId]/assistant/conversations/index.ts b/front/pages/api/v1/w/[wId]/assistant/conversations/index.ts index aca1154eb4e2..533234c70ac8 100644 --- a/front/pages/api/v1/w/[wId]/assistant/conversations/index.ts +++ b/front/pages/api/v1/w/[wId]/assistant/conversations/index.ts @@ -73,6 +73,17 @@ async function handler( }); } + if (owner.sId === "178fcf913a") { + return apiError(req, res, { + status_code: 400, + api_error: { + type: "invalid_request_error", + message: + "You exceedded the rate limit for API access. Please contact team@dust.tt.", + }, + }); + } + switch (req.method) { case "POST": const bodyValidation = PostConversationsRequestBodySchema.decode(