Skip to main content
POST/products/:id/product_event/

Create product event

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

Attributes

Optional unless marked required

idintegerrequired
A unique identifier for the product which is given by User automatically.
user_custom_idstringrequired
The unique identifier for the user which is provided by the client.
user_idintegerrequired
A unique identifier for the user which is given by User automatically.
datajson
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.
timestamptimestamp
A datetime when an event occured in UNIX format.

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/products/:id/product_event/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"user_id": 1906,
"event_type": "view",
"timestamp": 1794303209,
"data": {
"source": "api"
}
}'

Response examples​

{
"id": 388
}

Response fields​

Fields returned in the 201 Created response body.

idinteger
A unique identifier for the product which is given by User automatically.
note

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