diff --git a/CHANGELOG.md b/CHANGELOG.md index eb90870b..cc280f1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### Unreleased +* Fix for the webhook rotate secret calling the wrong endpoint + ### 7.6.1 / 2024-10-30 * Add support for filtering events by masterEventID * Add support for gzip compression diff --git a/src/resources/webhooks.ts b/src/resources/webhooks.ts index 9c7fe3a0..e80d58d3 100644 --- a/src/resources/webhooks.ts +++ b/src/resources/webhooks.ts @@ -131,7 +131,7 @@ export class Webhooks extends Resource { NylasResponse > { return super._create({ - path: `/v3/webhooks/${webhookId}/rotate-secret`, + path: `/v3/webhooks/rotate-secret/${webhookId}`, requestBody: {}, overrides, }); diff --git a/tests/resources/webhooks.spec.ts b/tests/resources/webhooks.spec.ts index 87005c4d..0c22b9cc 100644 --- a/tests/resources/webhooks.spec.ts +++ b/tests/resources/webhooks.spec.ts @@ -162,7 +162,7 @@ describe('Webhooks', () => { expect(apiClient.request).toHaveBeenCalledWith({ method: 'POST', - path: '/v3/webhooks/webhook123/rotate-secret', + path: '/v3/webhooks/rotate-secret/webhook123', body: {}, overrides: { apiUri: 'https://test.api.nylas.com',