import Inbound from 'inboundemail';
const client = new Inbound({
apiKey: process.env['INBOUND_API_KEY'], // This is the default and can be omitted
});
const emails = await client.emails.list();
console.log(emails.data);{
"data": [
{
"id": "<string>",
"type": "sent",
"from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"status": "<string>",
"created_at": "<string>",
"has_attachments": true,
"message_id": "<string>",
"from_name": "<string>",
"cc": [
"<string>"
],
"preview": "<string>",
"sent_at": "<string>",
"scheduled_at": "<string>",
"attachment_count": 123,
"is_read": true,
"read_at": "<string>",
"is_archived": true,
"thread_id": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123,
"has_more": true
},
"filters": {
"type": "<string>",
"status": "<string>",
"time_range": "<string>",
"search": "<string>",
"domain": "<string>",
"address": "<string>"
}
}List all email activity (sent, received, and scheduled) with comprehensive filtering options.
import Inbound from 'inboundemail';
const client = new Inbound({
apiKey: process.env['INBOUND_API_KEY'], // This is the default and can be omitted
});
const emails = await client.emails.list();
console.log(emails.data);{
"data": [
{
"id": "<string>",
"type": "sent",
"from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"status": "<string>",
"created_at": "<string>",
"has_attachments": true,
"message_id": "<string>",
"from_name": "<string>",
"cc": [
"<string>"
],
"preview": "<string>",
"sent_at": "<string>",
"scheduled_at": "<string>",
"attachment_count": 123,
"is_read": true,
"read_at": "<string>",
"is_archived": true,
"thread_id": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123,
"has_more": true
},
"filters": {
"type": "<string>",
"status": "<string>",
"time_range": "<string>",
"search": "<string>",
"domain": "<string>",
"address": "<string>"
}
}Your Inbound API key. Include it in the Authorization header as: Bearer
all, sent, received, scheduled all, delivered, pending, failed, bounced, scheduled, cancelled, unread, read, archived 1h, 24h, 7d, 30d, 90d, all Search query to filter emails by subject, sender, or recipient. Case-insensitive partial match.
Filter by domain. Accepts domain ID (e.g., 'dom_xxx') or domain name (e.g., 'example.com').
Filter by email address. Accepts address ID (e.g., 'addr_xxx') or raw email address (e.g., 'user@example.com').
Maximum number of emails to return (1-100). Default is 50.
Number of emails to skip for pagination. Default is 0.
Was this page helpful?