---
title: "Create Email/SMS Record"
method: POST
path: "/data-in/email-sms"
tags: ["Data In"]
---

# Create Email/SMS Record

`POST /data-in/email-sms`

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.

## Request body

- object
  - `shop` string, required — The exact Shop URL (e.g., 'example.myshopify.com'). Must match the Shop URL value shown in [Settings → Store](https://app.triplewhale.com/store-settings/general). Must not contain `/`. The credential owner must also have access to the shop, otherwise the request will return 403.
  - `currency` string, required — The currency used for reporting (e.g., 'USD').
  - `event_date` string, 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).
  - `channel` string — 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_id` string — 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.
  - `campaign` object — Attributes of the campaign. At least one of `campaign`, `flow_action`, `message`, or `metrics` is required.
    - `id` string, required — The unique ID of the campaign. Maps to `campaign_id` in the Email/SMS table.
    - `name` string — The name of the campaign. Maps to `campaign_name` in the Email/SMS table.
    - `status` string — The status of the campaign (e.g., 'sent', 'scheduled', 'draft'). Maps to `campaign_status` in the Email/SMS table.
    - `created_at` string — The time at which the campaign was created, in ISO 8601 format.
    - `updated_at` string — The time at which the campaign was last updated, in ISO 8601 format.
    - `archived` boolean — Indicates whether the campaign is archived.
    - `send_time` string — The time at which the campaign was sent.
    - `scheduled_at` string — The time at which the campaign is or was scheduled to send.
    - `trigger_type` string — What triggered the campaign (used for flows).
  - `flow_action` object — Attributes of a step within an automated flow, used when `campaign_type` is `flow`. At least one of `campaign`, `flow_action`, `message`, or `metrics` is required.
    - `id` string, required — The unique ID of the flow step. Maps to `flow_action_id` in the Email/SMS table.
    - `name` string — The name of the flow step. Maps to `flow_action_name` in the Email/SMS table.
    - `status` string — The status of the flow step. Maps to `flow_action_status` in the Email/SMS table.
    - `created_at` string — The time at which the flow step was created, in ISO 8601 format.
    - `updated_at` string — The time at which the flow step was last updated, in ISO 8601 format.
  - `message` object — Attributes of an individual message or creative variant. At least one of `campaign`, `flow_action`, `message`, or `metrics` is required.
    - `id` string, required — The unique ID of the message or variant. Maps to `message_id` in the Email/SMS table.
    - `name` string — The name of the message. Maps to `message_name` in the Email/SMS table.
    - `variation` string — The A/B variation identifier for the message.
    - `subject` string — The subject line (for email messages).
    - `preview_text` string — The preview or preheader text.
    - `content` string — The message body or content.
    - `template_html_url` string — A URL to the rendered creative or template.
    - `created_at` string — The time at which the message was created, in ISO 8601 format.
    - `updated_at` string — The time at which the message was last updated, in ISO 8601 format.
  - `metrics` object — Performance metrics for the record. All fields are optional; send only the values you have. Triple Whale derives ratios such as ROAS, AOV, and cost-per-conversion from these raw counts and amounts.
    - `sent` number — Total number of messages sent.
    - `delivered` number — Total number of messages delivered to recipients.
    - `opened` number — Total number of unique opens.
    - `clicks` number — Total number of clicks.
    - `received` number — Total number of messages received.
    - `purchases` number — Total number of conversions (purchases).
    - `conversion_value` number — Total attributed conversion value (revenue).
    - `spend` number — Total cost of the send.
    - `unsubscribed` number — Total number of unsubscribes.
    - `marked_as_spam` number — Total number of spam complaints.
  - `updated_at` string, 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.

## Response `200`

Email/SMS event successfully received.

- object
  - `success` boolean
  - `message` string

## Other responses

- `400` — Bad Request
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/triplewhale/apis/triple-whale-api.md) · [All operations](https://skmtc.net/triplewhale/apis/triple-whale-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/triplewhale/triple-whale-api/revisions/96b22ac9b5a7/schema)
