Request card erasure
An active person key or an organisation owner signs the erasure request. There is a 24-hour cancellation window.
/v1/identities/{n}/erase- Access
- Signed request
- Client
- Local or server client
Parameters#
| Name | Location | Meaning |
|---|---|---|
nRequired | Path | Permanent positive card number. |
JSON body#
| Name | Location | Meaning |
|---|---|---|
timeRequired | JSON | Unix seconds within five minutes of the server clock. This is also part of the erasure statement. |
signatureRequired | JSON | The erasure-statement signature using the same key as X-Public-Key. |
closing | JSON | Format 2, and required there: the closing entry {text, signature} signed with the same key. text is the canonical entry without its signature, with key, kind closed, latest (the hash of the card’s current label), signer, time, token and v. signature covers veil-rubrica:close-entry:v2 and a line break followed by text. |
This call also needs the common signed-request headers, nonce and timestamp. Prepare and sign request.json before using the example. Request signing
Request examples#
curl -fsS -X POST \
-H "X-Public-Key: $PUBLIC_KEY" \
-H "X-Signature: $REQUEST_SIGNATURE" --json @request.json \
"https://veil.rip/v1/identities/1/erase"veil-rubrica:erase:v1
<CARD_TOKEN>
<TIME_UNIX_SECONDS>veil-rubrica:close-entry:v2
{"key":"<PUBLIC_KEY>","kind":"closed","latest":"<CURRENT_LABEL_HASH>","signer":{"identity":"<SIGNER_TOKEN>","n":<SIGNER_VERSION>},"time":<TIME_UNIX_SECONDS>,"token":"<CARD_TOKEN>","v":2}Response#
202 with n, requestedAt, executesAt and key. Erasure removes record openings after the cancellation window while keeping the public log’s commitments.
| Field | Type | Meaning |
|---|---|---|
n | integer | Card scheduled for erasure. |
requestedAt | string | Request time. |
executesAt | string | Scheduled execution time after the cooling period. |
key | string | Public key that signed the erasure request. |
Response headers#
| Header | Value | Meaning |
|---|---|---|
Content-Type | application/json | Use the declared media type before choosing a parser. |
Date | HTTP date | Server time. Compare it with your clock when signing requests. |
Retry-After | integer seconds, on rate_limited or busy | Wait at least this long before retrying. Other 429/503 codes do not necessarily include it. |
Usage notes#
- On a log in format 2 signer of the closing is the card itself for a person, and the requesting owner’s own card for an organisation. The server writes the closing to the log when the erasure runs, and the closed card then answers 410 with closed.
Errors#
API errors return an error object. Use error.code for program logic; error.message is English text for people and can change. Response and error guide
| HTTP | Code | Meaning and next step |
|---|---|---|
| 400 | invalid_json | The body is not a JSON object, contains duplicate keys or has trailing data. Send one valid JSON object with |
| 400 | invalid_parameter | A path, query or body field is missing, malformed or outside its accepted range. Correct the field named in |
| 403 | key_mismatch | The signing key does not have authority over this card or operation. Use an active device key with the required owner or member role. |
| 404 | not_found | The requested card, key, alias, code or resource was not found. Check the identifier. Temporary codes and previews may already have expired or been used. |
| 409 | erase_already_requested | An erasure is already waiting. Read its scheduled execution time from the card. |
| 409 | signer_stale | On a format 2 log, Read the signing card again and sign the entry with its current version in |
| 409 | version_conflict | On a format 2 log, a version of this card is still on its way to the log. The closing must name the card’s current version. Wait until the version is in the log, read the card again and sign a new closing. |
| 410 | erased | The card existed and was erased or removed. The response also carries its public erasure receipt. Stop using this card as current authority. Retain only the public receipt if needed. |
| 413 | payload_too_large | The request body exceeds this endpoint’s byte limit. Reduce the encoded body. API-key management accepts at most 8 KiB. |
| 422 | bad_entry | On a format 2 log, the Correct the named field, sign the entry again with the request key and send a new signed request. |
| 422 | closing_required | On a format 2 log, an erasure arrived without its signed closing entry in Sign the closing entry with the same key and send it as |
| 422 | invalid_statement_signature | The signed erasure statement does not verify. Sign the exact statement bytes with the required prefix and key. |
| 422 | last_owner | The change would leave an organisation without an accepted owner. Add or accept another owner before removing the last one. |
| 422 | staff_org_target | This operation cannot target Veil’s staff organisation. Choose an eligible target. |
Shared request errors
| HTTP | Code | Meaning and next step |
|---|---|---|
| 400 | invalid_nonce | The signed-request nonce has an invalid format. Generate a fresh 16 to 128-character nonce using letters, digits, _ or -. |
| 400 | invalid_signature_alg |
Use a supported signing algorithm and matching key/signature encoding. |
| 400 | invalid_timestamp | The signed-request timestamp is not Unix milliseconds. Use an integer Unix timestamp in milliseconds and sign the corrected request. |
| 401 | invalid_signature | The HTTP request signature does not verify. Sign the exact method, path and body bytes, without changing them afterwards. |
| 401 | missing_signature | The request requires a device signature and its headers are missing or unreadable. Send |
| 401 | stale_timestamp | The signed timestamp is outside the accepted clock window. Compare the server Date header with your clock, then generate a fresh nonce, timestamp and signature. |
| 403 | key_banned | The device signing key is suspended by Veil staff. Use an authorised active key or ask staff to review the restriction. |
| 409 | replayed_nonce | The signing key already used this nonce. Check whether the previous request succeeded before making a fresh signed request. |
| 429 | rate_limited | An anonymous, signed-request or API-key allowance was exceeded. Wait at least |
| 500 | internal_error | An unexpected server error occurred. Internal details are not returned. Retry reads with bounded backoff. Check write results before sending a new signed operation. |
| 503 | busy | The application has reached a temporary concurrency or database limit. Wait |