GET
/
api
/
v2
/
emails
/
schedule
import { Inbound } from '@inboundemail/sdk';

const inbound = new Inbound('your_api_key');

// List all scheduled emails
const { data, error } = await inbound.email.sent.listScheduled();

if (error) {
  console.error('Error:', error);
} else {
  console.log('Scheduled emails:', data.data.length);
  console.log('Total:', data.pagination.total);
}

// List only pending scheduled emails
const { data: pending } = await inbound.email.sent.listScheduled({ 
  status: 'scheduled', 
  limit: 10 
});
{
  "data": [
    {
      "id": "sch_1234567890abcdef",
      "from": "Acme <noreply@yourdomain.com>",
      "to": ["customer@example.com"],
      "subject": "Scheduled Reminder",
      "scheduled_at": "2024-12-25T14:00:00.000Z",
      "status": "scheduled",
      "timezone": "America/New_York",
      "created_at": "2024-12-24T10:30:00.000Z",
      "attempts": 0
    },
    {
      "id": "sch_0987654321fedcba",
      "from": "Acme <noreply@yourdomain.com>",
      "to": ["user@example.com"],
      "subject": "Weekly Newsletter",
      "scheduled_at": "2024-12-23T09:00:00.000Z",
      "status": "sent",
      "timezone": "UTC",
      "created_at": "2024-12-22T15:45:00.000Z",
      "attempts": 1
    },
    {
      "id": "sch_abcdef1234567890",
      "from": "Acme <noreply@yourdomain.com>",
      "to": ["admin@example.com"],
      "subject": "System Maintenance Alert",
      "scheduled_at": "2024-12-20T02:00:00.000Z",
      "status": "failed",
      "timezone": "UTC",
      "created_at": "2024-12-19T18:20:00.000Z",
      "attempts": 3,
      "last_error": "Recipient email address rejected by server"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "total": 3,
    "hasMore": false
  }
}
This endpoint allows you to view all your scheduled emails, filter by status, and paginate through results.

Authentication

This endpoint requires authentication via:
  • API key auth: Bearer token in Authorization header

Query Parameters

limit
integer
default:"50"
Maximum number of results to return per page. Range: 1-100.
offset
integer
default:"0"
Number of results to skip for pagination. Must be non-negative.
status
string
Filter scheduled emails by status. Available values:
  • scheduled - Emails waiting to be sent
  • sent - Successfully sent emails
  • failed - Failed delivery attempts
  • cancelled - Cancelled scheduled emails
If not provided, returns emails with all statuses.

Headers

Authorization
string
required
Bearer token for API authentication.

Request Example

import { Inbound } from '@inboundemail/sdk';

const inbound = new Inbound('your_api_key');

// List all scheduled emails
const { data, error } = await inbound.email.sent.listScheduled();

if (error) {
  console.error('Error:', error);
} else {
  console.log('Scheduled emails:', data.data.length);
  console.log('Total:', data.pagination.total);
}

// List only pending scheduled emails
const { data: pending } = await inbound.email.sent.listScheduled({ 
  status: 'scheduled', 
  limit: 10 
});

Response

data
array
required
Array of scheduled email objects.
pagination
object
required
Pagination information for the current request.
{
  "data": [
    {
      "id": "sch_1234567890abcdef",
      "from": "Acme <noreply@yourdomain.com>",
      "to": ["customer@example.com"],
      "subject": "Scheduled Reminder",
      "scheduled_at": "2024-12-25T14:00:00.000Z",
      "status": "scheduled",
      "timezone": "America/New_York",
      "created_at": "2024-12-24T10:30:00.000Z",
      "attempts": 0
    },
    {
      "id": "sch_0987654321fedcba",
      "from": "Acme <noreply@yourdomain.com>",
      "to": ["user@example.com"],
      "subject": "Weekly Newsletter",
      "scheduled_at": "2024-12-23T09:00:00.000Z",
      "status": "sent",
      "timezone": "UTC",
      "created_at": "2024-12-22T15:45:00.000Z",
      "attempts": 1
    },
    {
      "id": "sch_abcdef1234567890",
      "from": "Acme <noreply@yourdomain.com>",
      "to": ["admin@example.com"],
      "subject": "System Maintenance Alert",
      "scheduled_at": "2024-12-20T02:00:00.000Z",
      "status": "failed",
      "timezone": "UTC",
      "created_at": "2024-12-19T18:20:00.000Z",
      "attempts": 3,
      "last_error": "Recipient email address rejected by server"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "total": 3,
    "hasMore": false
  }
}

Usage Examples

Important Notes

Real-time Updates: The status of scheduled emails is updated in real-time as emails are processed and sent.
Status Transitions: Scheduled emails progress through states: scheduledsent (success) or scheduledfailed (after max retry attempts).
Monitoring: Use this endpoint to build dashboards and monitoring systems for your scheduled email campaigns.
1.0 - ✅