Inbound Tool
Getting Started with Inbound API
Learn how to integrate SixtyFour AI into your Next.js application
Prerequisites
- A Next.js application (version 13 or higher recommended)
- Your SixtyFour AI API credentials:
SIXTYFOUR_INBOUND_API_KEY
SIXTYFOUR_ORG_ID
Step 1: Set Up Environment Variables
First, add your SixtyFour AI credentials to your .env.local
file:
Once you have an active subscription, you will see your API Key in the api-keys tab like this:
Your org-id is visible on the sidebar when you hover over your profile picture.
Note: While we’re using
NEXT_PUBLIC_
prefix for simplicity in this example, in production you should handle the API key server-side only.
Step 2: Create the API Route
Create a new API route in your Next.js application at app/api/interestForm/route.ts
:
Step 3: Create the Frontend Form Component
Create a new component for your lead capture form. Here’s an example using React and Shadcn UI:
Step 4: Add the Form to Your Page
Import and use the LeadCaptureForm
component in your page:
How It Works
- When a user submits the form, the data is sent to your Next.js API route
- The API route adds tracking information and forwards the data to SixtyFour AI
- SixtyFour AI processes the lead and:
- If qualified, sends an enriched profile to your email within ~60 seconds
- All leads (qualified or not) appear on your SixtyFour dashboard
- The form prevents duplicate submissions using session storage
Best Practices
- Security: In production, consider moving the API key to server-side only
- Error Handling: Implement proper error messages for users
- Validation: Add client-side validation before submission
- Loading States: Show appropriate loading states during submission
- Success States: Provide clear feedback when submission is successful
Troubleshooting
If you encounter issues:
- Check your environment variables are correctly set
- Verify the API endpoint is correct
- Ensure your API key has the necessary permissions
- Check the browser console and server logs for errors
- Contact support at saarth@sixtyfour.ai for assistance