Permanently delete a validation

Goal

Permanently delete what the platform stores about one of your own validations: the receipt file, the CEP, the extracted data, and everything derived that carries personal data. It is what DELETE /v1/validations/{id} does not do: that one only removes the validation from the history.

The validation is left as a tombstone with its verdict, its dates, and its amount, so quota, statistics, and finance keep adding up. The deletion cannot be undone and does not refund quota.

Prerequisites

  • An active API key (veriko_…) with the validations:delete permission, the same one you use to withdraw your validations.
  • One of your own validations in a terminal status. One still in progress responds 409 purge_validation_in_progress.

Steps

1. Prepare the deletion

POST /v1/validations/{id}/purge/prepare changes nothing: it describes what would be deleted and issues the confirmation token.

curl -X POST 'https://api.veriko.mx/v1/validations/f47ac10b-58cc-4372-a567-0e02b2c3d479/purge/prepare' \
  -H 'Authorization: Bearer veriko_••••' \
  -H 'Content-Type: application/json'
{
  "data": {
    "type": "validation_purge",
    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "attributes": {
      "confirmation_token": "eyJhZG1pbl9pZCI6Ii4uLiJ9.q1w2e3r4t5y6u7i8o9p0",
      "expires_in": 120,
      "irreversible": true,
      "will_delete": {
        "image": true,
        "cep": true,
        "stored_data": ["request_data", "ocr_result", "normalized_data", "banxico_result"],
        "retry_attempts": 0,
        "probe_attempts": 0,
        "webhook_deliveries": 1,
        "notifications": 0,
        "idempotency_responses": 1,
        "audit_traces": true
      },
      "will_keep": ["id", "validation_type", "status", "banxico_status", "amount", "error_code", "processing_time_ms", "created_at", "completed_at", "deleted_at", "purged_at"],
      "cancels_pending_retries": false,
      "refunds_quota": false,
      "same_image_validation_ids": []
    }
  }
}

Review will_delete and will_keep before going on. same_image_validation_ids lists other validations of yours with the same receipt: each keeps its own copy of what was extracted and is purged separately.

The token is single-use, bound to your account and to this validation, and expires in expires_in seconds.

2. Execute the deletion

POST /v1/validations/{id}/purge/execute deletes with the token from the previous step:

curl -X POST 'https://api.veriko.mx/v1/validations/f47ac10b-58cc-4372-a567-0e02b2c3d479/purge/execute' \
  -H 'Authorization: Bearer veriko_••••' \
  -H 'Content-Type: application/json' \
  -d '{ "confirmation_token": "eyJhZG1pbl9pZCI6Ii4uLiJ9.q1w2e3r4t5y6u7i8o9p0" }'
{
  "data": {
    "type": "validation_purge",
    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "attributes": {
      "purged_at": "2026-10-02T09:30:00Z",
      "file_removal": "complete",
      "deleted": { "image": true, "cep_pdf": true, "retry_cycle_cancelled": false, "webhook_deliveries": 1, "idempotency_responses": 1 }
    }
  }
}

file_removal is complete when the files no longer exist. With pending, a file could not be deleted at that moment: the database content is already deleted, the file is not served, and the daily receipts sweep finishes it.

3. Check the result

If the response of step 2 does not arrive, GET /v1/validations/{id} says whether the deletion completed: a purged validation carries purged_at.

curl 'https://api.veriko.mx/v1/validations/f47ac10b-58cc-4372-a567-0e02b2c3d479' \
  -H 'Authorization: Bearer veriko_••••'

The response is the tombstone: 200 with the verdict, the dates, the amount in normalized_data.monto, and purged_at. It no longer carries request_data, ocr_result, banxico_result, or links to the CEP.

Errors

codestatuswhat to do
purge_validation_in_progress409Wait for the validation to finish and prepare again.
validation_purged410It was already purged. Read the tombstone with GET /v1/validations/{id}.
not_found404The validation does not exist or belongs to another account.
confirmation_token_missing422confirmation_token is missing from the body.
confirmation_token_expired422The token expired. Prepare again.
purge_token_mismatch422The token belongs to another validation or another account. It is not spent.
confirmation_token_already_used409The token was already used. Prepare again.

What changes afterward

  • The image, the CEP, the retries, and the follow-up check of that validation respond 410 validation_purged.
  • Webhooks, retries, and sweeps ignore it. An open retry cycle is cancelled.
  • The tombstone stays in GET /v1/validations and in the exports, without a tracking key or accounts, and counts in the totals.

What the deletion does not reach (backups, the global account catalog, what already went out by webhook) is in Retention of receipts and data.

What's next