List email

Reads a page of the org's ledger, newest first: every message sent through POST /v1/email, and every message SES or SendGrid told of by its events, sent from anywhere on the org's account.

GET /v1/email

Addresshttps://api.hanzo.ai/v1/email
MethodGET
Operationget_email
AuthAuthorization: Bearer $HANZO_API_KEY

Reads a page of the org's ledger, newest first: every message sent through POST /v1/email, and every message SES or SendGrid told of by its events, sent from anywhere on the org's account. It narrows by status, provider, a range of send time (since, until) and one recipient, and pages by cursor: pass the answer's next to read the page after.

GET /v1/email

Request

7 fields.

FieldInTypeRequiredDescription
limitqueryinteger—Limit is the most messages on the page (default 50, max 200).
statusquerystring—Status is one status to list: queued, sent, failed, delivered, opened, clicked, bounced or complained.
providerquerystring—Provider is ses or sendgrid.
sincequerystring—Since is the earliest send time listed, RFC 3339.
untilquerystring—Until is the send time listing stops before, RFC 3339.
recipientquerystring—Recipient lists the messages to one address.
cursorquerystring—Cursor is the next of the page before; empty is the newest page.

Response

StatusBodyMeaning
200email.ListMessagesResultok
defaultproblem-detailsrefused

200 body — 22 fields.

FieldInTypeAlwaysDescription
messagesbodyemail.MessageRecord[]—Messages is the page.
messages[].bouncebodystring—Bounce is hard or soft, for a message that bounced.
messages[].bounced_atbodystring (date-time)—BouncedAt is when it bounced, and Bounce whether hard or soft.
messages[].campaignbodystring—Campaign is the campaign the message was tagged with.
messages[].clicked_atbodystring (date-time)—ClickedAt is when a link in it was first clicked.
messages[].complained_atbodystring (date-time)—ComplainedAt is when its recipient reported it as spam.
messages[].created_atbodystring (date-time)—CreatedAt is when the message was sent, or accepted to be.
messages[].delivered_atbodystring (date-time)—DeliveredAt is when the receiving server first took it.
messages[].errorbodystring—Error says why it failed, bounced, was deferred or was rejected.
messages[].frombodystring—From is the sender address, when known.
messages[].idbodystring—ID is our id for the message (msg_…): every link in it carries it as from=, and the event stream names it by it.
messages[].idempotency_keybodystring—IdempotencyKey is the key the message was sent under.
messages[].opened_atbodystring (date-time)—OpenedAt is when it was first opened.
messages[].orgbodystring—Org is the organization owning this message.
messages[].originbodystring—Origin is api for a message POST /v1/email sent, provider for one the provider's events told of, sent from the org's own tools.
messages[].providerbodystring—Provider is the rail it went by: ses or sendgrid.
messages[].provider_idbodystring—ProviderID is the provider's own id for the message, which its events name it by; empty until the provider answers one.
messages[].statusbodystring—Status is queued, sent, failed, delivered, opened, clicked, bounced or complained.
messages[].subjectbodystring—Subject is the message subject line, when known.
messages[].tobodystring[]—To lists the recipients.
messages[].unsubscribed_atbodystring (date-time)—UnsubscribedAt is when its recipient unsubscribed from it.
nextbodystring—Next is the cursor of the page after this one; empty on the last page.

Failure carries the platform error shape — see Errors.

Examples

hanzo email list
import { Configuration, EmailApi } from 'hanzoai';

const api = new EmailApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getEmail();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EmailApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = EmailApi(client).get_email()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.EmailAPI.GetEmail(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, email_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = email_api::get_email(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EmailApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new EmailApi(client).getEmail();
curl https://api.hanzo.ai/v1/email \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches email through the email tool, which names its 8 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_emails"
         }
       }
     }'

Email API · All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.