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

const inbound = new Inbound('your_api_key');

// Get scheduled email details
const { data, error } = await inbound.email.sent.getScheduled('sch_1234567890abcdef');

if (error) {
  console.error('Error:', error);
} else {
  console.log('Email status:', data.status);
  console.log('Scheduled for:', data.scheduled_at);
  console.log('Subject:', data.subject);
  
  if (data.status === 'failed') {
    console.log('Last error:', data.last_error);
  }
}
{
  "id": "sch_1234567890abcdef",
  "from": "Acme <noreply@yourdomain.com>",
  "to": ["customer@example.com"],
  "cc": [],
  "bcc": [],
  "replyTo": [],
  "subject": "Scheduled Reminder",
  "text": "This is your scheduled reminder!",
  "html": "<h1>This is your scheduled reminder!</h1>",
  "headers": {},
  "attachments": [],
  "tags": [
    {
      "name": "campaign",
      "value": "reminder"
    }
  ],
  "scheduled_at": "2024-12-25T14:00:00.000Z",
  "timezone": "America/New_York",
  "status": "scheduled",
  "attempts": 0,
  "max_attempts": 3,
  "created_at": "2024-12-24T10:30:00.000Z",
  "updated_at": "2024-12-24T10:30:00.000Z"
}
This endpoint provides complete details of a scheduled email, including its current status, delivery attempts, and all original content.

Authentication

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

Path Parameters

id
string
required
Unique identifier of the scheduled email to retrieve.

Headers

Authorization
string
required
Bearer token for API authentication.

Request Example

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

const inbound = new Inbound('your_api_key');

// Get scheduled email details
const { data, error } = await inbound.email.sent.getScheduled('sch_1234567890abcdef');

if (error) {
  console.error('Error:', error);
} else {
  console.log('Email status:', data.status);
  console.log('Scheduled for:', data.scheduled_at);
  console.log('Subject:', data.subject);
  
  if (data.status === 'failed') {
    console.log('Last error:', data.last_error);
  }
}

Response

id
string
required
Unique identifier for the scheduled email.
from
string
required
Sender email address.
to
array
required
Array of recipient email addresses.
cc
array
Array of CC recipient email addresses.
bcc
array
Array of BCC recipient email addresses.
replyTo
array
Array of reply-to email addresses.
subject
string
required
Email subject line.
text
string
Plain text version of the email body.
html
string
HTML version of the email body.
headers
object
Custom headers attached to the email.
attachments
array
Array of file attachments included with the email.
tags
array
Array of tag objects for email categorization.
scheduled_at
string
required
ISO 8601 timestamp of when the email is/was scheduled to be sent.
timezone
string
required
Timezone used for scheduling the email.
status
string
required
Current status of the scheduled email: scheduled, sent, failed, or cancelled.
attempts
integer
required
Number of delivery attempts made.
max_attempts
integer
required
Maximum number of delivery attempts allowed before marking as failed.
next_retry_at
string
ISO 8601 timestamp of when the next delivery attempt will be made (only present if status is ‘failed’ and more attempts remain).
last_error
string
Error message from the last failed delivery attempt (only present if status is ‘failed’).
created_at
string
required
ISO 8601 timestamp of when the email was originally scheduled.
updated_at
string
required
ISO 8601 timestamp of when the email record was last updated.
sent_at
string
ISO 8601 timestamp of when the email was successfully sent (only present if status is ‘sent’).
sent_email_id
string
ID of the sent email record (only present if status is ‘sent’).
{
  "id": "sch_1234567890abcdef",
  "from": "Acme <noreply@yourdomain.com>",
  "to": ["customer@example.com"],
  "cc": [],
  "bcc": [],
  "replyTo": [],
  "subject": "Scheduled Reminder",
  "text": "This is your scheduled reminder!",
  "html": "<h1>This is your scheduled reminder!</h1>",
  "headers": {},
  "attachments": [],
  "tags": [
    {
      "name": "campaign",
      "value": "reminder"
    }
  ],
  "scheduled_at": "2024-12-25T14:00:00.000Z",
  "timezone": "America/New_York",
  "status": "scheduled",
  "attempts": 0,
  "max_attempts": 3,
  "created_at": "2024-12-24T10:30:00.000Z",
  "updated_at": "2024-12-24T10:30:00.000Z"
}

Status Information

Important Notes

Real-time Status: The status and attempt information is updated in real-time as the system processes scheduled emails.
Access Control: You can only retrieve scheduled emails that belong to your account.
Monitoring: Use this endpoint to build monitoring and alerting systems for critical scheduled emails.
1.0 - ✅