POST /events

You will need an Access Token that has write permissions to send Events. Once you have a key you can submit events via POST to the Events resource, which is located at https://api.intercom.io/events, or you can send events using one of the client libraries. When working with the HTTP API directly a client should send the event with a Content-Type of application/json.

When using the JavaScript API, adding the code to your app makes the Events API available. Once added, you can submit an event using the trackEvent method. This will associate the event with the Lead or currently logged-in user or logged-out visitor/lead and send it to Intercom. The final parameter is a map that can be used to send optional metadata about the event.

With the Ruby client you pass a hash describing the event to Intercom::Event.create, or call the track_user method directly on the current user object (e.g. user.track_event).

NB: For the JSON object types, please note that we do not currently support nested JSON structure.

TypeDescriptionExample
StringThe value is a JSON String"source":"desktop"
NumberThe value is a JSON Number"load": 3.67
DateThe key ends with the String _date and the value is a Unix timestamp, assumed to be in the UTC timezone."contact_date": 1392036272
LinkThe value is a HTTP or HTTPS URI."article": "https://example.org/ab1de.html"
Rich LinkThe value is a JSON object that contains url and value keys."article": {"url": "https://example.org/ab1de.html", "value":"the dude abides"}
Monetary AmountThe value is a JSON object that contains amount and currency keys. The amount key is a positive integer representing the amount in cents. The price in the example to the right denotes €349.99."price": {"amount": 34999, "currency": "eur"}

Lead Events

When submitting events for Leads, you will need to specify the Lead's id.

Metadata behaviour

Event de-duplication

The API may detect and ignore duplicate events. Each event is uniquely identified as a combination of the following data - the Workspace identifier, the Contact external identifier, the Data Event name and the Data Event created time. As a result, it is strongly recommended to send a second granularity Unix timestamp in the created_at field.

Duplicated events are responded to using the normal 202 Accepted code - an error is not thrown, however repeat requests will be counted against any rate limit that is in place.

HTTP API Responses

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Intercom-Version String No

Possible values:

  • "1.1"
  • "2.0"
  • "1.0"
  • "2.9"
  • "Unstable"
  • "1.3"
  • "2.2"
  • "2.12"
  • "1.2"
  • "2.1"
  • "2.4"
  • "1.4"
  • "2.3"
  • "2.6"
  • "2.5"
  • "2.8"
  • "2.10"
  • "2.7"
  • "2.11"

Default value: "2.12"

Request body fields

Name Type Required Description
id String No

The unique identifier for the contact (lead or user) which is given by Intercom.

email String No

An email address for your user. An email should only be used where your application uses email to uniquely identify users.

metadata Object No

Optional metadata about the event.

event_name String No

The name of the event that occurred. This is presented to your App's admins when filtering and creating segments - a good event name is typically a past tense 'verb-noun' combination, to improve readability, for example updated-plan.

created_at Integer No

The time the event occurred as a UTC Unix timestamp

user_id String No

Your identifier for the user.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.