PUThttps://api.veriko.mx/v1/users/me/retry-policy

Set default retry policy

Visibility
public
Auth
API key
Permission
account.profile.update
How-to guide →

Sets the authenticated user's default retry policy. From the moment it is saved, it applies to every future validation that does not carry its own in the body.

The check is strict: a value beyond a cap is rejected, not silently trimmed. Any deviation responds with an HTTP 422 status (carrying retry_policy_invalid in the body).

With enabled=false the other fields are ignored and the policy is stored as disabled.

It accepts an optional Idempotency-Key, which prevents storing the same thing twice when the network forces a retry.

Parameters
ParameterInTypeRequiredDescription
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, 429, 408, 401 and 403 responses are not cached (retries with the same key are processed for real); the other 4xx responses (400, 404, 409, 422) are cached and replayed. Format: 1–255 characters, alphanumeric + _ + -.

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

Validation retry policy: activation, limit, interval, and eligible outcomes.

enabledbooleanoptional

true when the retry cycle is active. With false, the other fields are ignored.

e.g. true
max_retriesinteger (≥ 1)optional

Maximum number of automatic retries. Once reached, the cycle enters the exhausted terminal state. The allowed limit depends on the plan: Gratis (free) 1, Personal 3, Negocio (business) 5, Empresa (enterprise) 10 and Volumen (volume) 20; exceeding it returns 422 retry_policy_invalid.

e.g. 3
interval_secondsinteger (≥ 300, ≤ 86400)optional

Seconds to wait between each retry (300–86400, i.e., 5 minutes to 24 hours).

e.g. 600
outcomesarray<string> (items: 1–?, unique items)optional

Outcomes that trigger a retry. By default, they are not_found, cep_unavailable, and error; the combination ["not_found", "cep_unavailable"] excludes error.

e.g. ["not_found","cep_unavailable","error"]
Request
curl -X PUT 'https://api.veriko.mx/v1/users/me/retry-policy' \
  -H 'Authorization: Bearer veriko_••••' \
  -H 'Content-Type: application/json' \
  -d '{
    "retry_policy": {
      "enabled": false
    }
  }'

Python example — coming soon.

JavaScript example — coming soon.

PHP example — coming soon.

Response 200RetryPolicy
— Retry policy updated (echo of the normalized body).
FieldTypeDescription
enabledboolean

true when the retry cycle is active. With false, the other fields are ignored.

e.g. true
max_retriesinteger

Maximum number of automatic retries. Once reached, the cycle enters the exhausted terminal state. The allowed limit depends on the plan: Gratis (free) 1, Personal 3, Negocio (business) 5, Empresa (enterprise) 10 and Volumen (volume) 20; exceeding it returns 422 retry_policy_invalid.

e.g. 3
interval_secondsinteger

Seconds to wait between each retry (300–86400, i.e., 5 minutes to 24 hours).

e.g. 600
outcomesarray (items: 1–?, unique items)

Outcomes that trigger a retry. By default, they are not_found, cep_unavailable, and error; the combination ["not_found", "cep_unavailable"] excludes error.

e.g. ["not_found","cep_unavailable","error"]
Response status codesPUT /v1/users/me/retry-policy
StatusClassDescriptionBody
2002xx
Retry policy updated (echo of the normalized body).
RetryPolicy
4004xx
The request body is empty or is not valid JSON.
ErrorResponse
4014xx
Authentication is required or the provided credentials are invalid.
ErrorResponse
4134xx
The request body exceeds the maximum accepted size (body_too_large).
ErrorResponse
4224xx
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 the global retry configuration).
ErrorResponse
4294xx
Rate limit exceeded (rate_limit_exceeded: wait a few seconds).
RetryAfterError
Response headers200
HeaderTypeDescription
Idempotent-Replayedstring
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).
Errors from PUT /v1/users/me/retry-policy
StatusCodeExample
400body_empty

The request has no body.

Envelope
meta.request_id
b0c1d2e3f4a5b0c1d2e3f4a5
400invalid_json

The request body is not valid JSON. Check its syntax and resend it.

Envelope
meta.request_id
c1d2e3f4a5b6c1d2e3f4a5b6
401unauthorized

This request requires authentication.

Envelope
meta.request_id
c4d5e6f7a8b99b8a7f6e5d4c
413body_too_large

The body exceeds the 1 MB maximum.

Envelope
meta.request_id
1a2b3c4d5e6ff6e5d4c3b2a1
429rate_limit_exceeded

You exceeded the request limit.

Envelope
meta.request_id
f7a8b9c0d1e22e1d0c9b8a7f
Response headers
  • Retry-After: integer — Seconds to wait before retrying. Matches the endpoint's rate-limit window (typically 60s for list endpoints, 1-5s for in-flight idempotent operations).
  • X-RateLimit-Limit: integer — Configured request cap for this bucket. It is emitted on every 429 and, on the authenticated API, also on successful responses, where it is the per-key cap of the account plan.
  • X-RateLimit-Remaining: integer — Requests remaining in the current window. Always 0 at the moment of the 429; on a successful response of the authenticated API it is what is left of the per-key cap.
  • X-RateLimit-Reset: integer — Absolute Unix epoch (seconds) when the window resets. Emitted on every 429, alongside Retry-After, and on successful responses of the authenticated API.

Retry policy

PUT /v1/users/me/retry-policy

Validation retry policy: activation, limit, interval, and eligible outcomes.

Attempts
—
Interval
5 min – 1 h × 24
Eligible outcomes
not_found, cep_unavailable, error

This operation accepts an optional retry policy.