5 minute setup
Quickstart
Start collecting data from your website in 3 simple steps.
Prerequisites
- A 1db account (sign up for free)
- A website or app where you want to collect data
1
Create a Website & Form
First, create a website in your dashboard. Each website gets its own API endpoint. Then create a form to define what data you want to collect.
- 1.Go to Websites and click "New Website"
- 2.Enter a name and optional domain
- 3.Click "Create Form" and choose a template or start from scratch
- 4.Configure your form fields and save
2
Get Your API Key
Each website automatically gets an API key. You can also create additional keys in Settings.
bash
# Your API key will look like this: 1db_live_abc123...xyz789Keep your API key secret
Never expose your API key in client-side code without a server intermediary.
3
Submit Your First Lead
Send a POST request to create a lead. Here's a quick example using cURL:
terminal
curl -X POST https://your-deployment.convex.site/v1/leads \
-H "Content-Type: application/json" \
-H "X-API-Key: 1db_live_YOUR_API_KEY" \
-d '{
"formSlug": "contact-form",
"email": "hello@example.com",
"name": "Jane Doe",
"message": "Hello from 1db!"
}'Or integrate directly in your app:
submit-lead.ts
// Using fetch (works everywhere)
async function submitLead(formData: Record<string, unknown>) {
const response = await fetch(
"https://your-deployment.convex.site/v1/leads",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.ONEDB_API_KEY,
},
body: JSON.stringify({
formSlug: "contact-form",
...formData,
}),
}
);
if (!response.ok) throw new Error("Failed to submit");
return response.json();
}You're All Set!
Your lead will appear in your dashboard within seconds. From there you can:
- View and search all your leads
- Set up automatic HubSpot/Salesforce sync
- Configure email notifications
- Add webhooks for custom integrations