GET
/
api
/
v2
/
mail
/
{id}
GET https://inbound.new/api/v2/mail/{id}
{
  "id": "email_123",
  "emailId": "ses_456",
  "messageId": "<message@example.com>",
  "subject": "Important Update",
  "from": "sender@example.com",
  "fromName": "John Doe",
  "to": "recipient@yourdomain.com",
  "cc": "cc@example.com",
  "bcc": null,
  "replyTo": "reply@example.com",
  "recipient": "recipient@yourdomain.com",
  "receivedAt": "2024-01-15T10:30:00Z",
  "isRead": true,
  "readAt": "2024-01-15T12:00:00Z",
  "content": {
    "textBody": "This is the plain text version of the email...",
    "htmlBody": "<html><body><p>This is the HTML version...</p></body></html>",
    "rawContent": "Received: from mail.example.com...",
    "attachments": [
      {
        "filename": "document.pdf",
        "contentType": "application/pdf",
        "size": 102400,
        "contentId": "att_123"
      }
    ],
    "headers": {
      "received": ["from mail.example.com..."],
      "x-mailer": "Example Mailer 1.0",
      "content-type": "multipart/mixed"
    }
  },
  "addresses": {
    "from": {
      "text": "John Doe <sender@example.com>",
      "addresses": [
        {
          "address": "sender@example.com",
          "name": "John Doe"
        }
      ]
    },
    "to": {
      "text": "recipient@yourdomain.com",
      "addresses": [
        {
          "address": "recipient@yourdomain.com",
          "name": null
        }
      ]
    },
    "cc": {
      "text": "cc@example.com",
      "addresses": [
        {
          "address": "cc@example.com",
          "name": null
        }
      ]
    },
    "bcc": null,
    "replyTo": {
      "text": "reply@example.com",
      "addresses": [
        {
          "address": "reply@example.com",
          "name": null
        }
      ]
    }
  },
  "metadata": {
    "inReplyTo": "<previous@example.com>",
    "references": [
      "<ref1@example.com>",
      "<ref2@example.com>"
    ],
    "priority": "normal",
    "parseSuccess": true,
    "parseError": null,
    "hasAttachments": true,
    "attachmentCount": 1,
    "hasTextBody": true,
    "hasHtmlBody": true
  },
  "security": {
    "spf": "PASS",
    "dkim": "PASS",
    "dmarc": "PASS",
    "spam": "PASS",
    "virus": "PASS"
  },
  "processing": {
    "processingTimeMs": 245,
    "timestamp": "2024-01-15T10:30:00Z",
    "receiptTimestamp": "2024-01-15T10:30:00Z",
    "actionType": "SNS",
    "s3Info": {
      "bucketName": "inbound-emails",
      "objectKey": "emails/2024/01/15/email_123.eml",
      "contentFetched": true,
      "contentSize": 51200,
      "error": null
    },
    "commonHeaders": {
      "from": ["sender@example.com"],
      "to": ["recipient@yourdomain.com"],
      "messageId": "<message@example.com>",
      "subject": "Important Update"
    }
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T12:00:00Z"
}
GET https://inbound.new/api/v2/mail/{id}

Authentication

Authorization
string
required
Bearer token for API authentication. Format: Bearer YOUR_API_KEY

Path Parameters

id
string
required
Unique identifier for the email record. Must be a valid email ID.

Request Examples

curl -X GET https://inbound.new/api/v2/mail/email_123 \
  -H "Authorization: Bearer your_api_key_here"

Response

{
  "id": "email_123",
  "emailId": "ses_456",
  "messageId": "<message@example.com>",
  "subject": "Important Update",
  "from": "sender@example.com",
  "fromName": "John Doe",
  "to": "recipient@yourdomain.com",
  "cc": "cc@example.com",
  "bcc": null,
  "replyTo": "reply@example.com",
  "recipient": "recipient@yourdomain.com",
  "receivedAt": "2024-01-15T10:30:00Z",
  "isRead": true,
  "readAt": "2024-01-15T12:00:00Z",
  "content": {
    "textBody": "This is the plain text version of the email...",
    "htmlBody": "<html><body><p>This is the HTML version...</p></body></html>",
    "rawContent": "Received: from mail.example.com...",
    "attachments": [
      {
        "filename": "document.pdf",
        "contentType": "application/pdf",
        "size": 102400,
        "contentId": "att_123"
      }
    ],
    "headers": {
      "received": ["from mail.example.com..."],
      "x-mailer": "Example Mailer 1.0",
      "content-type": "multipart/mixed"
    }
  },
  "addresses": {
    "from": {
      "text": "John Doe <sender@example.com>",
      "addresses": [
        {
          "address": "sender@example.com",
          "name": "John Doe"
        }
      ]
    },
    "to": {
      "text": "recipient@yourdomain.com",
      "addresses": [
        {
          "address": "recipient@yourdomain.com",
          "name": null
        }
      ]
    },
    "cc": {
      "text": "cc@example.com",
      "addresses": [
        {
          "address": "cc@example.com",
          "name": null
        }
      ]
    },
    "bcc": null,
    "replyTo": {
      "text": "reply@example.com",
      "addresses": [
        {
          "address": "reply@example.com",
          "name": null
        }
      ]
    }
  },
  "metadata": {
    "inReplyTo": "<previous@example.com>",
    "references": [
      "<ref1@example.com>",
      "<ref2@example.com>"
    ],
    "priority": "normal",
    "parseSuccess": true,
    "parseError": null,
    "hasAttachments": true,
    "attachmentCount": 1,
    "hasTextBody": true,
    "hasHtmlBody": true
  },
  "security": {
    "spf": "PASS",
    "dkim": "PASS",
    "dmarc": "PASS",
    "spam": "PASS",
    "virus": "PASS"
  },
  "processing": {
    "processingTimeMs": 245,
    "timestamp": "2024-01-15T10:30:00Z",
    "receiptTimestamp": "2024-01-15T10:30:00Z",
    "actionType": "SNS",
    "s3Info": {
      "bucketName": "inbound-emails",
      "objectKey": "emails/2024/01/15/email_123.eml",
      "contentFetched": true,
      "contentSize": 51200,
      "error": null
    },
    "commonHeaders": {
      "from": ["sender@example.com"],
      "to": ["recipient@yourdomain.com"],
      "messageId": "<message@example.com>",
      "subject": "Important Update"
    }
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T12:00:00Z"
}

Response Fields

id
string
Unique identifier for the email record.
emailId
string
Original email ID from the email service.
messageId
string
Message ID from the email headers.
subject
string
Email subject line.
from
string
Sender’s email address.
fromName
string | null
Sender’s display name, if available.
to
string
Primary recipient’s email address.
cc
string | null
Carbon copy recipients, if any.
bcc
string | null
Blind carbon copy recipients, if any.
replyTo
string | null
Reply-to email address, if different from sender.
recipient
string
Primary recipient’s email address (same as ‘to’ for backward compatibility).
receivedAt
string
ISO 8601 timestamp when the email was received.
isRead
boolean
Whether the email has been read. Automatically set to true when fetched.
readAt
string
ISO 8601 timestamp when the email was read.
content
object
Complete email content and attachments.
addresses
object
Parsed email addresses with names.
metadata
object
Email metadata and parsing information.
security
object
Email security verification results.
processing
object
Email processing and storage information.
createdAt
string
ISO 8601 timestamp when the email record was created.
updatedAt
string
ISO 8601 timestamp when the email record was last updated.

Error Responses

Usage Examples

Basic Email Retrieval

const getEmailDetails = async (emailId) => {
  const response = await fetch(`https://inbound.new/api/v2/mail/${emailId}`, {
    headers: {
      'Authorization': `Bearer ${process.env.INBOUND_API_KEY}`
    }
  });
  
  if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`);
  }
  
  return await response.json();
};

// Usage
const email = await getEmailDetails('email_123');
console.log(email.subject);
console.log(email.content.textBody);

Processing Attachments

const processEmailAttachments = async (emailId) => {
  const email = await getEmailDetails(emailId);
  
  if (email.metadata.hasAttachments) {
    email.content.attachments.forEach(attachment => {
      console.log(`Attachment: ${attachment.filename}`);
      console.log(`Type: ${attachment.contentType}`);
      console.log(`Size: ${attachment.size} bytes`);
    });
  }
};

Security Verification Check

const checkEmailSecurity = async (emailId) => {
  const email = await getEmailDetails(emailId);
  
  const securityPassed = 
    email.security.spf === 'PASS' &&
    email.security.dkim === 'PASS' &&
    email.security.dmarc === 'PASS' &&
    email.security.spam === 'PASS' &&
    email.security.virus === 'PASS';
  
  return {
    emailId,
    securityPassed,
    details: email.security
  };
};
When you fetch an email using this endpoint, it’s automatically marked as read and the readAt timestamp is updated.
Use the metadata.parseSuccess field to check if the email was parsed correctly. If parseSuccess is false, check the parseError field for details.