Retry Failed Job
Retry failed email validation jobs or revalidate existing lists using our retry endpoint.
API Reference
Endpoint
POST https://api.cliova.com/v1/webhooks/email-validations/bulk-emails/${listId}/retry?apiKey=${apiKey}
List ID
The id
parameter is the identifier of your original validation job (e.g., list_12345
)
Parameters
Path Parameters
Parameter | Required | Type | Description |
---|---|---|---|
id | Yes | string | The unique identifier of your failed or completed validation job |
Query Parameters
Parameter | Required | Type | Description |
---|---|---|---|
apiKey | Yes | string | Your API authentication key |
Code Examples
- JavaScript
- Python
- PHP
validationRetry.js
// Function to retry a failed validation job or revalidate an existing list
async function retryValidation(apiKey, listId) {
const baseUrl =
"https://api.cliova.com/v1/webhooks/email-validations/bulk-emails";
const url = `${baseUrl}/${listId}/retry?apiKey=${apiKey}`;
const response = await fetch(url, {
method: "POST",
headers: { Accept: "application/json" },
});
if (!response.ok) {
const errorData = await response.json();
throw new Error(errorData.error?.message || "Retry request failed");
}
return response.json();
}
validation_retry.py
import requests
from typing import Dict, Any, Optional, Callable
def retry_validation(api_key: str, list_id: str) -> Dict[str, Any]:
"""
Retry a failed validation job or revalidate an existing list.
Args:
api_key: Your API key.
list_id: The ID of the validation job to retry.
Returns:
A dictionary containing the new validation job details.
"""
base_url = 'https://api.cliova.com/v1/webhooks/email-validations/bulk-emails'
url = f'{base_url}/{list_id}/retry'
response = requests.post(url, params={'apiKey': api_key})
response.raise_for_status()
return response.json()
ValidationRetry.php
<?php
function retryValidation(string $apiKey, string $listId): array {
$baseUrl = 'https://api.cliova.com/v1/webhooks/email-validations/bulk-emails';
$url = sprintf('%s/%s/retry?apiKey=%s', $baseUrl, urlencode($listId), urlencode($apiKey));
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Accept: application/json']
]);
$response = curl_exec($curl);
if ($response === false) {
throw new RuntimeException(curl_error($curl));
}
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($statusCode !== 200) {
throw new RuntimeException("API request failed with status code: {$statusCode}");
}
return json_decode($response, true);
}
// Usage Example
try {
$result = retryValidation('your_api_key', 'list_12345');
echo "Retry initiated: " . json_encode($result, JSON_PRETTY_PRINT);
} catch (Exception $e) {
echo "Retry failed: " . $e->getMessage();
}
Response Examples
- Success Response
- Error Response
{
"success": true,
"message": {
"id": "list_67890",
"status": "In Progress"
}
}
{
"success": false,
"message": "Cannot retry validation job that is currently processing"
}
Best Practices
Retry Strategy
Smart Retries
Follow these guidelines for optimal retry handling:
- Wait at least 5 minutes between retries (big lists may take time)
- Implement exponential backoff for status checking
- Monitor and log retry attempts
Need Help?
Support Resources