# Create event by user custom id
You can create an event using a user_custom_id.
POST
/users-by-id/:user_custom_id/events/
Attributes | Type | Required | Description |
---|---|---|---|
user_custom_id | string | yes | The unique identifier for the user which is provided by the client. Previously: "user_id". |
data | JSON | yes | A valid json object with additional data. |
name | string | yes | An event name. |
timestamp | datetime | no | A datetime when an event occured in UNIX format. |
# Request
- CURL
- JavaScript
- PHP
- Python
curl -X POST -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2" -H "Content-Type: application/json" -d '{
"name":"profile_updated",
"timestamp": 1426967129,
"data":{
"keyData1":"value for key data 1"
}
}' "https://<your_app_subdomain>.user.com/api/public/users-by-id/:user_custom_id/events/"
# Response
{
"id": 86,
"created": true
}
'created: true'
means that this is first occurrence for created event
'created: false'
means that there is at least one occurence for this event in database