http
POST https://www.ewyn.ai/api/v1/sendRequest body
| Field | Type | Required | Notes |
|---|---|---|---|
| to | string | yes | Recipient email address |
| subject | string | yes | Subject line; may contain {{variable}} placeholders |
| templateVersionId | uuid | one of | Published template version ID. templateId is accepted as a legacy alias — exactly one of the two is required |
| preheader | string | no | Preview text after the subject in most clients; supports {{variable}} placeholders |
| variables | object | no | String map substituted into {{ }} tokens in the template, subject, and preheader |
| metadata | object | no | Attached to the message for your own correlation |
| idempotencyKey | string | no | Dedupes repeat requests for 24 hours |
| from | string | no | Override the workspace default sender address |
| fromName | string | no | Override the sender display name (max 255 chars) |
| replyTo | string | no | Override the workspace default reply-to |
Example
bash
curl -X POST https://www.ewyn.ai/api/v1/send \
-H "Authorization: Bearer $EWYN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "maya@example.com",
"subject": "Welcome, {{firstName}}!",
"templateVersionId": "4f6f3a0e-9b1c-4f7a-8a3e-version-uuid",
"variables": { "firstName": "Maya" },
"idempotencyKey": "signup-usr_8h2k4"
}'Response
json
{
"messageId": "msg_...",
"status": "queued",
"queuedAt": "2026-06-12T09:30:00.000Z"
}queued means Ewyn accepted the message and handed it to the delivery queue. Delivery, open, click, and bounce events appear on the contact's journey timeline in the dashboard as your ESP reports them back.
Idempotent replays return 200.
A repeated idempotencyKey within 24 hours returns the original messageId without sending again. If the original attempt terminally failed, the replay re-queues it instead.
Errors
| Status | Meaning |
|---|---|
| 400 | Validation failed — missing subject, invalid email, or no template version ID |
| 401 | Missing or invalid API key |
| 404 | Template version not found in this workspace |
| 422 | Recipient is on the suppression list, or workspace email quota exhausted |
| 429 | Rate limited — see Errors & rate limits |