PlatformXeDocs
Get API Key

Email Queue

How the persistent retry queue and dead-letter queue work.

When an email cannot be delivered on the first attempt, it enters the PlatformXe persistent retry queue. The queue uses exponential backoff to retry delivery without overwhelming downstream providers.

Backoff schedule

AttemptDelay
1Immediate
230 seconds
31 minute
42 minutes
55 minutes
615 minutes
730 minutes
81 hour

After 7 retry attempts (8 total attempts including the first), the email moves to the dead-letter queue and is no longer retried automatically.

Dead-letter queue

Emails in the dead-letter queue have exhausted all retry attempts. These typically indicate a persistent issue such as:

  • Invalid recipient address (hard bounce)
  • Recipient mailbox full (soft bounce that never resolved)
  • All providers in the fallback chain are down for an extended period

Dead-lettered emails emit an EMAIL_FAILED event. Subscribe to this event via webhooks to get notified when emails cannot be delivered.

Queue statistics

Retrieve current queue stats to monitor delivery health.

GET /api/v1/messaging/queue/stats

Scope: messaging:send

Response

{
  "success": true,
  "data": {
    "pending": 12,
    "retrying": 3,
    "deadLettered": 1,
    "processedLast24h": 4821
  }
}
FieldDescription
pendingEmails waiting for first delivery attempt
retryingEmails in the retry backoff cycle
deadLetteredEmails that exhausted all retries
processedLast24hSuccessfully delivered in the last 24 hours

Manual queue processing

Trigger queue processing manually, useful after resolving a known provider outage.

POST /api/v1/messaging/queue/process

Scope: messaging:send

Response

{
  "success": true,
  "data": {
    "processed": 15,
    "failed": 2,
    "remaining": 0
  }
}

You typically do not need to call this endpoint. The queue processes automatically on a schedule. Use it only when you want to force immediate processing after an incident.