Publish a signed statement
A person or an organisation publishes a statement with a title, a text and an optional link, or retracts an earlier one. The log’s witnesses date it.
/v1/identities/{n}/statements- 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 | {link, retracts, text, time, title, type: "statement", v: 1}: a title of 1 to 200 characters, a text of 1 to 4 000, an https link or null, and the id of the statement it retracts or null. |
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/statements"Response#
The statement, 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. |
title | string | The title, 1 to 200 characters. |
text | string | The text, 1 to 4 000 characters, line breaks kept. |
link | string | null | An optional https link. |
retracts | integer | null | The id of the statement this one retracts. |
retractedBy | object | null | id, publishedAt and title of the statement that retracts this one. |
url | string | The statement’s page. |
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#
- A person signs with one of its device keys; an organisation through an owner or an admin, with a key of their own card, as its versions are signed.
- At most 10 statements per card in 24 hours, retractions included. GET on this path is the page of the staff’s statements (from, size).
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. |
| 403 | role_not_allowed | The signing role is not allowed to make this change. Use a key with the required 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 | already_retracted | The statement named in Publish a new statement instead. |
| 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 | 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 |
| 429 | statement_quota | The card published 10 statements in the last 24 hours, retractions included. 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 |