Send an email
Sends a transactional email or a mailing-list send (when `to` is a mailing-list UUID). Accepts either an admin JWT or a mail-server API key; API-key callers are checked against the key's audience, sender, and transport scopes โ admins bypass all scopes.
Admin JWTAPI key(either accepted)Request body
application/jsonmessageone of 2requiredEither a template reference (rendered server-side via react-email) or a raw text+html body.
toone of 3requiredRecipient email address, array of addresses (max 50), or a mailing-list UUID โ the send then goes to every active (non-unsubscribed) subscriber of that list.
fromstringSender, as a bare address or `Display Name <address>` form. Defaults to the server's configured MAIL_FROM sender.
Example:
Example <noreply@example.com>subjectstringrequiredExample:
Welcome!replyTostringccone of 2bccone of 2dryRunbooleanWhen true, validates the request (and renders the template, if any) without dispatching mail.
transportMailTransportKind ยท stringWhich configured transport should deliver this message. Defaults to the deployment's MAIL_TRANSPORT.
one of:resendsmtptest-database-transport
Example request
curl -X POST 'https://mail.schemavaults.com/api/send' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"message": {
"template_id": "mailing-list-confirmation"
},
"to": "user@example.com",
"from": "Example <noreply@example.com>",
"subject": "Welcome!",
"replyTo": "string",
"cc": "user@example.com",
"bcc": "user@example.com",
"dryRun": true,
"transport": "resend"
}'Responses
- 200The email was sent (or validated, for dry runs).
- 400Invalid request body, unknown/unconfigured/admin-disabled transport, invalid template, or empty/oversized mailing list.
- 401Missing or invalid credentials.
- 403The API key's audience, sender, or transport scope forbids this send.
- 500Failed to prepare or dispatch the email.