Track Your First Custom Event

Custom events allow you to record specific actions your contacts take — like abandoning a cart or making a purchase — and associate those actions with additional metadata.

This guide walks you through sending your first custom event using the SendX REST API.

1. Prerequisites

Before you begin:

Your API Key is required for authentication. Keep it private and secure.

2. Push a Custom Event

Use the /events/custom endpoint to track a user action with optional metadata.

curl --request POST \
  --url https://api.sendx.io/api/v1/rest/events/custom \
  --header 'Content-Type: application/json' \
  --header 'X-Team-ApiKey: <YOUR_TEAM_API_KEY>' \
  --data '{
    "name": "abandoned_cart",
    "identifier": "john.doe@example.com",
    "data": {
      "price": "29.99",
      "currency": "USD",
      "item_count": "3"
    },
    "time": 1669990400
  }'

What This Does

This request records an event named abandoned_cart for the contact john.doe@example.com, along with additional metadata:

  • price: 29.99
  • currency: USD
  • item_count: 3
  • time: 1669990400 (optional - if omitted, server will use current time)

Custom Events API

Learn more about how to track custom events with additional data.

3. Next Steps

Once you’ve recorded events, you can:

  • Segment contacts based on event properties
  • Trigger automations using event names
  • Analyze custom events in your dashboard
  • Explore the full API Reference to see what’s possible.