Unlisted
Like
leads
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of simplified branch: v47View latest version
POST any lead data to this webhook for AI-powered qualification.
- Remix this val
- Set
OPENAI_API_KEYin this val's environment variables - Copy the HTTP endpoint from
main.tsinto your webhook source - Customize
PROMPT.txt - Specify which email(s) in
RECIPIENTSindigest.ts
You will receive a daily email of only your most qualified leads.
- POST any JSON to this val's HTTP endpoint. The data is forwarded along with
the instructions in
PROMPT.txtto an OpenAI agent. The agent uses its reasoning and web search tool to determine if the lead is anidealCustomerand explains itsreasoning. - The input data and agent results are saved in the
leadssqlite table, and the agent's entire run history is saved in blob storage. - The
main.tsdashboard shows a history of all leads, ideal customers first. Clicking any lead shows the agent's reasoning and all data from the process. digest.tsruns daily by default. Feel free to change the timing and frequency.
Add ?source=rb2b (or any label) to the webhook URL to track where leads came from.