API Reference
Use the GetIntent REST API to personalize content programmatically. All requests require an API key.
Base URL
https://getintent.co/apiAuthentication
Include your API key in the X-API-Key header on every request. API keys start with gi_.
curl -X POST https://getintent.co/api/v1/personalize \
-H "Content-Type: application/json" \
-H "X-API-Key: gi_your_api_key" \
-d '{ ... }'Generate API keys in Dashboard > Settings > API Keys. Keys can be revoked at any time from the same page.
Rate Limits
The API is rate-limited to 200 requests per minute per organization. If you exceed the limit, you'll receive a 429 response with a Retry-After header indicating when you can retry.
POST/v1/personalize
Generate personalized content for a page based on visitor intent signals. This is the same endpoint the pixel script calls internally.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| siteId | string | Yes | Your site ID (found in Dashboard > Install) |
| utmParams | object | Yes | Object with utm_source, utm_medium, utm_campaign, utm_term, utm_content |
| selectors | string[] | Yes | CSS selectors for elements to personalize |
| intent | string | No | Direct intent signal (takes priority over utm_term) |
| pageContext | string | No | Additional context about the page content |
| visitorId | string | No | Unique visitor identifier for cross-session tracking |
| sessionId | string | No | Session identifier for grouping page views |
Example Request
curl -X POST https://getintent.co/api/v1/personalize \
-H "Content-Type: application/json" \
-H "X-API-Key: gi_your_api_key" \
-d '{
"siteId": "YOUR_SITE_ID",
"utmParams": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "brand",
"utm_term": "crm for startups"
},
"selectors": ["h1", ".hero-subtitle", ".cta-button"],
"intent": "crm for startups"
}'Response
Returns personalized content mapped to each selector, along with metadata about the personalization.
{
"personalizations": {
"h1": "The CRM Built for Startups",
".hero-subtitle": "Start closing more deals from day one",
".cta-button": "Try Free for 14 Days"
},
"confidence": 0.85,
"experimentVariant": "personalized",
"cached": false
}Pixel Script
For most use cases, the pixel script handles everything automatically. Embed it on your page and it will call the personalization API, replace content, and track conversions without any custom code.
<script
src="https://getintent.co/api/pixel"
data-api-key="gi_your_api_key"
data-site-id="YOUR_SITE_ID"
></script>Script Attributes
| Attribute | Required | Description |
|---|---|---|
| data-api-key | Yes | Your API key (starts with gi_) |
| data-site-id | Yes | Your site ID |
| data-debug | No | Set to "true" to enable verbose console logging |
| data-custom-* | No | Custom parameters passed to the personalization engine (e.g. data-custom-industry="saas") |
JavaScript API
The pixel script exposes global functions and configuration for advanced use cases.
Track Conversion
// Basic conversion
window.getintentTrackConversion({})
// Named conversion with value
window.getintentTrackConversion({
name: 'purchase',
value: 149.99
})
// Custom metadata
window.getintentTrackConversion({
name: 'signup',
value: 0,
plan: 'free',
source: 'pricing-page'
})The function accepts a single object parameter. All properties are spread into the conversion event data sent to GetIntent.
Custom Parameters via JavaScript
// Set before the pixel script loads
window.getintentConfig = {
customParams: {
industry: "saas",
plan: "enterprise"
}
};Error Codes
| Code | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 404 | Site or organization not found |
| 429 | Rate limit exceeded (200 req/min per org). Check the Retry-After header for when to retry. |
| 500 | Internal server error |
CORS
All API endpoints include permissive CORS headers (Access-Control-Allow-Origin: *) so you can call them from any domain. The pixel script handles CORS automatically.