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}
| Address | https://api.hanzo.ai/v1/email/{id} |
| Method | GET |
| Operation | get_email_by_id |
| Auth | Authorization: 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.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is our id for the message (msg_…). |
Response
| Status | Body | Meaning |
|---|---|---|
200 | email.MessageRecord | ok |
default | problem-details | refused |
200 body — 20 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
bounce | body | string | — | Bounce is hard or soft, for a message that bounced. |
bounced_at | body | string (date-time) | — | BouncedAt is when it bounced, and Bounce whether hard or soft. |
campaign | body | string | — | Campaign is the campaign the message was tagged with. |
clicked_at | body | string (date-time) | — | ClickedAt is when a link in it was first clicked. |
complained_at | body | string (date-time) | — | ComplainedAt is when its recipient reported it as spam. |
created_at | body | string (date-time) | — | CreatedAt is when the message was sent, or accepted to be. |
delivered_at | body | string (date-time) | — | DeliveredAt is when the receiving server first took it. |
error | body | string | — | Error says why it failed, bounced, was deferred or was rejected. |
from | body | string | — | From is the sender address, when known. |
id | body | string | — | 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_key | body | string | — | IdempotencyKey is the key the message was sent under. |
opened_at | body | string (date-time) | — | OpenedAt is when it was first opened. |
org | body | string | — | Org is the organization owning this message. |
origin | body | string | — | 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. |
provider | body | string | — | Provider is the rail it went by: ses or sendgrid. |
provider_id | body | string | — | ProviderID is the provider's own id for the message, which its events name it by; empty until the provider answers one. |
status | body | string | — | Status is queued, sent, failed, delivered, opened, clicked, bounced or complained. |
subject | body | string | — | Subject is the message subject line, when known. |
to | body | string[] | — | To lists the recipients. |
unsubscribed_at | body | string (date-time) | — | UnsubscribedAt is when its recipient unsubscribed from it. |
Failure carries the platform error shape — see Errors.
Examples
CLI
SDK
HTTP
MCP
hanzo email get <id>.ts
.py
.go
.rs
.java
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>"
}
}
}
}'Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.