Reference

API Reference

Use the GetIntent REST API to personalize content programmatically. All requests require an API key.

Base URL

https://getintent.co/api

Authentication

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

FieldTypeRequiredDescription
siteIdstringYesYour site ID (found in Dashboard > Install)
utmParamsobjectYesObject with utm_source, utm_medium, utm_campaign, utm_term, utm_content
selectorsstring[]YesCSS selectors for elements to personalize
intentstringNoDirect intent signal (takes priority over utm_term)
pageContextstringNoAdditional context about the page content
visitorIdstringNoUnique visitor identifier for cross-session tracking
sessionIdstringNoSession 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

AttributeRequiredDescription
data-api-keyYesYour API key (starts with gi_)
data-site-idYesYour site ID
data-debugNoSet to "true" to enable verbose console logging
data-custom-*NoCustom 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

CodeMeaning
401Missing or invalid API key
404Site or organization not found
429Rate limit exceeded (200 req/min per org). Check the Retry-After header for when to retry.
500Internal 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.