# Create event

You can create an event.

POST /events/

Attributes Type Required Description
user_id integer yes A unique identifier for the user which is given by User.com automatically. Previously: "client".
data JSON no 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,
       "user_id":9096344,
       "data":{
          "keyData1":"value for key data 1"
       }
    }' "https://<your_app_subdomain>.user.com/api/public/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