Cancel Email
Cancel a scheduled email before it's dispatched. Once the email has been promoted to pending, it cannot be cancelled.
https://mail.sendcorex.com/v3.0/:id/cancelOnly scheduled emails can be cancelled. Use the id returned by Schedule Email and cancel before the email is promoted to pending.
Path parameters
idstring (UUID)requiredThe email ID returned from the schedule endpoint.
e.g.
"3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f"
Quick start
import axios from 'axios';
const emailId = '3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f';
const response = await axios.post(
'https://mail.sendcorex.com/v3.0/' + emailId + '/cancel',
{},
{ headers: { Authorization: process.env.SENDCOREX_API_KEY } }
);
console.log(response.data.code); // EMAIL_CANCELLEDResponse
{
"success": true,
"code": "EMAIL_CANCELLED",
"message": "Scheduled email cancelled successfully",
"id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f"
}Errors
All error codes → Errors return a JSON object with error and code.
- 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
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.
- 500
INTERNAL_SERVER_ERRORUnexpected server error. Try again.