https://api.veriko.mx/v1/users/me/retry-policy Set default retry policy
How-to guide →Configures the default retry policy for the authenticated user. Once saved, it is applied to all future validations that do not specify their own retry_policy in the body. Validation is strict (no silent clamping — exceed the caps and the request is rejected). Accepts optional Idempotency-Key to prevent duplicate writes on network retries.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
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 `(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 + `_` + `-`. |
| 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 (`not_found`, `cep_unavailable` or `error` by default). |
curl -X PUT 'https://api.veriko.mx/v1/users/me/retry-policy' \
-H 'Authorization: Bearer mxcep_••••' \
-H 'Content-Type: application/json' \
-d '{
"retry_policy": {
"enabled": false
}
}'
Python example — coming soon.
JavaScript example — coming soon.
PHP example — coming soon.
| Field | Type | Description |
|---|---|---|
enabled | boolean | Enables or disables the retry cycle for this validation. If `false`, the other fields are ignored. |
max_retries | integer | Maximum number of automatic retries. Once reached, the cycle enters the `exhausted` terminal state. The upper bound depends on the plan (`retry_max_retries`) or the global default `max_retries_cap` (typically 5–10). |
interval_seconds | integer | Seconds to wait between each retry (300–86400, i.e., 5 minutes to 24 hours). |
outcomes | array (items: 1–?, unique items) | Validation outcomes that trigger a retry. By default the cycle activates on `not_found`, `cep_unavailable` and `error`; clients that do not want to retry Banxico HTTP 5xx errors can send `["not_found", "cep_unavailable"]`. |
| Status | Class | Description | Body |
|---|---|---|---|
| 200 | 2xx | Retry policy updated (echo of the normalized body). | No body |
| 401 | 4xx | Authentication is required or the provided credentials are invalid. | ErrorResponse |
| 422 | 4xx | Retry policy is invalid (`retry_policy_invalid`). Causes: `enabled` missing or not boolean; `max_retries` outside `[1, max_retries_cap]`; `interval_seconds` outside `[min_interval_seconds, max_interval_seconds]`; `outcomes` empty when `enabled=true`; outcome outside the allowlist (`eligible_outcomes` from config/validation_retries.php). | 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 | Detail |
|---|---|---|
| 401 | unauthorized | Invalid or missing authentication credentials. Envelope
|
Retry policy
PUT /v1/users/me/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.