Documentation Index

Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt

Use this file to discover all available pages before exploring further.

Hit event

Prev Next
Post
/hit/event

Used to send a realtime event to Xtremepush when an event occurs on a backend system "sign_up", "purchase" etc, similar to the eventHit methods found in the web and mobile SDKs. This allows users to trigger campaigns/workflows based on events that happen outside of sites or Apps.


The endpoint allows requests to update specific user attributes (both system and custom attributes such as email, first name, mobile number, etc.) before the event is hit. This ensures your event-triggered campaigns are sent to an up-to-date profile.


Note: If your project does not have Consent Manager enabled, the consent_preferences object will be ignored.

Body parameters
Hit event with user attributes and consent preferences
{
  "apptoken": "YOUR_APPTOKEN",
  "user_id": "USER_ID",
  "event": "purchase",
  "value": {
    "product": "Some Product"
  },
  "user_attributes": {
    "email": "user@example.com",
    "first_name": "Sam"
  },
  "consent_preferences": {
    "email": {
      "marketing": "1"
    },
    "sms": {
      "marketing": "0"
    }
  }
}
object
apptoken
string Required

Your App token

user_id
string Required

Your external user ID. If a user with such user ID doesn't exist it will be automatically created.

event
string Required

Event name

value
string

Can be: string / number, eg. 100, or key-value object, eg. {"product": "Some Product"}

user_attributes
string (json)

Key-value array of user attributes. These attributes will be updated before executing any event-triggered campaign. This is useful when the campaign depends on one of the user attributes, such as email address or first name.

timestamp
string (date-time)

The timestamp of the event. By default the timestamp will be read in UTC. If your project is in a different timezone, the timezone can be indicated in the timestamp: 2024-12-13 11:36:00 +01:00.

consent_preferences
string (json)

Optional map of consent preferences by channel. Each channel key must contain a map of preferences with binary values to show their status (1 for opt-in and 0 for opt-out). A metadata object can be included. To update consent preferences, ensure that Consent Manager is enabled for your project.

Responses
200

200

Result
{
  "success": "True",
  "code": "200"
}
object
success
boolean
Defaulttrue
ExampleTrue
code
integer
Default0
Example200
400

400

Result
{
  "success": "False",
  "code": "400",
  "message": "General error information",
  "errors": [
    {
      "text": [
        "Detailed information about the specific error"
      ]
    }
  ]
}
Expand All
object
success
boolean
Defaulttrue
ExampleFalse
code
integer
Default0
Example400
message
string
ExampleGeneral error information
errors
Array of object
object
text
Array of string
string