GET
/
api
/
v2
/
mail
GET https://inbound.new/api/v2/mail
{
  "emails": [
    {
      "id": "email_123",
      "emailId": "ses_456",
      "messageId": "<message@example.com>",
      "subject": "Important Update",
      "from": "sender@example.com",
      "fromName": "John Doe",
      "recipient": "hello@yourdomain.com",
      "preview": "This is a preview of the email content...",
      "receivedAt": "2024-01-15T10:30:00Z",
      "isRead": false,
      "readAt": null,
      "hasAttachments": true,
      "attachmentCount": 2,
      "parseSuccess": true,
      "parseError": null,
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "total": 150,
    "limit": 50,
    "offset": 0,
    "hasMore": true
  },
  "filters": {
    "uniqueDomains": ["example.com", "yourdomain.com", "test.com"]
  }
}
GET https://inbound.new/api/v2/mail

Authentication

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

Query Parameters

limit
integer
default:"50"
Maximum number of emails to return. Range: 1-100.
offset
integer
default:"0"
Number of emails to skip for pagination. Must be non-negative.
Search query to filter emails by subject, sender, or recipient.
status
string
default:"all"
Filter emails by processing status. Options: all, processed, failed
domain
string
default:"all"
Filter emails by recipient domain. Use specific domain name or all for no filter.
timeRange
string
default:"30d"
Filter emails by time range. Options: 24h, 7d, 30d, 90d
includeArchived
boolean
default:"false"
Whether to include archived emails in the results. By default, archived emails are excluded.

Request Examples

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

Response

{
  "emails": [
    {
      "id": "email_123",
      "emailId": "ses_456",
      "messageId": "<message@example.com>",
      "subject": "Important Update",
      "from": "sender@example.com",
      "fromName": "John Doe",
      "recipient": "hello@yourdomain.com",
      "preview": "This is a preview of the email content...",
      "receivedAt": "2024-01-15T10:30:00Z",
      "isRead": false,
      "readAt": null,
      "hasAttachments": true,
      "attachmentCount": 2,
      "parseSuccess": true,
      "parseError": null,
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "total": 150,
    "limit": 50,
    "offset": 0,
    "hasMore": true
  },
  "filters": {
    "uniqueDomains": ["example.com", "yourdomain.com", "test.com"]
  }
}

Response Fields

emails
array
Array of email objects matching the query criteria.
pagination
object
Pagination information for the current request.
filters
object
Available filter options based on your data.

Error Responses

Usage Examples

Basic Pagination

let allEmails = [];
let offset = 0;
const limit = 50;

while (true) {
  const response = await fetch(`https://inbound.new/api/v2/mail?limit=${limit}&offset=${offset}`, {
    headers: { 'Authorization': `Bearer ${apiKey}` }
  });
  
  const data = await response.json();
  allEmails.push(...data.emails);
  
  if (!data.pagination.hasMore) break;
  offset += limit;
}

Search with Filters

const searchEmails = async (query, domain, timeRange) => {
  const params = new URLSearchParams({
    search: query,
    domain: domain,
    timeRange: timeRange,
    status: 'processed'
  });
  
  const response = await fetch(`https://inbound.new/api/v2/mail?${params}`, {
    headers: { 'Authorization': `Bearer ${apiKey}` }
  });
  
  return await response.json();
};
Use the uniqueDomains array from the response to populate domain filter dropdowns in your application.