Send email

Sends an email. It is queued immediately and delivered within seconds, or at scheduled_at.

POST/emails

Headers

  • Idempotency-Keystring

    Optional. Repeating a request with the same key within 24 hours returns the original email instead of sending again.

Body parameters

  • fromstringrequired

    Sender, e.g. "Acme <[email protected]>". The domain must be verified (or use the sandbox sender). Optional when template has a default sender.

  • tostring | string[]required

    Recipient addresses. Up to 50 recipients across to, cc and bcc.

  • subjectstringrequired

    Subject line. Optional when template provides one.

  • htmlstring

    HTML body. Either html, text or template is required.

  • textstring

    Plain-text body. Generated from html when omitted.

  • ccstring | string[]

    Carbon-copy recipients.

  • bccstring | string[]

    Blind carbon-copy recipients.

  • reply_tostring | string[]

    Reply-To address(es). Defaults to the template’s, if it has one.

  • headersobject

    Custom MIME headers as name → value pairs, e.g. { "X-Entity-Ref-ID": "123" }.

  • attachmentsobject[]

    Files to attach. Up to 40 MB per email in total, attachments included.

    Show 3 item fields
    • attachments[].filenamestringrequired

      File name shown to the recipient, e.g. invoice.pdf.

    • attachments[].contentstringrequired

      The file, base64-encoded.

    • attachments[].content_typestring

      MIME type, e.g. application/pdf. Guessed from the file name when omitted.

  • tagsobject[]

    Labels echoed in webhooks so you can match events to your own records.

    Show 2 item fields
    • tags[].namestringrequired

      Tag name, e.g. category.

    • tags[].valuestringrequired

      Tag value, e.g. welcome.

  • scheduled_atstring

    ISO 8601 timestamp up to 30 days ahead. The email is created with status scheduled.

  • templateobject

    Send a stored template. Its subject, HTML, text, sender and Reply-To are used for any of those you leave out.

    Show 2 fields
    • template.idstringrequired

      The template’s ID or alias, e.g. "welcome-email".

    • template.variablesobject

      Values for the template’s variables, e.g. { "name": "Ada" } fills {{name}}. Missing values use the fallback in {{name|fallback}}, or become empty.

To send a stored template, pass its ID or alias with the variables to fill in: { "from": "Acme <[email protected]>", "to": "[email protected]", "template": { "id": "welcome-email", "variables": { "name": "Ada" } } }. Anything you also pass (such as subject) overrides the template’s.

Request

curl -X POST 'https://api.mailvina.com/emails' \
  -H 'Authorization: Bearer mv_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "Acme <[email protected]>",
  "to": [
    "[email protected]"
  ],
  "subject": "Welcome to Acme",
  "html": "<p>Hi Ada!</p>",
  "tags": [
    {
      "name": "category",
      "value": "welcome"
    }
  ]
}'

Response

{
  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}