Reach out with questions, bugs, or suggestions. We'll respond ASAP. Your message is sent! We'll respond via email shortly.

Server-Side API

Our server-side APIs allow you to send data from your backend into Heap. Generally, we recommend you use our automatic client-side trackers for web and iOS whenever possible.

We've built dedicated server-side libraries for the following platforms:

To send data from a different platform, just follow the HTTP spec below.

Track

Heap allows you to send custom events from any of your servers. A server-side event can be created by issuing a POST to https://heapanalytics.com/api/track with a JSON body containing the following keys:

This example CURL command logs a "Send Transactional Email" event for a (hypothetical) user identified as alice@example.com in your app:

  $ curl \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "11",
    "identity": "alice@example.com",
    "event": "Send Transactional Email",
    "properties": {
      "subject": "Welcome to My App!",
      "variation": "A"
    }
  }' \
  https://heapanalytics.com/api/track

Add User Properties

You can also assign custom properties to any of your users from your servers. This can be done by issuing a POST to https://heapanalytics.com/api/add_user_properties with a JSON body containing the following keys:

This example CURL command assigns demographic data to a (hypothetical) user identified as bob@example.com in your app:

  $ curl \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "11",
    "identity": "bob@example.com",
    "properties": {
      "age": "25",
      "language": "English",
      "profession": "Scientist"
    }
  }' \
  https://heapanalytics.com/api/add_user_properties