# Send batch emails

> Sends up to 100 different emails in one request. The body is an array of email objects with the same fields as **Send email**.

Source: https://mailvina.com/docs/api-reference/emails/send-batch · Base URL: https://api.mailvina.com · Guide: https://mailvina.com/docs/send-email

`POST /emails/batch`

Emails are created in order and validation stops at the first invalid one. `scheduled_at` and `attachments` are supported per email.

**Request**

```bash
curl -X POST 'https://api.mailvina.com/emails/batch' \
  -H 'Authorization: Bearer mv_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "from": "Acme <hello@mail.acme.com>",
    "to": [
      "ada@example.com"
    ],
    "subject": "Hi Ada",
    "html": "<p>…</p>"
  },
  {
    "from": "Acme <hello@mail.acme.com>",
    "to": [
      "alan@example.com"
    ],
    "subject": "Hi Alan",
    "html": "<p>…</p>"
  }
]'
```

```js
const res = await fetch('https://api.mailvina.com/emails/batch', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.MAILVINA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify([
    {
      "from": "Acme <hello@mail.acme.com>",
      "to": [
        "ada@example.com"
      ],
      "subject": "Hi Ada",
      "html": "<p>…</p>"
    },
    {
      "from": "Acme <hello@mail.acme.com>",
      "to": [
        "alan@example.com"
      ],
      "subject": "Hi Alan",
      "html": "<p>…</p>"
    }
  ]),
});
const data = await res.json();
```

```python
import os, requests

res = requests.post(
    "https://api.mailvina.com/emails/batch",
    headers={"Authorization": f"Bearer {os.environ['MAILVINA_API_KEY']}"},
    json=[
        {
            "from": "Acme <hello@mail.acme.com>",
            "to": [
                "ada@example.com"
            ],
            "subject": "Hi Ada",
            "html": "<p>…</p>"
        },
        {
            "from": "Acme <hello@mail.acme.com>",
            "to": [
                "alan@example.com"
            ],
            "subject": "Hi Alan",
            "html": "<p>…</p>"
        }
    ],
)
print(res.json())
```

**Response**

```json
{
  "data": [
    {
      "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
    },
    {
      "id": "0c3a1b7e-2f4d-4b8a-9e61-5d2f8c7a9b10"
    }
  ]
}
```
