How to Send Custom Events Using SendX API

03:50 mins
S

SendWorks

Updated on Feb 17, 2025

How to Send Custom Events on SendX

In this video, we'll explore how to send custom events on SendX to create personalized customer journeys. Custom events are an excellent tool for tracking customer activities on your platform. This data can be leveraged by SendX to build segments and execute complex workflow actions.

Step-by-Step Guide

  1. Access SendX REST API Documentation

    First, head over to docs.sendx.io, where our SendX REST API documentation is hosted. While you can also execute this on Postman, we'll be focusing solely on the documentation platform for now.

  2. Set Up API Server and Authentication

    • Under API server, ensure you have checked the production server.
    • For authentication, add your own SendX team API key. Navigate to your SendX dashboard, go to settings, and under team API key, copy this API key. Remove the old one, add the new one, and set it.
  3. Push a Custom Event

    • Scroll down and look for the event tab. Click on "Push a custom event associated with a contact."
    • Find a contact to push a custom event for. For example, copy the email address of the contact, Christo.
    • Select the example tab from the top. An example request for custom events is already populated. Use the email as the identifier for the custom event.
  4. Define the Custom Event

    • Designate a name for the custom event, such as "abandoned cart," which signifies a situation where a user has added products to their cart but has not completed the payment process.
    • Consider the data attribute, which can be an object containing key-value pairs associated with this custom event. For instance, properties such as password, price, currency, and item count.
    • Custom event properties have types defined to them, such as string, number, Boolean, or date. SendX assumes all properties to be of type string by default.
  5. Add Additional Properties

    • Add another property in the data object, such as "is churned" and set it to false.
    • Include an attribute "time," denoting the time at which the event occurred for the customer. If left empty, SendX will automatically set the current time.
  6. Send the Custom Event

    Once you are satisfied with the setup, click on the try button to send this event. You'll receive a status 200 and message OK, indicating that your custom event is pushed for the user.

  7. Verify the Custom Event

    Head back to SendX to check this custom event for your contact. Click on the timeline tab for the contact. You should see the new custom event, "abandoned cart," under the contact timeline.

Thank you! In future tutorials, we'll look into how to change custom event properties' names and types and also how to add new properties to already existing custom events.