Archive/Delete Validation Job
Archive/Delete a completed or in-progress email validation job and its associated results.
API Reference
Endpoint
DELETE https://api.cliova.com/v1/webhooks/email-validations/bulk-emails/{id}/archive?apiKey={apiKey}
List ID
The id
parameter is the identifier of the validation job you want to archive (e.g., list_12345
or 11bb57b9-0901-4fb9-9664-6548cdcd3172
)
Parameters
Path Parameters
Parameter | Required | Type | Description |
---|---|---|---|
id | Yes | string | The unique identifier of the validation job |
Query Parameters
Parameter | Required | Type | Description |
---|---|---|---|
apiKey | Yes | string | Your API authentication key |
Code Examples
- JavaScript
- Python
- PHP
archiveValidationJob.js
async function archiveValidationJob(apiKey, listId) {
const baseUrl =
"https://api.cliova.com/v1/webhooks/email-validations/bulk-emails";
const url = `${baseUrl}/${listId}/archive?apiKey=${apiKey}`;
try {
const response = await fetch(url, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
});
if (!response.ok) {
const errorData = await response.json();
throw new Error(errorData.error?.message || "Archive operation failed");
}
const result = await response.json();
return result;
} catch (error) {
console.error("Error archiving validation job:", error);
throw error;
}
}
// ----- Usage Example -----
document.getElementById("archiveButton").addEventListener("click", async () => {
try {
await archiveValidationJob("your_api_key", "list_12345");
console.log("Validation job archived successfully");
} catch (error) {
console.error("Failed to archive validation job:", error);
}
});
archive_validation_job.py
import requests
from typing import Dict
def archive_validation_job(api_key: str, list_id: str) -> Dict:
"""
Archive a validation job and its results.
Args:
api_key (str): Your API authentication key
list_id (str): The ID of the validation job to archive
Returns:
Dict: Response data from the server
Raises:
requests.exceptions.RequestException: If the archive operation fails
"""
url = f'https://api.cliova.com/v1/webhooks/email-validations/bulk-emails/{list_id}/archive'
params = {'apiKey': api_key}
response = requests.delete(url, params=params)
response.raise_for_status()
return response.json()
# Usage Example
if __name__ == '__main__':
try:
result = archive_validation_job('your_api_key', 'list_12345')
print('Validation job archived successfully:', result)
except requests.exceptions.RequestException as e:
print('Failed to archive validation job:', e)
ArchiveValidationJob.php
<?php
function archiveValidationJob(string $apiKey, string $listId): array {
$baseUrl = 'https://api.cliova.com/v1/webhooks/email-validations/bulk-emails';
$url = sprintf('%s/%s/archive?apiKey=%s', $baseUrl, urlencode($listId), urlencode($apiKey));
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
]);
$response = curl_exec($curl);
if ($response === false) {
$error = curl_error($curl);
curl_close($curl);
throw new RuntimeException("Archive request failed: $error");
}
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($statusCode !== 200) {
throw new RuntimeException("Archive failed with status code: $statusCode");
}
return json_decode($response, true);
}
// Usage Example
try {
$result = archiveValidationJob('your_api_key', 'list_12345');
echo "Validation job archived successfully\n";
print_r($result);
} catch (Exception $e) {
echo "Archive error: " . $e->getMessage() . "\n";
}
Response
A successful archive operation returns a JSON response:
{
"success": true,
"message": "Validation job archived successfully"
}
Best Practices
Archival Strategy
Safe Archival
Follow these guidelines for safe archival:
- Verify you have the correct list ID before archiving
- Download and backup results before archival if needed
- Handle archival confirmation in your UI
- Implement proper error handling for failed archival operations
- Keep track of archived job IDs for audit purposes
Important Note
- Archival moves the job to archived status
- All associated results and data will be preserved but marked as archived
- In-progress validations will be stopped immediately
Need Help?
Support Resources