Skip to main content
POST
/
emails
/
bulk
Send bulk emails
curl --request POST \
  --url https://api.sendkit.dev/emails/bulk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "emails": [
    {
      "to": "user@example.com",
      "from": "Your Name <hello@yourdomain.com>",
      "subject": "Welcome to SendKit",
      "html": "<h1>Hello!</h1><p>Welcome aboard.</p>",
      "text": "Hello! Welcome aboard.",
      "cc": [
        "<string>"
      ],
      "bcc": [
        "<string>"
      ],
      "reply_to": [
        "<string>"
      ],
      "headers": {},
      "tags": [
        {
          "name": "campaign",
          "value": "welcome"
        }
      ],
      "scheduled_at": "2023-11-07T05:31:56Z",
      "attachments": [
        {
          "filename": "invoice.pdf",
          "content": "JVBERi0xLjQKJeLj...",
          "content_type": "application/pdf"
        }
      ],
      "template": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "variables": {}
      }
    }
  ]
}
'
import requests

url = "https://api.sendkit.dev/emails/bulk"

payload = { "emails": [
        {
            "to": "user@example.com",
            "from": "Your Name <hello@yourdomain.com>",
            "subject": "Welcome to SendKit",
            "html": "<h1>Hello!</h1><p>Welcome aboard.</p>",
            "text": "Hello! Welcome aboard.",
            "cc": ["<string>"],
            "bcc": ["<string>"],
            "reply_to": ["<string>"],
            "headers": {},
            "tags": [
                {
                    "name": "campaign",
                    "value": "welcome"
                }
            ],
            "scheduled_at": "2023-11-07T05:31:56Z",
            "attachments": [
                {
                    "filename": "invoice.pdf",
                    "content": "JVBERi0xLjQKJeLj...",
                    "content_type": "application/pdf"
                }
            ],
            "template": {
                "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
                "variables": {}
            }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    emails: [
      {
        to: 'user@example.com',
        from: 'Your Name <hello@yourdomain.com>',
        subject: 'Welcome to SendKit',
        html: '<h1>Hello!</h1><p>Welcome aboard.</p>',
        text: 'Hello! Welcome aboard.',
        cc: ['<string>'],
        bcc: ['<string>'],
        reply_to: ['<string>'],
        headers: {},
        tags: [{name: 'campaign', value: 'welcome'}],
        scheduled_at: '2023-11-07T05:31:56Z',
        attachments: [
          {
            filename: 'invoice.pdf',
            content: 'JVBERi0xLjQKJeLj...',
            content_type: 'application/pdf'
          }
        ],
        template: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', variables: {}}
      }
    ]
  })
};

fetch('https://api.sendkit.dev/emails/bulk', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.sendkit.dev/emails/bulk",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'emails' => [
        [
                'to' => 'user@example.com',
                'from' => 'Your Name <hello@yourdomain.com>',
                'subject' => 'Welcome to SendKit',
                'html' => '<h1>Hello!</h1><p>Welcome aboard.</p>',
                'text' => 'Hello! Welcome aboard.',
                'cc' => [
                                '<string>'
                ],
                'bcc' => [
                                '<string>'
                ],
                'reply_to' => [
                                '<string>'
                ],
                'headers' => [
                                
                ],
                'tags' => [
                                [
                                                                'name' => 'campaign',
                                                                'value' => 'welcome'
                                ]
                ],
                'scheduled_at' => '2023-11-07T05:31:56Z',
                'attachments' => [
                                [
                                                                'filename' => 'invoice.pdf',
                                                                'content' => 'JVBERi0xLjQKJeLj...',
                                                                'content_type' => 'application/pdf'
                                ]
                ],
                'template' => [
                                'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
                                'variables' => [
                                                                
                                ]
                ]
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sendkit.dev/emails/bulk"

	payload := strings.NewReader("{\n  \"emails\": [\n    {\n      \"to\": \"user@example.com\",\n      \"from\": \"Your Name <hello@yourdomain.com>\",\n      \"subject\": \"Welcome to SendKit\",\n      \"html\": \"<h1>Hello!</h1><p>Welcome aboard.</p>\",\n      \"text\": \"Hello! Welcome aboard.\",\n      \"cc\": [\n        \"<string>\"\n      ],\n      \"bcc\": [\n        \"<string>\"\n      ],\n      \"reply_to\": [\n        \"<string>\"\n      ],\n      \"headers\": {},\n      \"tags\": [\n        {\n          \"name\": \"campaign\",\n          \"value\": \"welcome\"\n        }\n      ],\n      \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n      \"attachments\": [\n        {\n          \"filename\": \"invoice.pdf\",\n          \"content\": \"JVBERi0xLjQKJeLj...\",\n          \"content_type\": \"application/pdf\"\n        }\n      ],\n      \"template\": {\n        \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n        \"variables\": {}\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.sendkit.dev/emails/bulk")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"emails\": [\n    {\n      \"to\": \"user@example.com\",\n      \"from\": \"Your Name <hello@yourdomain.com>\",\n      \"subject\": \"Welcome to SendKit\",\n      \"html\": \"<h1>Hello!</h1><p>Welcome aboard.</p>\",\n      \"text\": \"Hello! Welcome aboard.\",\n      \"cc\": [\n        \"<string>\"\n      ],\n      \"bcc\": [\n        \"<string>\"\n      ],\n      \"reply_to\": [\n        \"<string>\"\n      ],\n      \"headers\": {},\n      \"tags\": [\n        {\n          \"name\": \"campaign\",\n          \"value\": \"welcome\"\n        }\n      ],\n      \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n      \"attachments\": [\n        {\n          \"filename\": \"invoice.pdf\",\n          \"content\": \"JVBERi0xLjQKJeLj...\",\n          \"content_type\": \"application/pdf\"\n        }\n      ],\n      \"template\": {\n        \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n        \"variables\": {}\n      }\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.sendkit.dev/emails/bulk")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"emails\": [\n    {\n      \"to\": \"user@example.com\",\n      \"from\": \"Your Name <hello@yourdomain.com>\",\n      \"subject\": \"Welcome to SendKit\",\n      \"html\": \"<h1>Hello!</h1><p>Welcome aboard.</p>\",\n      \"text\": \"Hello! Welcome aboard.\",\n      \"cc\": [\n        \"<string>\"\n      ],\n      \"bcc\": [\n        \"<string>\"\n      ],\n      \"reply_to\": [\n        \"<string>\"\n      ],\n      \"headers\": {},\n      \"tags\": [\n        {\n          \"name\": \"campaign\",\n          \"value\": \"welcome\"\n        }\n      ],\n      \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n      \"attachments\": [\n        {\n          \"filename\": \"invoice.pdf\",\n          \"content\": \"JVBERi0xLjQKJeLj...\",\n          \"content_type\": \"application/pdf\"\n        }\n      ],\n      \"template\": {\n        \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n        \"variables\": {}\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "status": "success",
      "id": "550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}
{
  "message": "Invalid API key."
}
{
  "message": "The email field is required."
}
{
  "name": "rate_limit_exceeded",
  "message": "Rate limit exceeded. Please retry after 30 seconds."
}

Authorizations

Authorization
string
header
required

API key from your SendKit dashboard. Pass it as a Bearer token in the Authorization header.

Body

application/json
emails
object[]
required

Array of email objects to send. Each email is independent with its own recipient, content, and options. You can also send a plain JSON array (without the emails wrapper key).

Required array length: 1 - 100 elements

Response

Emails accepted for delivery

data
object[]

Array of results in the same order as the input. Each entry indicates success or error.

Successful email.