canonical: https://jentic.com/apis/heap.io/heap

# Heap API

Heap is a digital analytics platform that automatically captures user interactions in web and mobile apps. The server-side API supplements the autocapture by letting backend services track custom events, identify users, attach user and account properties, and submit bulk operations. It also exposes a privacy endpoint for user deletion and an integration-track variant for partner platforms. Product, growth, and data teams use it to enrich autocaptured client events with server-known facts like billing tier, signup source, or backend-only events.

## For AI agents

Track server-side events, identify users, attach user and account properties, and run bulk operations or privacy-driven user deletions in Heap.

## Scope

Does not handle session replay, A/B testing, or report querying - use for server-side event ingestion and user/account property enrichment only.

## Capabilities

- Track custom server-side events through POST /api/track
- Identify a user and attach a user_id through POST /api/v1/identify
- Add or update user-level properties via POST /api/add_user_properties
- Add or update account-level properties via POST /api/add_account_properties
- Send partner-integration events through POST /api/integrations/track
- Mint a public auth token via POST /api/public/v0/auth_token for downstream calls

## Use cases

### Server-Side Conversion Tracking

Some conversions - payment captures, subscription upgrades, refunds - happen on the backend and are not visible to the autocapture script. POST /api/track to record these events with the user identity and any context properties so they appear in Heap funnels alongside client events. This gives a complete picture of the user journey end-to-end.

Example prompt: POST /api/track with identity, event 'subscription_upgraded', and properties { plan: 'pro' } and verify HTTP 200

### User and Account Property Enrichment

Heap's autocapture cannot see facts like billing plan, customer success tier, or industry segment. Use /api/add_user_properties and /api/add_account_properties to push those values from the backend so analysts can segment the entire autocaptured event stream by them. Bulk-update properties on schedule whenever the source-of-truth in your CRM or billing system changes.

Example prompt: POST /api/add_user_properties for a user with properties { plan: 'enterprise', mrr: 1500 } and confirm a 200 response

### Privacy-Compliant User Identification

After a user signs up or logs in, POST /api/v1/identify to bind the anonymous Heap session to your stable user_id, then push a known-user event through /api/track. This stitches anonymous and identified sessions in Heap reports and supports privacy operations because every event is tied to an identifiable user_id you control.

Example prompt: POST /api/v1/identify with the user's email and your internal user_id immediately after login

### AI Agent Analytics Updates via Jentic

An ops agent watching billing webhooks searches Jentic for 'update analytics user properties' and Jentic returns Heap's /api/add_user_properties operation. The agent reads the new MRR from the webhook payload and pushes it to Heap, all without holding the Heap app_id directly because Jentic securely stores it. This makes Heap a write-target for agent-driven enrichment workflows.

Example prompt: Use Jentic search 'update analytics user properties' to load /api/add_user_properties and execute with the user's email and MRR

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /api/track | Track a server-side event |
| POST | /api/v1/identify | Identify a user |
| POST | /api/add_user_properties | Add user-level properties |
| POST | /api/add_account_properties | Add account-level properties |
| POST | /api/integrations/track | Send a partner-integration event |
| POST | /api/public/v0/auth_token | Mint a public auth token |

## Key resources

- **Track** — Track server-side events via /api/track
- **Identify** — Bind anonymous sessions to a user_id via /api/v1/identify
- **User Properties** — Attach user-level properties via /api/add_user_properties
- **Account Properties** — Attach account-level properties via /api/add_account_properties
- **Integrations Track** — Send events from partner integrations via /api/integrations/track
- **Auth Token** — Mint a public auth token via /api/public/v0/auth_token

## Why Jentic

- **Setup:** Wiring Heap by hand means choosing the right US or EU host, deciding between the app_id header and basic auth, and placing the app_id in the request body on every ingestion call. Through Jentic you install once, import the Heap API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Heap sends its target in the request body across ingestion endpoints (/api/track, /api/v1/identify, /api/add_user_properties), so limit the agent to the operations it needs, such as tracking an event or updating user properties. You choose the operations it may call, so anything beyond that set is not included unless you add it.
- **Credential handling:** Your Heap app_id is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'track an event' or 'update analytics user properties', and Jentic returns the matching Heap operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Amplitude API** — Amplitude offers an event-based product analytics platform with similar server-side track and identify endpoints
- **Mixpanel API** — Mixpanel covers similar event tracking with a strong query and reporting layer
- **Segment API** — Segment fans out track and identify calls to multiple destinations including Heap

## FAQ

### What authentication does the Heap API use?

The API supports two schemes: an app_id header (apiKey scheme) for the standard server-side endpoints, and HTTP Basic auth on /api/public/v0/auth_token. Jentic stores the app_id in the vault and attaches it on each call.

### Can I track events server-side with the Heap API?

Yes. POST /api/track with your app_id, the user identity, an event name, and any custom properties. The event then appears alongside autocaptured client events in your Heap project.

### How do I attach a custom property to a user?

POST /api/add_user_properties with the user's identity (identity or email) and a properties object. The properties are merged onto the user's profile and become available for segmentation in Heap reports.

### What are the rate limits for the Heap API?

Heap does not publish a single hard rate limit, but high-volume integrations should batch via the integrations-track and bulk endpoints rather than per-event posts. The EU region is hosted at c.eu.heap-api.com - point your client there to keep traffic in-region.

### How do I update a Heap user property through Jentic?

Search Jentic for 'update analytics user properties', load the /api/add_user_properties operation for heap.io, and execute with the user's email and the property to set. Jentic injects the app_id from the vault.

### Does Heap support EU data residency?

Yes. The spec lists https://c.eu.heap-api.com as an alternative server. Use it as the base URL for projects provisioned in the EU region; the endpoint paths are identical to the US server.

### Can I limit what my agent is allowed to do with the Heap API?

Yes. Because you run Jentic One yourself, you decide which Heap operations the agent can call, so you can allow just tracking a server-side event through /api/track or updating a profile through /api/add_user_properties while excluding everything else. Since Heap carries its target in the request body across ingestion endpoints like /api/track, /api/v1/identify, and /api/add_user_properties, the agent can only reach the operations you grant it and nothing beyond that set. Your own rules also govern which stored credential the agent may use at execution time, so the Heap app_id is applied only for the calls you have approved.
