https://api.veriko.mx/v1/validations/{id}/retry-policyConfigure retry policy
How-to guide →Enables or changes the automatic retries of a validation that ended in not_found, cep_unavailable, or error. It exists because those three verdicts are not necessarily final: the CEP can take time to publish. Not every validation accepts retries. Out of scope are rows belonging to a bulk import, validations already resolved, those that exhausted their attempts, and those older than the maximum age the plan sets. The Idempotency-Key header is optional and prevents dispatching the same retry twice when a network failure repeats the request. Validations with an active cycle are listed with GET /v1/validations?retry_state=pending, and the full state — attempts spent, next attempt, final state — is visible at GET /v1/validations/{id}. The caps and the progression of the attempts are covered in the retry policy.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id* | path | string (uuid) | required | Validation UUID. |
Idempotency-Key | header | string | optional | Optional client-generated key (Stripe-style) that guarantees the request is processed exactly once within a 24-hour TTL. The scope is 11111111-2222-3333-4444-555555555555 |
| Parameter | Type | Required | Description |
|---|---|---|---|
retry_policy | object | required | Automatic retry policy. Configures when and how many times the system retries a validation that returned an eligible outcome ( |
curl -X PUT 'https://api.veriko.mx/v1/validations/{id}/retry-policy' \
-H 'Authorization: Bearer veriko_••••' \
-H 'Content-Type: application/json' \
-d '{
"retry_policy": {
"enabled": true,
"max_retries": 3,
"interval_seconds": 600,
"outcomes": [
"not_found",
"cep_unavailable"
]
}
}'Python example — coming soon.
JavaScript example — coming soon.
PHP example — coming soon.
| Field | Type | Description |
|---|---|---|
retry_state | object | Full retry cycle state, included in the individual validation response ( |
enabled | boolean | Whether the retry cycle is active for this validation. e.g.true |
max_retries | integer | nullnullable | Configured maximum number of retries. The upper bound depends on the plan ( 3 |
interval_seconds | integer | nullnullable | Interval between retries in seconds (300–86400). 600 |
outcomes | array | nullnullable | Validation outcomes that trigger a retry ( ["not_found","cep_unavailable","error"] |
attempts_completed | integer | Number of retries completed so far. e.g.1 |
next_attempt_at | TimestampUTC | null | Timestamp of the next scheduled retry. |
resolved_at | TimestampUTC | null | Timestamp when a retry resolved the validation to |
exhausted_at | TimestampUTC | null | Timestamp when retries were exhausted without resolution. |
cancelled_at | TimestampUTC | null | Timestamp when the cycle was explicitly cancelled. |
terminal_state | string | nullnullable | Terminal state of the cycle: pending |
| Status | Class | Description | Body |
|---|---|---|---|
| 200 | 2xx | Retry policy activated. Returns the full current state of the retry cycle. | No body |
| 400 | 4xx | The request body is empty or is not valid JSON. | ErrorResponse |
| 401 | 4xx | Authentication is required or the provided credentials are invalid. | ErrorResponse |
| 403 | 4xx | Insufficient permissions. | ErrorResponse |
| 404 | 4xx | Validation not found or not owned by the user (not_found). | ErrorResponse |
| 413 | 4xx | The request body exceeds the maximum accepted size (body_too_large). | ErrorResponse |
| 422 | 4xx | Invalid policy or precondition not met. retry_policy_invalid, the shape, range, or outcome is not allowed; retry_not_supported_for_bulk, the validation came from an import; retry_not_applicable, its status is outside the three that admit a retry (not_found, cep_unavailable, error) or it changed meanwhile; retry_already_resolved, the cycle already closed; retry_age_exceeded, the validation is older than max_age_seconds; retry_pending_cap_exceeded, the account hit its pending cap or its 24-hour dispatched cap; reactivation_cap_exceeded, that validation hit its reactivation cap. | ErrorResponse |
| Header | Type | Description |
|---|---|---|
Idempotent-Replayed | string | Only present when the client sent Idempotency-Key. true when the response is a replay from the idempotency cache (24h TTL per user+endpoint+key). |
| Status | Code | Example |
|---|---|---|
| 400 | body_empty | The request body is empty. Envelope
|
| 400 | invalid_json | The body is not valid JSON. Envelope
|
| 401 | unauthorized | Invalid or missing authentication credentials. Envelope
|
| 403 | forbidden | You do not have permission to access this resource. Envelope
|
| 413 | body_too_large | The request body is too large. Envelope
|
Retry policy
PUT /v1/validations/{id}/retry-policy
Automatic retry policy. Configures when and how many times the system retries a validation that returned an eligible outcome (not_found, cep_unavailable or error by default).
- Attempts
- —
- Interval
- 5 min – 1 h × 24
- Eligible outcomes
not_found,cep_unavailable,error
This operation accepts an optional retry policy.