POSThttps://api.veriko.mx/v1/validations/{id}/purge/execute

Execute the permanent deletion of a validation

Visibility
public
Auth
API key
Permission
validations.records.delete
How-to guide →

Permanently deletes the content of one of your own validations, with the token issued by POST /v1/validations/{id}/purge/prepare. It is the second step of a two-step flow: without that token nothing is deleted.

What is deleted:

  • The receipt file, image or PDF.
  • The CEP, as XML and as PDF.
  • request_data, ocr_result, banxico_result, and the normalization warnings. Of normalized_data, only the amount is kept.
  • The derived records with personal data: retry attempts, account probes, stored Idempotency-Key responses, and inbox notifications.
  • Its stage-trace events and its exchange summaries (internal traceability): deleted entirely, in the same transaction as the rest. After the purge, a check counts the residual trace, exchange-summary, and audit rows that still mention the validation (residual_check); after a correct purge, all three are 0.
  • The sent body and the receiver response in the webhook deliveries of that validation, and the content of its notifications. The record of each delivery is kept.
  • The bodies of the audit rows that name the validation, and the free-form context of its security events.

The validation is left as a tombstone: it keeps id, validation_type, status, banxico_status, the dates, processing_time_ms, error_code, the amount, and purged_at. With that, quota, statistics, finance, and history keep adding up. The deletion does not refund quota.

After the deletion, GET /v1/validations/{id} responds with the tombstone with an HTTP status 200 and purged_at. The image, the CEP, the retries, and the follow-up check respond with an HTTP status 410 (with validation_purged in the body), and webhooks, retries, and sweeps ignore it. An open retry cycle is cancelled.

The token is verified before deleting:

  • It is missing, malformed, its signature is not valid, or it expired: it responds with an HTTP status 422 with its code (confirmation_token_missing, confirmation_token_malformed, confirmation_token_signature_invalid, or confirmation_token_expired).
  • It belongs to another validation, another account, or another operation: it responds with an HTTP status 422 (with purge_token_mismatch or confirmation_token_operation_mismatch in the body).
  • It was already used: it responds with an HTTP status 409 (with confirmation_token_already_used in the body).

If the response does not arrive, GET /v1/validations/{id} says whether the deletion completed: a purged validation carries purged_at. Repeating this step on a purged validation responds with an HTTP status 410.

What is deleted, the tombstone, and the limitations are in the retention of receipts and data.

A validation that is still in progress cannot be purged yet: it responds with an HTTP 409 status (purge_validation_in_progress, with the status in meta.status).

Parameters
ParameterInTypeRequiredDescription
id*pathstring (uuid)required

Validation UUID.

Parameters
ParameterTypeRequiredDescription
confirmation_tokenstringrequired

Token returned by POST /v1/validations/{id}/purge/prepare for this same validation and this same account. It is single-use and expires within the period expires_in indicated.

e.g. eyJhZG1pbl9pZCI6Ii4uLiJ9.q1w2e3r4t5y6u7i8o9p0
Request
curl -X POST 'https://api.veriko.mx/v1/validations/{id}/purge/execute' \
  -H 'Authorization: Bearer veriko_••••' \
  -H 'Content-Type: application/json' \
  -d '{
    "confirmation_token": "eyJhZG1pbl9pZCI6Ii4uLiJ9.q1w2e3r4t5y6u7i8o9p0"
  }'

Python example — coming soon.

JavaScript example — coming soon.

PHP example — coming soon.

Response 200ValidationPurgeExecuteResponse
— Validation purged. Returns when it was purged, the state of the file deletion, and what was deleted.
FieldTypeDescription
data*object

JSON:API resource of the deletion. Its id is the validation's.

type*string

Resource type, fixed for this operation. Part of its identity in the JSON:API envelope. Always validation_purge.

e.g. validation_purge
id*string (uuid)

Identifier of the purged validation.

e.g. 3fa85f64-5717-4562-b3fc-2c963f66afa6
attributes*object

Result of the deletion.

purged_at*string (date-time)

Date and time, in ISO 8601 UTC, when the validation was purged.

e.g. 2026-10-02T09:30:00Z
file_removal*string

State of the file deletion — complete: The files no longer exist; pending: A file could not be deleted at this moment and the daily sweep finishes it. The database content is already deleted in both cases and the file is not served.

e.g. complete
deleted*object

What was deleted. The counters count rows touched; the booleans say whether there was something to delete.

imageboolean

true when there was a receipt file.

cep_pdfboolean

true when there was a CEP PDF.

retry_cycle_cancelledboolean

true when the deletion closed a retry cycle that was still open.

retry_attemptsinteger

Retry attempts deleted.

probe_attemptsinteger

Candidate-account probes deleted.

webhook_deliveriesinteger

Webhook deliveries whose sent body and receiver response were removed.

notification_deliveriesinteger

Notification deliveries whose content was emptied.

notificationsinteger

Inbox notifications that were deleted.

idempotency_responsesinteger

Stored Idempotency-Key responses that were deleted.

import_rowsinteger

Bulk-import rows whose content was emptied.

audit_log_rowsinteger

Audit rows whose bodies were removed. Missing when that sweep could not complete.

security_events_rowsinteger

Security events whose context was redacted. Missing when that sweep could not complete.

trace_eventsinteger

Trace events of the validation that were deleted.

exchange_summariesinteger

Exchange summaries of the validation that were deleted.

residual_checkobject

Zero-residual-rows check after the purge (internal traceability plan §8.4.6): how many trace rows, exchange-summary rows, and audit log bodies still mention the validation. After a correct purge, all three are 0. Missing when the check could not complete.

trace_eventsinteger

Trace events that still mention the validation.

exchange_summariesinteger

Exchange summaries that still mention the validation.

audit_log_bodiesinteger

Audit log bodies that still mention the validation.

Response status codesPOST /v1/validations/{id}/purge/execute
StatusClassDescriptionBody
2002xx
Validation purged. Returns when it was purged, the state of the file deletion, and what was deleted.
ValidationPurgeExecuteResponse
4004xx
The request body arrived empty when the operation requires data (body_empty).
ErrorResponse
4014xx
Authentication is required or the provided credentials are invalid.
ErrorResponse
4034xx
Insufficient permissions. Also email_verification_required: the account's email cannot receive mail and, until it is fixed or verified, only reading the profile, fixing the email, and logging out are allowed.
ErrorResponse
4044xx
Validation not found, or not owned by the account (not_found).
ErrorResponse
4094xx
The token was already used (confirmation_token_already_used), or the validation is still in progress and cannot be purged yet (purge_validation_in_progress, with the status in meta.status).
ErrorResponse
4104xx
The validation was purged and this resource no longer exists (validation_purged).
ErrorResponse
4134xx
The request body exceeds the maximum accepted size (body_too_large).
ErrorResponse
4224xx
The token is not valid. Possible codes: confirmation_token_missing, confirmation_token_malformed, confirmation_token_signature_invalid, confirmation_token_expired, confirmation_token_operation_mismatch, and purge_token_mismatch (the token belongs to another validation or another account). Invalid UUID in path (invalid_uuid).
ErrorResponse
4294xx
Rate limit exceeded (rate_limit_exceeded: wait a few seconds).
RetryAfterError
Errors from POST /v1/validations/{id}/purge/execute
StatusCodeExample
400body_empty

The request has no body.

Envelope
meta.request_id
2b3c4d5e6f7aa7f6e5d4c3b2
400invalid_json

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

Envelope
meta.request_id
a6f9601c9658
401unauthorized

This request requires authentication.

Envelope
meta.request_id
c4d5e6f7a8b99b8a7f6e5d4c
403permission_denied

You do not have permission to access this resource.

Envelope
meta.request_id
d5e6f7a8b9c00c9b8a7f6e5d
404not_found

We could not find what you requested.

Envelope
meta.request_id
f05fc430294a
409purge_validation_in_progress

The validation is still in progress (status processing).

Envelope
meta.request_id
3073fe582c07ac36bae4b069
410validation_purged

This validation was permanently deleted.

Envelope
meta.request_id
1a2b3c4d5e6ff6e5d4c3b2a1
413body_too_large

The body exceeds the 1 MB maximum.

Envelope
meta.request_id
1a2b3c4d5e6ff6e5d4c3b2a1
422validation_error

Some data needs fixing.

Envelope
meta.request_id
a6757ecfe1ad
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.