v1

latestOpenAPI 3.1.02026-08-04170116.0 KB
Data In

Create Email/SMS Record

Ingest email, SMS, and direct mail marketing data into Triple Whale. This endpoint accepts campaign, flow, and message attributes together with performance metrics. The data populates the Email/SMS and Email/SMS Settings tables alongside the merchant's other email/SMS providers. Send attributes when your structure changes and metrics on your reporting cadence; both can be sent in the same call or separately.

post/data-in/email-sms

Request body

shopstring required

The exact Shop URL (e.g., 'example.myshopify.com'). Must match the Shop URL value shown in Settings → Store. Must not contain /. The credential owner must also have access to the shop, otherwise the request will return 403.

currencystring required

The currency used for reporting (e.g., 'USD').

event_datestring date required

The date the activity occurred, in the merchant's local timezone. Must be a valid date string (e.g., YYYY-MM-DD or an ISO datetime).

channelstring

The marketing medium for the message. Maps to channel_type in the Email/SMS table. The sending provider itself is derived from your credential, not from this field.

account_idstring

Your platform's account identifier for this merchant. Defaults to a provider-level value if not provided.

campaign_type'campaign' | 'flow'

Indicates whether the record describes a one-time campaign or an automated flow. campaign = one-time send; flow = automated/triggered series. Maps to report_type in the Email/SMS table. Defaults to campaign if not provided.

updated_atstring date-time

The time at which the record was last updated on your side. Must be provided in ISO 8601 format, with explicit timezone information (Z or +/-HH:mm offset). Defaults to the current time.

Example request

{
  "shop": "acme.myshopify.com",
  "currency": "USD",
  "event_date": "2026-06-25",
  "channel": "directmail",
  "account_id": "acme-postpilot-123",
  "campaign_type": "campaign",
  "campaign": {
    "id": "pp_camp_98765",
    "name": "June Winback Postcard",
    "status": "sent",
    "created_at": "2026-06-20T09:00:00Z",
    "updated_at": "2026-06-24T18:30:00Z",
    "send_time": "2026-06-25T14:00:00Z",
    "scheduled_at": "2026-06-25T13:00:00Z",
    "trigger_type": "manual"
  },
  "flow_action": {
    "id": "fa_55012",
    "name": "SEND_EMAIL",
    "status": "live",
    "created_at": "2026-05-01T09:00:00Z",
    "updated_at": "2026-06-01T09:00:00Z"
  },
  "message": {
    "id": "pp_msg_55",
    "name": "Winback Postcard 5x7",
    "variation": "A",
    "subject": "We miss you — 20% off inside",
    "preview_text": "Your favorites are waiting",
    "content": "Come back and save 20% on your next order.",
    "template_html_url": "https://postpilot.com/creatives/55.png",
    "created_at": "2026-06-22T09:00:00Z",
    "updated_at": "2026-06-24T09:00:00Z"
  },
  "metrics": {
    "sent": 5000,
    "delivered": 4910,
    "opened": 1820,
    "clicks": 540,
    "received": 4880,
    "purchases": 92,
    "conversion_value": 8400.5,
    "spend": 1250,
    "unsubscribed": 12,
    "marked_as_spam": 3
  },
  "updated_at": "2026-06-25T15:30:00Z"
}

Response

Email/SMS event successfully received.

successboolean
messagestring

Example response

{
  "success": true,
  "message": "Email/SMS event received"
}