Unknown job exception Jenkins due to no branch re-indexing

I have a Lambda function sitting between GitHub WebHook and Jenkins Server.
So the Github Webhook talks to AWS Lambda function (not the /github-webhook endpoint). I need this lambda function to take care of few things before triggering builds on Jenkins.

Whenever a new PR is made, the branch isn’t getting discovered by Jenkins Server. As a result, I am unable to trigger the build job (on-demand) as it gives “Unknown job exception”.

Previously, jenkins-server/github-webhook directly communicated with jenkins and it would ensure PR branch is discovered and builds are triggered automatically. But I want to stop automatic triggering of PR commits and only build when a specific comment is made. For this, I disabled the Jenkins-server/github-webhook and made a new webhook to talk to Lambda (it works). Just that, I’m unable to find API to pass pull-request event info or branch re-indexing API. Any idea how to solve this problem?