/api/sendAuthenticatedSend an email
Sends a transactional email or a mailing-list send (when to is a mailing-list UUID).
sendEmailSendAuthentication & permissionsAuthenticated
Any authenticated user
- Accepted credentials
- Mail-server API key (Bearer)
Authorization: Bearer <token> - Access token (Bearer)
Authorization: Bearer <JWT> - Access token (cookie)
cookie "access_token_schemavaults-mail"
- Mail-server API key (Bearer)
- Who may call
- Any authenticated user
- Notes
- Access tokens must belong to an admin (other users get 403). API-key callers are checked against the key's audience, sender, and transport scopes; admins bypass all scopes.
Request body
Required
| Property | Type | Description |
|---|---|---|
| to* | string (email) | string (email)[] | string (uuid) | Recipient 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. |
| from | string | Sender: a bare address, or a display name followed by the address in angle brackets. A display name containing any of |
| subject* | string | minLength: 1 |
| message* | SendEmailTemplateMessage | SendEmailRawMessage | Either a template reference (rendered server-side via react-email) or a raw text+html body. |
| replyTo | string | Reply-to address, in the same forms as |
| cc | string (email) | string (email)[] | |
| bcc | string (email) | string (email)[] | |
| dryRun | boolean | When true, validates the request (and renders the template, if any) without dispatching mail. |
| transport | string | Which configured transport should deliver this message ( minLength: 1maxLength: 64pattern: ^[a-z]([a-z0-9_-]*[a-z0-9])?$ |
| attachments | object[] | Files to attach (1–20, at most 25 MiB in total once decoded). Each carries its bytes base64-encoded in minItems: 1maxItems: 20 |
| filename* | string | minLength: 1maxLength: 255 |
| content* | string | minLength: 1 |
| contentType | string | minLength: 1maxLength: 255pattern: ^[A-Za-z0-9!#$&^_.+-]+\/[A-Za-z0-9!#$&^_.+-]+(?:[ \t]*;[ \t]*[A-Za-z0-9!#$&^_.+-]+=(?:"[\x20\x21\x23-\x7E]*"|[\x21\x23-\x3A\x3C-\x7E]+))*$ |
| contentId | string | minLength: 1maxLength: 255pattern: ^[\x21-\x3B\x3D\x3F-\x7E]+$ |
Responses
| Property | Type | Description |
|---|---|---|
| success* | true | |
| message* | string |
Example request
curl -X POST 'https://mail.schemavaults.com/api/send' \
-H 'Authorization: Bearer <access_token>' \
-H 'Content-Type: application/json' \
-d '{
"to": "user@example.com",
"from": "Example <noreply@example.com>",
"subject": "Welcome!",
"message": {
"template_id": "string",
"template_props": null
},
"replyTo": "Example Support <support@example.com>",
"cc": "user@example.com",
"bcc": "user@example.com",
"dryRun": true,
"transport": "resend",
"attachments": [
{
"filename": "string",
"content": "string",
"contentType": "string",
"contentId": "string"
}
]
}'