PUThttps://api.veriko.mx/v1/validations/{id}/retry-policy

Configure retry policy

Audience
public
Auth
API key
Permission
validations:update
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.

Parameters
ParameterInTypeRequiredDescription
id*pathstring (uuid)required

Validation UUID.

Idempotency-Keyheaderstringoptional

Optional client-generated key (Stripe-style) that guarantees the request is processed exactly once within a 24-hour TTL. The scope is (user_id, endpoint, key). Retries with the same key and the same body return the byte-for-byte cached response with the Idempotent-Replayed: true header, without consuming rate-limit quota, without re-firing webhooks, and without creating a new validations row. Same key with a different body → 422 idempotency_key_reused. Same key with an in-flight request → 409 idempotency_key_in_progress. 5xx responses are not cached (retries with the same key are processed for real). Format: 1–255 characters, alphanumeric + _ + -.

e.g. 11111111-2222-3333-4444-555555555555
Parameters
ParameterTypeRequiredDescription
retry_policyobjectrequired

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).

Request
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.

Response 200UpdateValidationRetryPolicyAttributes — Retry policy activated. Returns the full current state of the retry cycle.
FieldTypeDescription
retry_stateobject

Full retry cycle state, included in the individual validation response (GET /v1/validations/{id}). Exposes both state fields and the configured policy details.

enabledboolean

Whether the retry cycle is active for this validation.

e.g. true
max_retriesinteger | nullnullable

Configured maximum number of retries. The upper bound depends on the plan (retry_max_retries) or the global default max_retries_cap (typically 5–10). null if enabled=false.

e.g. 3
interval_secondsinteger | nullnullable

Interval between retries in seconds (300–86400). null if enabled=false.

e.g. 600
outcomesarray | nullnullable

Validation outcomes that trigger a retry (not_found, cep_unavailable, error). null if enabled=false.

e.g. ["not_found","cep_unavailable","error"]
attempts_completedinteger

Number of retries completed so far.

e.g. 1
next_attempt_atTimestampUTC | null

Timestamp of the next scheduled retry. null if the cycle is in a terminal state or if no retries are active.

resolved_atTimestampUTC | null

Timestamp when a retry resolved the validation to valid. null if the cycle has not ended by resolution.

exhausted_atTimestampUTC | null

Timestamp when retries were exhausted without resolution. null if the cycle has not ended by exhaustion.

cancelled_atTimestampUTC | null

Timestamp when the cycle was explicitly cancelled. null if not cancelled.

terminal_statestring | nullnullable

Terminal state of the cycle: pending — active, no final result yet; resolved — a retry obtained valid; exhausted — all attempts used; cancelled — cancelled by the user. null if the validation has no retry cycle.

e.g. pending
Response status codesPUT /v1/validations/{id}/retry-policy
StatusClassDescriptionBody
2002xxRetry policy activated. Returns the full current state of the retry cycle.No body
4004xxThe request body is empty or is not valid JSON.ErrorResponse
4014xxAuthentication is required or the provided credentials are invalid.ErrorResponse
4034xxInsufficient permissions.ErrorResponse
4044xxValidation not found or not owned by the user (not_found).ErrorResponse
4134xxThe request body exceeds the maximum accepted size (body_too_large).ErrorResponse
4224xxInvalid 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
Response headers200
HeaderTypeDescription
Idempotent-ReplayedstringOnly present when the client sent Idempotency-Key. true when the response is a replay from the idempotency cache (24h TTL per user+endpoint+key).
Errors from PUT /v1/validations/{id}/retry-policy
StatusCodeExample
400body_empty

The request body is empty.

Envelope
meta.request_id
c3d4e5f6a1b3
400invalid_json

The body is not valid JSON.

Envelope
meta.request_id
d4e5f6a1b2c4
401unauthorized

Invalid or missing authentication credentials.

Envelope
meta.request_id
c4d5e6f7a8b9
403forbidden

You do not have permission to access this resource.

Envelope
meta.request_id
d5e6f7a8b9c0
413body_too_large

The request body is too large.

Envelope
meta.request_id
1a2b3c4d5e6f

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.