Email

Cancel Email

Cancel a scheduled email before it's dispatched. Once the email has been promoted to pending, it cannot be cancelled.

POSThttps://mail.sendcorex.com/v3.0/:id/cancel
!

Only 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)required

    The 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_CANCELLED

Response

{
  "success": true,
  "code": "EMAIL_CANCELLED",
  "message": "Scheduled email cancelled successfully",
  "id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f"
}

Errors return a JSON object with error and code.

  • 401MISSING_AUTH_HEADER

    No Authorization header present.

  • 401INVALID_API_KEY

    The API key is invalid or revoked.

  • 401ACCOUNT_BLOCKED

    Account has been blocked.

  • 401NO_CREDITS_LEFT

    No email credits remaining.

  • 401USER_NOT_FOUND

    User not found.

  • 401MISSING_USER_PRIVILEGES

    Missing user privileges.

  • 401EMAIL_CREDITS_NOT_FOUND

    Error fetching email credits.

  • 429CREDENTIAL_TEMPORARILY_BLOCKED

    API key temporarily blocked due to repeated policy violations.

  • 429IP_TEMPORARILY_BLOCKED

    Requesting IP temporarily blocked due to repeated policy violations.

  • 500INTERNAL_SERVER_ERROR

    Unexpected server error. Try again.