Declare an account stolen, abandoned or moved
The owner signs an alert about one of the card’s linked accounts. From then on every lookup of that account opens with it, until a regained alert ends it.
/v1/identities/{n}/alerts- Access
- Signed request
- Client
- Local or server client
Parameters#
| Name | Location | Meaning |
|---|---|---|
nRequired | Path | Permanent positive card number. |
JSON body#
| Name | Location | Meaning |
|---|---|---|
statementRequired | JSON | {platform, since, state, subject, time, to, type: "alert", v: 1}. state is stolen (since a date, YYYY-MM-DD), abandoned, moved (to = {handle, subject}) or regained. |
saltRequired | JSON | 32 random bytes in 64 lowercase hex characters, chosen by the browser. |
entryRequired | JSON | {text, signature}: the log entry {c, key, kind, signer, time, token, v: 2} in canonical JSON without its signature, and the signature of "veil-rubrica:card-entry:v2\n" + text with X-Public-Key. |
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/alerts"Response#
The alert, its entry and its proof.
| Field | Type | Meaning |
|---|---|---|
id | integer | The entry’s position in the log: the statement’s permanent id. |
kind | string | statement or alert. |
n | integer | The card the statement is by. |
signer | object | n and token of the person card whose key signed: the card itself, or an owner or admin of an organisation. |
statement | string | The statement as signed, canonical JSON. Its fields are repeated below for display. |
salt | string | 32 bytes in hex: c of the entry is SHA-256(salt ‖ statement). |
entry | string | The log entry with its signature, as the log holds it. |
i | integer | The entry’s position in the log (the same as id). |
publishedAt | string | null | The earliest cosignature on the first checkpoint holding the entry. |
checkpoint | object | null | size and note of the cosigned checkpoint that dates the entry. Null when the log could not be read. |
inclusion | array<string> | null | The entry’s RFC 6962 inclusion proof in that checkpoint, hex, deepest first. |
platform | string | The platform of the account. |
subject | string | The account’s stable id, as GET /v1/lookup takes it. |
display | string | The handle the card shows for it. |
state | string | stolen, abandoned, moved or regained. |
since | string | null | For stolen: the date it was stolen, YYYY-MM-DD. |
to | object | null | For moved: handle, and subject when the new account is linked to the card. |
logIndex | integer | The entry’s position in the log. |
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. |
Cache-Control | no-store | Ask again each time: a new statement or alert shows at once. |
Usage notes#
- Signed by an active key of the person: a device key or the recovery key of the backup file, the key that is left when a device was stolen with the account.
- At most 10 alerts per card in 24 hours. Organisations have none.
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_parameter | A path, query or body field is missing, malformed or outside its accepted range. Correct the field named in |
| 400 | wrong_format | The request or the read belongs to the other log format than this server’s: a v1 record on a format 2 log, or a format 2 read on a format 1 log. Read |
| 403 | identity_banned | The acting identity is suspended by Veil staff. Wait for the restriction to end or ask staff to review it. |
| 403 | key_banned | The device signing key is suspended by Veil staff. Use an authorised active key or ask staff to review the restriction. |
| 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 | action_pending | An earlier alert about the same account, or a staff action of the same family, is still waiting for the log. Try again once it is published, within a few minutes. |
| 409 | alert_in_force | The account already carries this same alert. Nothing to do. To correct the date or the new account, send the alert with the new details. |
| 409 | alert_not_in_force |
Read the card’s alerts (GET /v1/identities/{n}/alerts) before ending one. |
| 409 | erase_pending | On a format 2 log, the card has an erasure waiting. Its signed closing names the current version, so the card cannot publish until the erasure is cancelled. Cancel the erasure with POST /v1/identities/{n}/erase/cancel, then publish the version. |
| 409 | signer_stale | On a format 2 log, Read the signing card again and sign the entry with its current version in |
| 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. |
| 422 | account_not_linked | The alert is about an account the card does not hold, or Name a linked account, or leave |
| 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 | invalid_statement | A card’s alert or statement does not follow its schema: a missing or extra field, a text too long or with hidden characters, a link that is not https, a date in the future. Fix the field named in |
| 422 | not_a_person | The card is an organisation where a person is required. Use the organisation endpoint or an eligible person’s card. |
| 429 | alert_quota | The card made 10 account alerts in the last 24 hours. Wait the seconds that |
| 503 | log_unavailable | The public log cannot currently be read, verified or used for publication. For reads, keep the result unverified and try later. Before retrying a write, read the card to check whether publication completed. |
Shared request errors
| 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_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. |
| 409 | replayed_nonce | The signing key already used this nonce. Check whether the previous request succeeded before making a fresh signed request. |
| 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. |
| 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 |