addedOutput schema / anyOf
Added value: +[
+ {
+ "properties": {
+ "agent_id": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "The agent this email belongs to: the address's agent on inbound rows, the writer on outbound rows.",
+ "title": "Agent Id"
+ },
+ "agent_reply_state": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Inbound rows routed to an agent: 'pending', 'processing', 'done', 'skipped', or 'failed'. A skipped row names why in metadata.agent_skip_reason.",
+ "title": "Agent Reply State"
+ },
+ "attachments": {
+ "default": [],
+ "description": "Inbound MIME attachments on this email. Empty on outbound rows.",
+ "items": {
+ "$ref": "#/$defs/EmailAttachmentResponse"
+ },
+ "title": "Attachments",
+ "type": "array"
+ },
+ "bcc_addresses": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "BCC recipient email addresses, if any.",
+ "title": "Bcc Addresses"
+ },
+ "body_html": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "HTML body, if any.",
+ "title": "Body Html"
+ },
+ "body_text": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Plain-text body, if any.",
+ "title": "Body Text"
+ },
+ "cc_addresses": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "CC recipient email addresses, if any.",
+ "title": "Cc Addresses"
+ },
+ "direction": {
+ "default": "outbound",
+ "description": "'outbound' for emails Hail sent, 'inbound' for emails received.",
+ "enum": [
+ "outbound",
+ "inbound"
+ ],
+ "title": "Direction",
+ "type": "string"
+ },
+ "dkim_verdict": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider DKIM-authentication verdict (e.g. 'PASS'/'FAIL'). Inbound emails only; null on outbound rows.",
+ "title": "Dkim Verdict"
+ },
+ "dmarc_verdict": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider DMARC-authentication verdict (e.g. 'PASS'/'FAIL'). Inbound emails only; null on outbound rows.",
+ "title": "Dmarc Verdict"
+ },
+ "email_domain_id": {
+ "anyOf": [
+ {
+ "format": "uuid",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The sending domain used, if from_address belongs to one of the org's configured domains.",
+ "title": "Email Domain Id"
+ },
+ "end_reason": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Reason delivery failed or bounced, if applicable. Null on success or while pending.",
+ "title": "End Reason"
+ },
+ "failed_at": {
+ "anyOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "When the send failed, ISO 8601 timestamp. Null unless it failed.",
+ "title": "Failed At"
+ },
+ "from_address": {
+ "description": "Sender email address.",
+ "title": "From Address",
+ "type": "string"
+ },
+ "from_name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Display name used on the From: header, when the sender supplied one. Always null on inbound rows.",
+ "title": "From Name"
+ },
+ "id": {
+ "description": "Unique identifier for this email.",
+ "format": "uuid",
+ "title": "Id",
+ "type": "string"
+ },
+ "idempotency_key": {
+ "description": "Key that identifies this exact request when retrying.",
+ "type": "string"
+ },
+ "in_reply_to": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "RFC 5322 In-Reply-To header. Set on inbound emails and agent replies; null on other outbound rows.",
+ "title": "In Reply To"
+ },
+ "last_event_at": {
+ "anyOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "When the most recent delivery event for this email occurred, ISO 8601 timestamp.",
+ "title": "Last Event At"
+ },
+ "message_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "RFC 5322 Message-ID header. Inbound emails only; null on outbound rows.",
+ "title": "Message Id"
+ },
+ "metadata": {
+ "additionalProperties": true,
+ "description": "Free-form JSON object attached to the email, as sent on create. Not interpreted by Hail.",
+ "title": "Metadata",
+ "type": "object"
+ },
+ "organization_id": {
+ "description": "Organization that sent or received this email.",
+ "format": "uuid",
+ "title": "Organization Id",
+ "type": "string"
+ },
+ "provider_message_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The email provider's identifier for this message, if assigned.",
+ "title": "Provider Message Id"
+ },
+ "provider_received_at": {
+ "anyOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "When the provider received this email, ISO 8601 timestamp. Inbound emails only.",
+ "title": "Provider Received At"
+ },
+ "raw_url": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "API endpoint that redirects to the original MIME blob. Inbound emails only; null on outbound rows.",
+ "title": "Raw Url"
+ },
+ "references_ids": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "RFC 5322 References header, split into ids. Set on inbound emails and agent replies; null on other outbound rows.",
+ "title": "References Ids"
+ },
+ "reply_to": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Reply-To email address, if set.",
+ "title": "Reply To"
+ },
+ "requested_at": {
+ "description": "When the send was requested, ISO 8601 timestamp.",
+ "format": "date-time",
+ "title": "Requested At",
+ "type": "string"
+ },
+ "sent_at": {
+ "anyOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "When the message was handed to the provider, ISO 8601 timestamp. Null until sent.",
+ "title": "Sent At"
+ },
+ "spam_verdict": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider spam-scan verdict (e.g. 'PASS'/'FAIL'). Inbound emails only; null on outbound rows.",
+ "title": "Spam Verdict"
+ },
+ "spf_verdict": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider SPF-authentication verdict (e.g. 'PASS'/'FAIL'). Inbound emails only; null on outbound rows.",
+ "title": "Spf Verdict"
+ },
+ "status": {
+ "description": "Delivery status: 'queued', 'sent', 'delivered', 'failed', 'bounced', 'complained', or 'received' (inbound emails).",
+ "enum": [
+ "queued",
+ "sent",
+ "delivered",
+ "failed",
+ "bounced",
+ "complained",
+ "received"
+ ],
+ "title": "Status",
+ "type": "string"
+ },
+ "subject": {
+ "description": "Email subject line.",
+ "title": "Subject",
+ "type": "string"
+ },
+ "to_addresses": {
+ "description": "Recipient email addresses.",
+ "items": {
+ "type": "string"
+ },
+ "title": "To Addresses",
+ "type": "array"
+ },
+ "virus_verdict": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Provider virus-scan verdict (e.g. 'PASS'/'FAIL'). Inbound emails only; null on outbound rows.",
+ "title": "Virus Verdict"
+ }
+ },
+ "required": [
+ "id",
+ "organization_id",
+ "email_domain_id",
+ "direction",
+ "from_address",
+ "from_name",
+ "to_addresses",
+ "cc_addresses",
+ "bcc_addresses",
+ "reply_to",
+ "subject",
+ "status",
+ "end_reason",
+ "provider_message_id",
+ "requested_at",
+ "sent_at",
+ "failed_at",
+ "metadata",
+ "body_text",
+ "body_html",
+ "message_id",
+ "in_reply_to",
+ "references_ids",
+ "agent_id",
+ "agent_reply_state",
+ "spam_verdict",
+ "virus_verdict",
+ "dkim_verdict",
+ "spf_verdict",
+ "dmarc_verdict",
+ "provider_received_at",
+ "raw_url",
+ "attachments",
+ "last_event_at",
+ "idempotency_key"
+ ],
+ "title": "EmailResponse",
+ "type": "object"
+ },
+ {
+ "properties": {
+ "error": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "error"
+ ],
+ "type": "object"
+ }
+]