Server-Side API Integration
Send tracking events to Intempt directly over HTTP from your backend, with no SDK installed on either end.
Overview
Intempt's REST API lets you send events straight from your own backend, with no SDK installed on either end. Use it when your platform has no official SDK, when events come from a batch job or cron process, or when you're syncing historical data from another system.
How it works
Server-side integration starts with an API source, a source type built specifically for this purpose. Unlike a JavaScript, iOS, or Android source, an API source has no installation snippet and no config to fill in. Create it, and Intempt returns a generated API key you use to authenticate every request sent to it.
Every event you send goes to that source's track endpoint, under your organization and project:
POST /v1/{orgName}/projects/{projectName}/sources/{sourceId}/trackThe request body uses the same track/payload structure as every other source type. See Track Data for the full parameter table and worked examples.
📘 Good to know
An API source accepts any event name and any custom data fields. There's no fixed schema to configure ahead of time, unlike sources such as HubSpot or Shopify that map to a fixed set of fields.
Getting started
- Create an API source. Send a
POSTrequest to the sources endpoint withtypeset toapi:
curl -X POST "https://api.intempt.com/v1/{orgName}/projects/{projectName}/sources" \
-H "Content-Type: application/json" \
-d '{
"title": "Backend Integration",
"type": "api"
}'The response includes the new source's id and a generated apiKey:
{
"id": 111111111111111111,
"title": "Backend Integration",
"type": "api",
"apiKey": "generated-api-key",
"active": true
}Save both values. id is the sourceId used in the track endpoint's path, and apiKey authenticates every request you send to it.
- Send events to the track endpoint. Post events to the source's track endpoint, passing the
apiKeyfrom step 1 as a query parameter:
curl -X POST "https://api.intempt.com/v1/{orgName}/projects/{projectName}/sources/{sourceId}/track?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"track": [
{
"name": "Purchase",
"payload": [
{
"eventId": "generated-event-id",
"userId": "custom@intempt.com",
"timestamp": 1714631904000,
"data": {
"amount": 150,
"productName": "Wine",
"quantity": 4
}
}
]
}
]
}'A single request can carry multiple event groups and multiple payload entries per group. See Track Data for the complete field reference, including identifying users and accounts, merging profiles, and batch requests.
- Verify events are arriving. Check Live data feed in the Intempt console to confirm events from your API source are showing up in real time.
Use cases
- Languages without an SDK. Send events from a backend written in a language Intempt doesn't ship a client library for.
- Batch and cron jobs. Push events from a nightly job or data pipeline that runs outside a request/response cycle.
- Data warehouse sync. Replay historical events from a warehouse export into Intempt.
- Server-to-server webhooks. Forward events from a third-party webhook your backend receives into Intempt.
- Migrating from another platform. Re-emit events already captured by another analytics tool while you wait on a native connector.
Where to go next
- Track Data for the full track endpoint reference, including identifying users and accounts, aliasing, and batch examples.
- Creating a Source for the other source types (JavaScript, Node.js, iOS, Android) and when to use each.
- Authentication and API keys for managing keys used across the wider REST API, beyond a single source.
- Server-Side Experiments Overview for running experiments and personalization from your backend using the same API key model.
- Live data feed for confirming events arrive after you integrate.
Data import
You can use a CSV (comma-separated values) file to import users and accounts or events into your Intempt account.
Integration Catalog
A reference list of every source, platform, and destination Intempt supports, with what each one connects, how you authorize it, and what it sends or receives.
