Skip to main content

Cancel Validation Job

Cancel an in-progress email validation job. This will stop the validation process immediately.

API Reference

Endpoint

PATCH https://api.cliova.com/v1/webhooks/email-validations/bulk-emails/{id}/cancel?apiKey=
List ID

The id parameter is the identifier of the validation job you want to cancel (e.g., list_12345 or 11bb57b9-0901-4fb9-9664-6548cdcd3172)

Parameters

Path Parameters

ParameterRequiredTypeDescription
idYesstringThe unique identifier of the validation job

Query Parameters

ParameterRequiredTypeDescription
apiKeyYesstringYour API authentication key

Code Examples

cancelValidationJob.js
async function cancelValidationJob(apiKey, listId) {
const baseUrl =
"https://api.cliova.com/v1/webhooks/email-validations/bulk-emails";
const url = `${baseUrl}/${listId}/cancel?apiKey=${apiKey}`;

try {
const response = await fetch(url, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
});

if (!response.ok) {
const errorData = await response.json();
throw new Error(errorData.error?.message || "Cancel operation failed");
}

const result = await response.json();
return result;
} catch (error) {
console.error("Error canceling validation job:", error);
throw error;
}
}

// ----- Usage Example -----
document.getElementById("cancelButton").addEventListener("click", async () => {
try {
await cancelValidationJob("your_api_key", "list_12345");
console.log("Validation job canceled successfully");
} catch (error) {
console.error("Failed to cancel validation job:", error);
}
});

Response

A successful cancel operation returns a JSON response:

{
"success": true,
"message": "Validation job canceled successfully"
}

Best Practices

Cancellation Strategy

Safe Cancellation

Follow these guidelines for safe cancellation:

  • Verify the job is actually in progress before canceling
  • Keep track of canceled job IDs for audit purposes
  • Implement proper error handling for failed cancellations
  • Consider implementing a confirmation step in your UI
  • Handle partial results appropriately after cancellation
Important Note
  • Cancellation is immediate and stops all ongoing validations
  • Partial results up to the cancellation point will be preserved
  • The job status will be updated to "canceled"
  • Cannot cancel jobs that are already completed or archived

Need Help?

Support Resources