{"revision":"0ed62d2c742f8e20","language":"en","entry":{"id":"verify-message","kind":"endpoint","group":"keys","title":"Verify a message","method":"POST","path":"/v1/verify","paths":[],"summary":"Check a signature block or an explicit key, message and signature. This POST only reads.","response":"valid is the overall verdict. signatureOk, identity, device, keyState, account and reason explain it. Block mode also returns the parsed block and the matching key when found.","parameters":[],"sample":"/v1/verify","access":"public","base":"directory","notes":["block can be combined only with at. Send the key, message and signature form to include platform and subject. No request-signing headers are needed.","For a file or a release, the same path takes a signature with the file’s hashes or a checksum list: see Verify a file or a release."],"errors":["400 invalid_block","400 invalid_json","400 invalid_parameter","401 invalid_api_key","403 api_key_scope","403 api_key_suspended","403 developer_suspended","413 payload_too_large","429 rate_limited","500 internal_error","503 busy"],"related":["message-verification","proofs","verify-file"],"sections":[{"kind":"code","language":"javascript","code":"const headers = new Headers();\nheaders.set(\"Content-Type\", \"application/json\");\nconst response = await fetch(\"https://veil.rip/v1/verify\", {\n  method: \"POST\",\n  headers,\n  credentials: \"omit\",\n  body: JSON.stringify({ block })\n});\nconst verdict = await response.json();"},{"kind":"verify-form"}],"verify":"This is the server’s verdict. To verify independently, check the card’s proof and verify the signature locally.","bodyFields":[{"name":"block","description":"Complete pasted signature block. Maximum 32768 characters.","in":"body","required":false},{"name":"at","description":"Optional Unix seconds. Defaults to now. Use a trusted publication timestamp.","in":"body","required":false},{"name":"key, message, signature","description":"Raw mode instead of block. Ed25519 uses hex, composite keys and signatures use base64. message is the exact UTF-8 text.","in":"body","required":false},{"name":"platform, subject","description":"Optional pair in raw mode to check account ownership at the chosen time.","in":"body","required":false}],"live":false,"responses":[{"status":200,"contentType":"application/json","description":"valid is the overall verdict. `signatureOk`, identity, device, keyState, account and reason explain it. Block mode also returns the parsed block and the matching key when found.","fields":[{"name":"valid","type":"boolean","description":"Combined verdict for signature, key state and any requested account ownership. HTTP 200 also covers `valid=false`."},{"name":"signatureOk","type":"boolean","description":"Whether the cryptographic signature verifies."},{"name":"identity","type":"IdentityRef | null","description":"Card associated with the key or named in the block, when known."},{"name":"device","type":"string | null","description":"Signing device, when identified."},{"name":"role","type":"string | null","description":"Signing role, when identified."},{"name":"keyState","type":"KeyState | null","description":"Key validity at the requested time."},{"name":"account","type":"object | null","description":"platform, subject, owned and reason when platform/subject were requested."},{"name":"reason","type":"string | null","description":"Null when valid. Otherwise bad_signature, unknown_key, not_yet_valid, revoked, key_banned, identity_banned, not_linked, pending_takeover, identity_erased or unknown_identity. These are verdict reasons, not HTTP error codes."},{"name":"key","type":"string, optional","description":"Matching public key for block mode; omitted if no key matched."},{"name":"block","type":"object, optional","description":"Parsed block with n, url, message, alg, lang, quoted and flattened."}],"example":{"language":"json","code":"{\n  \"valid\": false,\n  \"signatureOk\": true,\n  \"identity\": null,\n  \"device\": null,\n  \"role\": null,\n  \"keyState\": null,\n  \"account\": null,\n  \"reason\": \"unknown_key\"\n}"}}],"responseObjects":[{"id":"key-ref","title":"Identity reference","fields":[{"name":"n","type":"integer","description":"Permanent card number."},{"name":"url","type":"string","description":"Permanent card URL."},{"name":"name","type":"string","description":"Current display name."},{"name":"nameHidden","type":"boolean","description":"Whether staff hide the name."}],"typeName":"IdentityRef"},{"id":"key-state","title":"Key state at a time","fields":[{"name":"at","type":"integer","description":"Time checked, in Unix seconds."},{"name":"active","type":"boolean","description":"Whether the key was active at that time."},{"name":"reason","type":"string","description":"active, not_yet_valid or revoked."},{"name":"validFrom","type":"string","description":"Publication time of the version that added it."},{"name":"validUntil","type":"string | null","description":"Publication time of revocation, or null."}],"typeName":"KeyState"}],"errorFormat":"json","errorDetails":[{"status":400,"code":"invalid_block","description":"The signature block cannot be parsed or names another directory.","action":"Paste the complete block with its message and use the directory it names.","scope":"endpoint"},{"status":400,"code":"invalid_json","description":"The body is not a JSON object, contains duplicate keys or has trailing data.","action":"Send one valid JSON object with `Content-Type` application/json.","scope":"endpoint"},{"status":400,"code":"invalid_parameter","description":"A path, query or body field is missing, malformed or outside its accepted range.","action":"Correct the field named in `error.message` before sending again.","scope":"endpoint"},{"status":401,"code":"invalid_api_key","description":"The bearer credential is malformed, unknown, expired or revoked.","action":"Use an active key. To use anonymous public access, remove `Authorization` entirely. Invalid credentials never fall back automatically.","scope":"optional-api-key"},{"status":403,"code":"api_key_scope","description":"The API key lacks read or verify scope, or the endpoint does not accept bearer keys.","action":"Use the correct scope. Identity writes and key management still require a device signature.","scope":"optional-api-key"},{"status":403,"code":"api_key_suspended","description":"This API key is suspended.","action":"Ask staff to restore it; another key cannot lift an account suspension.","scope":"optional-api-key"},{"status":403,"code":"developer_suspended","description":"The owner’s API account is suspended or the owner card is unavailable.","action":"Check the owner account and any staff restriction. Creating another key does not bypass suspension.","scope":"optional-api-key"},{"status":413,"code":"payload_too_large","description":"The request body exceeds this endpoint’s byte limit.","action":"Reduce the encoded body. API-key management accepts at most 8 KiB.","scope":"endpoint"},{"status":429,"code":"rate_limited","description":"An anonymous, signed-request or API-key allowance was exceeded.","action":"Wait at least `Retry-After` seconds. Share a queue and retry budget across your workers.","scope":"common"},{"status":500,"code":"internal_error","description":"An unexpected server error occurred. Internal details are not returned.","action":"Retry reads with bounded backoff. Check write results before sending a new signed operation.","scope":"common"},{"status":503,"code":"busy","description":"The application has reached a temporary concurrency or database limit.","action":"Wait `Retry-After` seconds and retry with bounded backoff.","scope":"common"}],"responseHeaders":[{"name":"Content-Type","value":"application/json","description":"Use the declared media type before choosing a parser."},{"name":"Date","value":"HTTP date","description":"Server time. Compare it with your clock when signing requests."},{"name":"Retry-After","value":"integer seconds, on rate_limited or busy","description":"Wait at least this long before retrying. Other 429/503 codes do not necessarily include it."}],"documentationUrl":"https://veil.rip/docs/verify-message","supportsBrowserFetch":true,"browserMode":"fetch"}}