API Quickstart
Get up and running with the Bento API in under 5 minutes. By the end of this guide, you'll have tracked your first event and verified it appears in your Bento dashboard.
Get Your API Keys
Before making API calls, you'll need three credentials:
- Log in to Bento
- Go to Settings → API Keys
- Copy these values:
- Publishable Key (starts with
pk_) - Secret Key (starts with
sk_) - Site UUID
- Publishable Key (starts with
Keep your Secret Key private. Never expose it in client-side code or commit it to version control.
Track Your First Event
The Events API is the most common way to interact with Bento. Let's track a simple event to make sure everything is working.
Using cURL
Replace the placeholder values with your actual credentials:
curl -X POST 'https://app.bentonow.com/api/v1/batch/events?site_uuid=YOUR_SITE_UUID' \
-H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
-H 'User-Agent: MyApp/1.0' \
-H 'Content-Type: application/json' \
-d '{
"events": [{
"type": "$custom.quickstart_test",
"email": "test@example.com",
"fields": {
"first_name": "Test",
"source": "api_quickstart"
}
}]
}'
Don't forget the User-Agent header! Requests without it will be blocked by Cloudflare.
Quick Auth Setup
Generate your Base64 credentials:
echo -n "YOUR_PUBLISHABLE_KEY:YOUR_SECRET_KEY" | base64
Or use the URL shortcut (credentials in the URL):
curl -X POST 'https://YOUR_PUBLISHABLE_KEY:YOUR_SECRET_KEY@app.bentonow.com/api/v1/batch/events?site_uuid=YOUR_SITE_UUID' \
-H 'User-Agent: MyApp/1.0' \
-H 'Content-Type: application/json' \
-d '{
"events": [{
"type": "$custom.quickstart_test",
"email": "YOUR_EMAIL@example.com"
}]
}'
Expected Response
A successful request returns:
{
"results": 1,
"failed": 0
}
Verify It Worked
Let's confirm your event was recorded:
- Go to your Bento Dashboard
- Click Search in the top navigation
- Search for
test@example.com(or whatever email you used) - Click on the subscriber profile
- Look for the
$custom.quickstart_testevent in their activity timeline
You should see:
- The event type you sent
- Any fields you included (like
first_name) - The timestamp of when it was received
Events typically appear within seconds, but can take up to 30 seconds during high-traffic periods.
Next Steps
Now that you've made your first API call, here's what to explore next:
Learn the Core APIs
| API | Use Case |
|---|---|
| Events API | Track user actions, trigger automations |
| Subscribers API | Import/export contacts, update profiles |
| Emails API | Send transactional emails |
| Tags API | Organize subscribers with tags |
Use an SDK
Skip the raw HTTP calls and use our official SDKs:
Common Patterns
- User signups: Track
$signed_upevents when users create accounts - Purchases: Track
$purchaseevents with value and product details - Page views: Use Bento.js for client-side tracking
- Transactional emails: Send password resets, receipts, and notifications via the Emails API
Need Help?
- Authentication Guide - Detailed auth setup
- Troubleshooting - Common issues and solutions
- FAQ - Frequently asked questions
- Discord - Get help from the community
