Skip to main content
POST/products-by-id/:custom_id/product_event/

Create product event

You can create a product event assigned to a specific user.

Attributes

Optional unless marked required

user_idintegerrequired
A unique identifier for the user which is given by User automatically.
user_custom_idstringrequired
The unique identifier for the user which is provided by the client.
custom_idstring
A unique identifier for the product provided by the client.
datajsonrequired
A valid JSON object with additional data (attributes). Special "custom_data" key may contain additional custom json defined data unique per product event occurence.
event_typestringrequired
A predefined event type. See the available types in What Is a Product Event.
timestamptimestamprequired
A datetime when an event occured in UNIX format.

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/products-by-id/:custom_id/product_event/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"user_custom_id": "jane-doe",
"event_type": "add to cart",
"timestamp": 1794303223,
"data": {
"quantity": 1
}
}'

Response examples​

{
"id": 388
}

Response fields​

Fields returned in the 201 Created response body.

idinteger
ID of the product.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.