Get email

Reads one message of the org's ledger, sent through this API or told of by its provider, with what became of it.

GET /v1/email/{id}

Addresshttps://api.hanzo.ai/v1/email/{id}
MethodGET
Operationget_email_by_id
AuthAuthorization: Bearer $HANZO_API_KEY

Reads one message of the org's ledger, sent through this API or told of by its provider, with what became of it.

GET /v1/email/:id

Request

1 field.

FieldInTypeRequiredDescription
idpathstringyesID is our id for the message (msg_…).

Response

StatusBodyMeaning
200email.MessageRecordok
defaultproblem-detailsrefused

200 body — 20 fields.

FieldInTypeAlwaysDescription
bouncebodystring—Bounce is hard or soft, for a message that bounced.
bounced_atbodystring (date-time)—BouncedAt is when it bounced, and Bounce whether hard or soft.
campaignbodystring—Campaign is the campaign the message was tagged with.
clicked_atbodystring (date-time)—ClickedAt is when a link in it was first clicked.
complained_atbodystring (date-time)—ComplainedAt is when its recipient reported it as spam.
created_atbodystring (date-time)—CreatedAt is when the message was sent, or accepted to be.
delivered_atbodystring (date-time)—DeliveredAt is when the receiving server first took it.
errorbodystring—Error says why it failed, bounced, was deferred or was rejected.
frombodystring—From is the sender address, when known.
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.
idempotency_keybodystring—IdempotencyKey is the key the message was sent under.
opened_atbodystring (date-time)—OpenedAt is when it was first opened.
orgbodystring—Org is the organization owning this message.
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.
providerbodystring—Provider is the rail it went by: ses or sendgrid.
provider_idbodystring—ProviderID is the provider's own id for the message, which its events name it by; empty until the provider answers one.
statusbodystring—Status is queued, sent, failed, delivered, opened, clicked, bounced or complained.
subjectbodystring—Subject is the message subject line, when known.
tobodystring[]—To lists the recipients.
unsubscribed_atbodystring (date-time)—UnsubscribedAt is when its recipient unsubscribed from it.

Failure carries the platform error shape — see Errors.

Examples

hanzo email get <id>
import { Configuration, EmailApi } from 'hanzoai';

const api = new EmailApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getEmailById({ id: 'id' });
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_by_id(id='id')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.EmailAPI.GetEmailById(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_by_id(&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).getEmailById();
curl https://api.hanzo.ai/v1/email/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool email, op get_email_by_id — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "email",
         "arguments": {
           "op": "get_email_by_id",
           "input": {
             "id": "<id>"
           }
         }
       }
     }'

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.