diff --git a/lib/nylas/resources/webhooks.rb b/lib/nylas/resources/webhooks.rb index dfcb9e06..42e7bd0d 100644 --- a/lib/nylas/resources/webhooks.rb +++ b/lib/nylas/resources/webhooks.rb @@ -89,8 +89,8 @@ def destroy(webhook_id:) # @param webhook_id [String] The ID of the webhook destination to update. # @return [Array(Hash, String)] The updated webhook destination and API Request ID. def rotate_secret(webhook_id:) - put( - path: "#{api_uri}/v3/webhooks/#{webhook_id}/rotate-secret", + post( + path: "#{api_uri}/v3/webhooks/rotate-secret/#{webhook_id}", request_body: {} ) end diff --git a/spec/nylas/resources/webhooks_spec.rb b/spec/nylas/resources/webhooks_spec.rb index ebd69dfc..f1067cef 100644 --- a/spec/nylas/resources/webhooks_spec.rb +++ b/spec/nylas/resources/webhooks_spec.rb @@ -100,9 +100,9 @@ describe "#rotate_secret" do it "calls the put method with the correct parameters" do webhook_id = "webhook-123" - path = "#{api_uri}/v3/webhooks/#{webhook_id}/rotate-secret" + path = "#{api_uri}/v3/webhooks/rotate-secret/#{webhook_id}" - allow(webhooks).to receive(:put) + allow(webhooks).to receive(:post) .with(path: path, request_body: {}) webhooks.rotate_secret(webhook_id: webhook_id)