Custom Events

Creates a contact, updates a contact or adds a custom event to a contact’s profile.

Request Example

Example creates (or updates) a contact and adds an "Order Completed" event

{
"userId": "12345",
  "traits": {
    "phone": "+1XXXXXXXXXX",
    "email": "[email protected]",
    "firstName": "Anna",
    "lastName": "Karenina",
    "birthday": "2019-08-24",
    "gender": "other",
    "age": 29,
    "address": {
      "street": "201 E. 87th St.",
      "zipcode": "11038",
      "city": "New York",
      "state": "New York",
      "country": "United States"
},
  "homepageUrl": "https://example.com",
  "optIn": [
{
    "channel": "voice",
    "ip": "176.63.12.165",
    "source": "booking_flow",
    "text": "Subscribe to recurring phone calls?",
    "timestamp": "2000-08-20 09:12:28 -04:00",
    "subscribed": true
},
{
    "channel": "sms",
    "ip": "176.63.12.165",
    "source": "booking_flow",
    "text": "Subscribe to recurring sms messages?",
    "timestamp": "2000-08-20 09:12:28 -04:00",
    "subscribed": true
}
],
  "custom1": "value1",
  "custom2": [
    "value1",
    "value2",
    "value3"
]
},
"originalTimestamp": "2000-08-20 09:12:28 -04:00",
"eventSource": "salesforce",
"name": "Order Completed",
  "properties": {
    "custom1": "value1",
    "custom2": [
      "value1",
      "value2",
      "value3"
]
}
}
Body Params

Event Properties

string

Unique user identifier, could be a database id.

traits
object

Arbitrary object of properties

date-time

Time of the event on the client device.

string

Source of the event. E.g. salesforce, mparticle.

string

Name of the Event.

properties
object

Arbitrary object of properties

Responses

400

Bad Request

401

API key is missing or invalid

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json