ZapSMTP / Docs / Received emailsResponse
Retrieve a received email
GET/v1/emails/receiving/{id}
Retrieve a received email with bodies, headers, authentication results and download links.
Requires a full-access key.
automated is null for mail a person wrote, else {type, reason}: bounce (delivery status notification), out_of_office, auto_reply, auto_generated (notifications, null sender) or bulk (mailing lists). Detected from Auto-Submitted, X-Autoreply, Precedence, List-Id, multipart/report and well-known subjects; reason names the evidence.
tls: the TLS version the sending server used (e.g. TLSv1_3); empty when the message was not encrypted.
Path parameters
idstring (UUID)required- Received email id
Query parameters
html_formatstring- cid: return html as received (cid: references to inline parts). Any other value: inline images are embedded as data: URIs (html_format in the response reports what was returned). One of
data_uri,cid. Defaultdata_uri.
Errors
restricted_api_keyHTTP 403not_foundHTTP 404- unknown/non-UUID id or past plan retention
inbound_not_configuredHTTP 503
curl 'https://zapsmtp.xyz/v1/emails/receiving/019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23' \
-H "Authorization: Bearer $ZAP_API_KEY"const res = await fetch('https://zapsmtp.xyz/v1/emails/receiving/019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.ZAP_API_KEY}`,
},
});
// 204 No Content (e.g. a delete) has no body
const data = res.status === 204 ? null : await res.json();
if (!res.ok) throw new Error(`${data.name}: ${data.message}`);
console.log(data);import os
import requests
res = requests.get(
"https://zapsmtp.xyz/v1/emails/receiving/019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23",
headers={"Authorization": f"Bearer {os.environ['ZAP_API_KEY']}"},
timeout=30,
)
res.raise_for_status()
print(res.json() if res.status_code != 204 else "deleted")<?php
$ch = curl_init('https://zapsmtp.xyz/v1/emails/receiving/019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ZAP_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException($data['message']);
}
print_r($data);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest(
"GET",
"https://zapsmtp.xyz/v1/emails/receiving/019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23",
nil,
)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ZAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}require 'net/http'
require 'json'
uri = URI('https://zapsmtp.xyz/v1/emails/receiving/019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV.fetch('ZAP_API_KEY')}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, (JSON.parse(res.body) unless res.body.to_s.empty?)import java.net.URI;
import java.net.http.*;
public class ZapRequest {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder(URI.create("https://zapsmtp.xyz/v1/emails/receiving/019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23"))
.header("Authorization", "Bearer " + System.getenv("ZAP_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var http = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://zapsmtp.xyz/v1/emails/receiving/019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23");
request.Headers.Authorization = new AuthenticationHeaderValue(
"Bearer", Environment.GetEnvironmentVariable("ZAP_API_KEY"));
var response = await http.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");Set
ZAP_API_KEY in your environment.Response 200 OK
{
"object": "email",
"id": "019a1f30-1d4e-7a6b-8c2d-3e4f5a6b7c8d",
"created_at": "2026-10-21T15:10:02.904Z",
"from": "jane@example.org",
"to": [
"support@acme.com"
],
"cc": [],
"bcc": [],
"reply_to": [],
"received_for": [
"support+1234@acme.com"
],
"subject": "Re: Ticket #1234",
"message_id": "<CAF=abc123@mail.example.org>",
"html": "<p>Thanks, that fixed it!</p><blockquote>...</blockquote>",
"html_format": "data_uri",
"text": "Thanks, that fixed it!\n\nOn Tue, Oct 21, 2026 Acme wrote:\n> ...",
"headers": {
"Subject": "Re: Ticket #1234",
"From": "Jane Doe <jane@example.org>",
"To": "support@acme.com"
},
"authentication": {
"spf": "pass",
"dkim": "pass",
"dmarc": "pass"
},
"raw": {
"download_url": "https://zapsmtp.xyz/v1/files/eyJ0Ijoi....Qm9n",
"expires_at": "2026-10-21T16:12:00Z"
},
"attachments": [
{
"object": "attachment",
"id": "5b0f8f7e-2a1c-5d3e-9f4a-6b7c8d9e0f1a",
"filename": "screenshot.png",
"content_type": "image/png",
"content_disposition": "attachment",
"content_id": null,
"size": 48213
}
],
"from_name": "Jane Doe",
"reply_text": "Thanks, that fixed it!",
"mailbox_hash": "1234",
"in_reply_to_email_id": "019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23",
"thread_id": "3f1c9a52-6b0e-5d4f-8a71-2c9e0b4d6f13",
"automated": null,
"envelope": {
"from": "jane@example.org",
"to": "support+1234@acme.com"
},
"spam": {
"score": 1.2,
"is_spam": false,
"action": "no action"
},
"arc": "unknown",
"route_id": "019a1f31-0b2c-7d3e-8f4a-5b6c7d8e9f01",
"action": "webhook",
"status": "received",
"size": 61877,
"peer_ip": "198.51.100.7",
"helo": "mail.example.org"
}