# Submit a data event 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 of . 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 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 , or call the method directly on the current user object (e.g. ). | Type | Description | Example | | :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | | String | The value is a JSON String | | | Number | The value is a JSON Number | | | Date | The key ends with the String and the value is a Unix timestamp, assumed to be in the UTC timezone. | | | Link | The value is a HTTP or HTTPS URI. | | | Rich Link | The value is a JSON object that contains and keys. | | | Monetary Amount | The value is a JSON object that contains and keys. The key is a positive integer representing the amount in cents. The price in the example to the right denotes €349.99. | | When submitting events for Leads, you will need to specify the Lead's . - We currently limit the number of tracked metadata keys to 10 per event. Once the quota is reached, we ignore any further keys we receive. The first 10 metadata keys are determined by the order in which they are sent in with the event. - It is not possible to change the metadata keys once the event has been sent. A new event will need to be created with the new keys and you can archive the old one. - There might be up to 24 hrs delay when you send a new metadata for an existing event. 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 to send a second granularity Unix timestamp in the field. Duplicated events are responded to using the normal code - an error is not thrown, however repeat requests will be counted against any rate limit that is in place. ### HTTP API Responses - Successful responses to submitted events return with an empty body. - Unauthorised access will be rejected with a or response code. - Events sent about users that cannot be found will return a . - Event lists containing duplicate events will have those duplicates ignored. - Server errors will return a response code and may contain an error message in the body. Endpoint: POST /events Version: 2.13 Security: bearerAuth ## Header parameters: - `Intercom-Version` (string) Intercom API version.By default, it's equal to the version set in the app package. Enum: "1.0", "1.1", "1.2", "1.3", "1.4", "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "Unstable" ## Request fields (application/json): - `event_name` (string) 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 . Example: "invited-friend" - `created_at` (integer) The time the event occurred as a UTC Unix timestamp Example: 1671028894 - `user_id` (string) Your identifier for the user. Example: "314159" - `id` (string) The unique identifier for the contact (lead or user) which is given by Intercom. Example: "8a88a590-e1c3-41e2-a502-e0649dbf721c" - `email` (string) An email address for your user. An email should only be used where your application uses email to uniquely identify users. Example: "frodo.baggins@example.com" - `metadata` (object) Optional metadata about the event. Example: {"invite_code":"ADDAFRIEND"} ## Response 401 fields (application/json): - `type` (string, required) The type is error.list Example: "error.list" - `request_id` (string,null) Example: "f93ecfa8-d08a-4325-8694-89aeb89c8f85" - `errors` (array, required) An array of one or more error objects - `errors.code` (string, required) A string indicating the kind of error, used to further qualify the HTTP response code Example: "unauthorized" - `errors.message` (string,null) Optional. Human readable description of the error. Example: "Access Token Invalid" - `errors.field` (string,null) Optional. Used to identify a particular field or query parameter that was in error. Example: "email"