---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/api-reference/email/cancel

Email

# Cancel Email

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

POST `https://mail.sendcorex.com/v3.0/:id/cancel`

**Only scheduled emails can be cancelled.** Use the `id` returned by [Schedule Email](https://docs.sendcorex.com/api-reference/email/schedule) and cancel before the email is promoted to pending.

## Path parameters

- `id` string (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

[All error codes →](https://docs.sendcorex.com/api-reference/errors)

Errors return a JSON object with `error` and `code`.

- 401`MISSING_AUTH_HEADER`
No Authorization header present.
- 401`INVALID_API_KEY`
The API key is invalid or revoked.
- 401`ACCOUNT_BLOCKED`
Account has been blocked.
- 401`NO_CREDITS_LEFT`
Not enough email credits for every recipient. Each to, cc and bcc address uses 1 credit.
- 401`USER_NOT_FOUND`
User not found.
- 401`MISSING_USER_PRIVILEGES`
Missing user privileges.
- 401`EMAIL_CREDITS_NOT_FOUND`
Error fetching email credits.
- 401`EMAIL_NOT_VALIDATED`
Account email address has not been verified yet.
- 429`CREDENTIAL_TEMPORARILY_BLOCKED`
API key temporarily blocked due to repeated policy violations.
- 429`IP_TEMPORARILY_BLOCKED`
Requesting IP temporarily blocked due to repeated policy violations.
- 429`TOO_MANY_CONCURRENT_CONNECTIONS`
Too many concurrent requests from this IP. Try again shortly.
- 500`INTERNAL_SERVER_ERROR`
Unexpected server error. Try again.
- 503`AUTH_UNAVAILABLE`
Could not validate the API key right now. Try again.
