POST /api/v1/send Auth required

Send Email

Queue an interactive email. Returns immediately with a job_id; delivery happens in the background.

Request

curl -X POST "https://tryoat.com/api/v1/send" \
  -H "Authorization: ApiKey YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "options": {
        "send_at": "2026-04-08T10:00:00Z"
      },
      "params": {
        "checkout_id": "abc123shopifytoken",
        "customer_name": "Jane Doe"
      },
      "recipient": "customer@example.com",
      "template_id": "550e8400-e29b-41d4-a716-446655440000",
      "variables": {
        "discount_message": "Get 10% off today!"
      }
    }'

Parameters

template_id string required

UUID of the email template to send.

recipient string required

Recipient email address.

params object conditional

Template-specific inputs used to build the email. Which keys are required depends on the template's type — see “Required params by template type” below.

params.checkout_id string conditional

Shopify checkout token to clone the cart from. Required for cart templates unless params.checkout_url is given; not used by other types.

params.checkout_url string conditional

Full Shopify cart/checkout URL — the checkout token is extracted from it. Use when your trigger only exposes the URL (e.g. a Klaviyo flow property).

params.product_ids array of integers optional

featured_product templates only — Shopify product ids to feature, overriding the template's editor-picked products. No checkout token is needed for featured sends.

params.return_id string conditional

Returns-provider return id. Required for return templates.

params.customer_name string optional

Customer name for personalization.

variables object optional

Custom template placeholders (keys defined by the template).

options object optional

Delivery behavior.

options.send_at string (ISO8601) optional

Schedule for future delivery. Defaults to immediate.

options.test boolean optional

Dry run — validate and skip delivery. Defaults to false.

Required params by template type

Abandoned cart (and other cart templates) params.checkout_id or params.checkout_url

The cart is cloned from the Shopify checkout token.

Featured product

The recipient builds the cart in-email. params.product_ids optionally overrides the template's picked products.

Product review

Pass the delivered order's items in params.order_items to pick what to ask about.

Return emails params.return_id

The return is loaded from your connected returns provider.

Forms, subscription and other transactional templates

params is passed through to the template's engine.

Response

200 OK
{
  "job_id": 12345,
  "message": "Cart email queued successfully",
  "recipient": "customer@example.com",
  "scheduled_at": "2026-04-08T10:00:00Z",
  "success": true,
  "template_id": "550e8400-e29b-41d4-a716-446655440000"
}

Errors

400 template_id and recipient are required
400 Invalid recipient email address
400 params.checkout_id or params.checkout_url is required for cart emails
400 params.checkout_id must be a string of at least 5 characters
400 params.checkout_url must be a Shopify cart URL
400 params.product_ids must be a non-empty list of Shopify product ids
400 params.return_id is required for return emails
400 options.send_at must be a valid ISO8601 datetime
401 Invalid API key
404 Template not found
422 Failed to queue cart email