The PristineSend API uses conventional HTTP status codes to indicate success or failure. All error responses share the same JSON envelope.
Every non-2xx response body is a JSON object with a single error field:
For 500 errors triggered by Resend, the response may also include a details field with Resend's error message.
The request was malformed or missing required fields. Fix the request before retrying.
| Status | Error message | Cause / Fix |
|---|---|---|
| 400 | Missing required fields: to, subject, html | One or more required body fields are absent. Fix: Include to, subject, and html in the JSON body. |
| 400 | No Resend API key configured for this workspace | Your PristineSend workspace has no Resend key set. Fix: Go to Settings → Sending and add your Resend API key. |
Authentication failed. The API key is missing, malformed, or invalid.
| Status | Error message | Cause / Fix |
|---|---|---|
| 401 | Missing or invalid Authorization header | The Authorization header is absent or malformed. Fix: Include Authorization: Bearer ps_live_YOUR_KEY in every request. |
| 401 | Invalid API key | The key was not found or has been rotated. Fix: Regenerate your key in Settings → API Keys and update your env vars. |
An unexpected error occurred. These are safe to retry with exponential backoff.
| Status | Error message | Cause / Fix |
|---|---|---|
| 500 | Failed to send email | Resend rejected the send — details in the details field. Fix: Check the details field and your Resend account for quota or domain issues. |
| 500 | Internal server error | An unexpected error occurred in PristineSend. Fix: Retry with exponential backoff. If the issue persists contact support. |
Branch on the HTTP status code rather than the error string, as messages may change: