Add event

/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 typesPermissions needed
Public accessEvents > Set
Private accessEvents > Set

Read more about:

Path parameters

ParameterTypeDescriptionRequired
projectTokenstringThe ID of your project.Required

Body parameters

ParameterTypeDescriptionRequired
customer_idsobjectOne or more hard and/or soft customer IDs are required. The most common ones include: registered.At least 1 required.
propertiesobjectOne 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.
timestampstringUNIX timestamp of when the event was created. If not provided, the current time is used. Timestamp supports a date-time in an ISO8601 format. The value should be in seconds as there is no automatic recognition of milliseconds based on character number.Optional
event_typestringType of the event.Required

Headers

HeadersTypeRequiredDescription
authorizationstringUsed for authentication. Read more in the Authentication section.Required
content-typestringapplication/jsonRequired

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:

ErrorDescription
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": "Field project_id is required"
}

📘

Asynchronous endpoint

Note that this endpoint is asynchronous, which means that success response rate means only that the request is queued to be processed later, not the item was successfully updated.

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!