Emails
Retrieve Email
Retrieve a sent email by ID.
GET
/
emails
/
{id}
Retrieve Email
curl --request GET \
--url https://api.unosend.co/emails/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unosend.co/emails/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.unosend.co/emails/{id}', 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.unosend.co/emails/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.unosend.co/emails/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.unosend.co/emails/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unosend.co/emails/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"html": "<string>",
"status": "<string>",
"created_at": "<string>",
"delivered_at": "<string>"
}string
required
The ID of the email to retrieve.
Request
curl https://api.unosend.co/emails/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer un_xxxxxxxxxx"
const response = await fetch('https://api.unosend.co/emails/550e8400-e29b-41d4-a716-446655440000', {
headers: { 'Authorization': 'Bearer un_xxxxxxxxxx' }
});
const email = await response.json();
import requests
response = requests.get('https://api.unosend.co/emails/550e8400-e29b-41d4-a716-446655440000',
headers={'Authorization': 'Bearer un_xxxxxxxxxx'}
)
email = response.json()
req, _ := http.NewRequest("GET", "https://api.unosend.co/emails/550e8400-e29b-41d4-a716-446655440000", nil)
req.Header.Set("Authorization", "Bearer un_xxxxxxxxxx")
resp, _ := http.DefaultClient.Do(req)
$ch = curl_init('https://api.unosend.co/emails/550e8400-e29b-41d4-a716-446655440000');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer un_xxxxxxxxxx'],
CURLOPT_RETURNTRANSFER => true
]);
$response = curl_exec($ch);
require 'net/http'
uri = URI('https://api.unosend.co/emails/550e8400-e29b-41d4-a716-446655440000')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer un_xxxxxxxxxx'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
Response
200
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"subject": "Hello World",
"html": "<h1>Welcome!</h1>",
"status": "delivered",
"created_at": "2024-01-15T10:30:00.000Z",
"delivered_at": "2024-01-15T10:30:05.000Z"
}
}
string
Unique email identifier.
string
Sender email address.
string[]
Recipient email addresses.
string
Email subject line.
string
HTML content of the email.
string
Delivery status:
queued, sent, delivered, bounced, complained.string
When the email was created (ISO 8601).
string
When the email was delivered (ISO 8601).
null if not yet delivered.⌘I
Retrieve Email
curl --request GET \
--url https://api.unosend.co/emails/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unosend.co/emails/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.unosend.co/emails/{id}', 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.unosend.co/emails/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.unosend.co/emails/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.unosend.co/emails/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unosend.co/emails/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"html": "<string>",
"status": "<string>",
"created_at": "<string>",
"delivered_at": "<string>"
}