Custom Headers
Attach custom headers to your outgoing emails using the headers object on the send request.
https://mail.sendcorex.com/v3.0/sendNaming restriction: any header outside of the reserved list below must start with X-. This is enforced to prevent header injection and protect RFC-reserved fields.
Reserved headers
These headers don't need the X- prefix. For the unsubscribe headers, see Unsubscribe Headers.
List-IdIdentifies the mailing list the email belongs to.
X-Report-AbuseA URL where recipients can report abuse.
Feedback-IDIdentifier mailbox providers use to group feedback-loop reports.
List-UnsubscribeUnsubscribe methods (mailto: and/or https:).
List-Unsubscribe-PostEnables one-click unsubscribe.
Any other header
Must be prefixed with X-. Anything else is rejected before the email is queued.
Valid
"X-MyCustomHeader": "testcustom0""X-CUSTOM-X": "testcustom1"
Invalid
"MyCustomHeader": "testcustom0"- →
HEADER_NOT_ALLOWED
Quick start
import axios from 'axios';
await axios.post(
'https://mail.sendcorex.com/v3.0/send',
{
to: 'user@example.com',
from: 'noreply@yourdomain.com',
senderName: 'My App',
subject: 'Welcome aboard!',
body: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
replyTo: 'support@yourdomain.com',
headers: {
'List-Id': 'My List <mylist.yourdomain.com>',
'X-Report-Abuse': 'https://yourdomain.com/report-abuse',
'Feedback-ID': 'campaign123:subscriber456:list789:youraccount',
'List-Unsubscribe':
'<mailto:unsubscribe@yourdomain.com?subject=unsubscribe>,<https://yourdomain.com/unsubscribe?u=123>',
'List-Unsubscribe-Post': 'List-Unsubscribe=One-Click',
'X-MyCustomHeader': 'testcustom0',
'X-CUSTOM-X': 'testcustom1',
},
},
{ headers: { Authorization: process.env.SENDCOREX_API_KEY } }
);Response
{
"success": true,
"message": "Email queued successfully",
"code": "EMAIL_QUEUED_SUCCESS",
"id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f"
}Errors
All error codes → Errors return a JSON object with error, code and responseTime.
- 401
MISSING_AUTH_HEADERNo Authorization header present.
- 401
INVALID_API_KEYThe API key is invalid or revoked.
- 401
ACCOUNT_BLOCKEDAccount has been blocked.
- 401
NO_CREDITS_LEFTNo email credits remaining.
- 401
DOMAIN_NOT_VALIDATEDSender domain not verified.
- 401
LISTED_SPAM_HAUSSender domain is listed on Spamhaus.
- 401
ISP_DOMAIN_BLOCKEDSending from well-known domains (gmail.com, outlook.com, etc) is not allowed.
- 401
FROM_HEADER_DOMAIN_MISMATCHFrom header domain not authorized for this sender.
- 401
USER_NOT_FOUNDUser not found.
- 401
MISSING_USER_PRIVILEGESMissing user privileges.
- 401
EMAIL_CREDITS_NOT_FOUNDError fetching email credits.
- 429
CREDENTIAL_TEMPORARILY_BLOCKEDAPI key temporarily blocked due to repeated policy violations.
- 429
IP_TEMPORARILY_BLOCKEDRequesting IP temporarily blocked due to repeated policy violations.
- 400
MISSING_FROMThe from field is missing or empty.
- 400
INVALID_FROM_FORMATThe from field must be a valid email address.
- 400
MISSING_SENDERNAMEThe senderName field is missing or empty.
- 400
INVALID_SENDERNAME_FORMATThe senderName field contains invalid characters.
- 400
MISSING_SUBJECTThe subject field is missing or empty.
- 400
MISSING_BODYThe body field is missing or empty.
- 400
MISSING_TOADDRESSThe to field is missing or empty.
- 400
MISSING_TOThe to field is missing or empty.
- 400
INVALID_TOADDRESSOne or more recipient addresses are malformed.
- 400
TOADDRESS_LIMIT_EXCEEDEDMore than 50 recipients in the to array.
- 400
INVALID_SCHEDULED_ATscheduled_at is not a valid date or is in the past.
- 400
INVALID_SENDER_FORMATThe sender email format is invalid.
- 400
HEADER_NOT_ALLOWEDCustom header key is not on the allowed list (List-Unsubscribe, List-Id, X-*, etc).
- 400
INVALID_HEADER_VALUEHeader value contains invalid characters (CR/LF not allowed).
- 400
DANGEROUS_ATTACHMENTOne or more attachments were blocked for security reasons.
- 403
ACCOUNT_RESTRICTEDAccount is temporarily restricted.
- 403
DAILY_LIMITDaily email sending limit reached.
- 403
SPAM_DETECTEDEmail content flagged as spam. Response includes quarantine_id and release instructions.
- 403
SENDER_NAME_MISMATCHMultiple sender names detected for same address.
- 403
FOLLOWUP_PATTERN_DETECTEDEmail content flagged as repeated suspicious follow-up pattern.
- 403
SCAM_PATTERN_DETECTEDEmail content flagged as scam pattern.
- 403
ACCOUNT_SUSPENDED_SPOOFINGAccount suspended due to repeated From header spoofing attempts.
- 500
INTERNAL_SERVER_ERRORUnexpected server error. Try again.
- 500
PARSE_ERRORFailed to process email content (MIME parse failure).
- 500
PERSIST_FAILEDFailed to queue email (database persistence failure).