diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7da9e3..730a4d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Unreleased * Add support for filtering events by attendee email * Add buffer support for file attachments +* Change rotate secret endpoint from being a PUT to a POST call * Fix issue where crypto import was causing downstream Jest incompatibilities ### 7.5.2 / 2024-07-12 diff --git a/src/resources/webhooks.ts b/src/resources/webhooks.ts index 61f84029..9c7fe3a0 100644 --- a/src/resources/webhooks.ts +++ b/src/resources/webhooks.ts @@ -130,7 +130,7 @@ export class Webhooks extends Resource { }: DestroyWebhookParams & Overrides): Promise< NylasResponse > { - return super._update({ + return super._create({ path: `/v3/webhooks/${webhookId}/rotate-secret`, requestBody: {}, overrides, diff --git a/tests/resources/webhooks.spec.ts b/tests/resources/webhooks.spec.ts index 524c58a5..87005c4d 100644 --- a/tests/resources/webhooks.spec.ts +++ b/tests/resources/webhooks.spec.ts @@ -161,7 +161,7 @@ describe('Webhooks', () => { }); expect(apiClient.request).toHaveBeenCalledWith({ - method: 'PUT', + method: 'POST', path: '/v3/webhooks/webhook123/rotate-secret', body: {}, overrides: {