/track/v2/projects/{projectToken}/customers/events

Add events to a customer. Use this if you want to add new events to a specified single customer profile.

Definition

Authorization

In this API call you can use any of these 2 types of authorization accesses:

Available access types

Permissions needed

Public access

Events > Set

Private access

Events > Set

Read more about:

Path parameters

Parameter

Type

Description

Required

projectToken

string

The ID of your project.

Required

Body parameters

Parameter

Type

Description

Required

customer_ids

object

One or more hard and/or soft customer IDs are required. The most common ones include: registered.

At least 1 required.

properties

object

One or more of the event properties (attributes) are required. With event_type : purchase, this could be, e.g.: total_price, voucher_code, etc.

At least 1 required.

timestamp

string

UNIX timestamp of when the event was created. If not provided, the current time is used. Timestamp supports a date-time in a ISO8601 format.

Optional

event_type

string

Type of the event.

Required

Headers

Headers

Type

Required

Description

authorization

string

Used for authentication. Read more in the Authentication section.

Required

content-type

string

application/json

Required

Limitations

Message size

  • An event message must be less than 800 KBytes
  • The value of every event property must be less than 16 KBytes

It is strongly prohibited to use this route for sending large volumes of data. We recommend using Batch commands for more than 1 action (e.g. customer update, adding an event) and Imports (and Import API) for large volumes of data, instead.

Error handling

Some specific errors that you might encounter with this request involve:

Error

Description

HTTP 200 with success = false (similar to HTTP 400)

Request to add event was received but it could not be processed. Retrying will not help, you need to look for a mistake in your request.

{
    "success": false,
    "errors": [“Invalid customer_id”]
}

Tips

See our documentation about deduplication of events and ordering of events with identical timestamps. Both features work the same for imported and/or tracked events.

Language
Click Try It! to start a request and see the response here!