Skip to main content
POST
/
emails
Send email
curl --request POST \
  --url https://api.runnage.dev/emails \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": "Acme <onboarding@example.com>",
  "to": [
    "jsmith@example.com"
  ],
  "subject": "<string>",
  "text": "<string>",
  "cc": [
    "jsmith@example.com"
  ],
  "bcc": [
    "jsmith@example.com"
  ],
  "reply_to": [
    "jsmith@example.com"
  ],
  "html": "<string>",
  "tags": {}
}
'
import requests

url = "https://api.runnage.dev/emails"

payload = {
"from": "Acme <onboarding@example.com>",
"to": ["jsmith@example.com"],
"subject": "<string>",
"text": "<string>",
"cc": ["jsmith@example.com"],
"bcc": ["jsmith@example.com"],
"reply_to": ["jsmith@example.com"],
"html": "<string>",
"tags": {}
}
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({
from: 'Acme <onboarding@example.com>',
to: ['jsmith@example.com'],
subject: '<string>',
text: '<string>',
cc: ['jsmith@example.com'],
bcc: ['jsmith@example.com'],
reply_to: ['jsmith@example.com'],
html: '<string>',
tags: {}
})
};

fetch('https://api.runnage.dev/emails', 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.runnage.dev/emails",
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([
'from' => 'Acme <onboarding@example.com>',
'to' => [
'jsmith@example.com'
],
'subject' => '<string>',
'text' => '<string>',
'cc' => [
'jsmith@example.com'
],
'bcc' => [
'jsmith@example.com'
],
'reply_to' => [
'jsmith@example.com'
],
'html' => '<string>',
'tags' => [

]
]),
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.runnage.dev/emails"

payload := strings.NewReader("{\n \"from\": \"Acme <onboarding@example.com>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"reply_to\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"tags\": {}\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.runnage.dev/emails")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"Acme <onboarding@example.com>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"reply_to\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"tags\": {}\n}")
.asString();
require 'uri'
require 'net/http'

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

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 \"from\": \"Acme <onboarding@example.com>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"reply_to\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"tags\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
{
"error": "<string>",
"details": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"details": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"details": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"details": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"details": "<string>",
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string
Maximum string length: 255
X-Request-ID
string
Maximum string length: 255

Body

application/json
from
string
required
Example:

"Acme <onboarding@example.com>"

to
string<email>[]
required
Minimum array length: 1
subject
string
required
text
string
required
cc
string<email>[]
bcc
string<email>[]
reply_to
string<email>[]
html
string
tags
object

Response

Queued

id
string<uuid>
required