{"revision":"0ed62d2c742f8e20","language":"en","entry":{"id":"complete-link","kind":"endpoint","group":"manage","title":"Complete an account proof","method":"POST","path":"/v1/links/{state}/complete","paths":[],"summary":"Complete a proof using the same key that started it.","response":"The proof state, with a grant when verified. Include the grant in a new signed card version to publish the account link.","parameters":[{"name":"state","description":"The private 64-character hexadecimal state returned by start.","in":"path","required":true}],"sample":"/v1/links/PROOF_STATE/complete","access":"signed","base":"directory","notes":["DNS and Fediverse use only nonce and timestamp in the body. The server checks the record or backlink."],"errors":["400 invalid_json","400 invalid_nonce","400 invalid_parameter","400 invalid_signature_alg","400 invalid_timestamp","401 invalid_signature","401 missing_signature","401 stale_timestamp","403 key_banned","403 key_mismatch","404 not_found","409 proof_pending","409 replayed_nonce","410 proof_expired","413 payload_too_large","422 proof_failed","422 proof_not_found","429 rate_limited","429 too_many_attempts","500 internal_error","503 busy","503 provider_not_configured"],"related":["signed-requests"],"sections":[{"kind":"code","language":"shell","code":"curl -fsS -X POST \\\n  -H \"X-Public-Key: $PUBLIC_KEY\" \\\n  -H \"X-Signature: $REQUEST_SIGNATURE\" --json @request.json \\\n  \"https://veil.rip/v1/links/PROOF_STATE/complete\""}],"bodyFields":[{"name":"code","description":"Email confirmation code for email proofs.","in":"body","required":false},{"name":"returnCode","description":"One-time callback return code for OAuth.","in":"body","required":false}],"live":false,"responses":[{"status":200,"contentType":"application/json","description":"The proof state, with a grant when verified. Include the grant in a new signed card version to publish the account link.","fields":[{"name":"state","type":"string","description":"Private proof-session state."},{"name":"identity","type":"integer","description":"Target card number."},{"name":"platform","type":"string","description":"Platform identifier."},{"name":"method","type":"string","description":"Proof method."},{"name":"status","type":"string","description":"pending, returned, verified, used or expired."},{"name":"expiresAt","type":"string","description":"Session expiry time."},{"name":"subject","type":"string | null","description":"Verified normalised account identifier."},{"name":"display","type":"string | null","description":"Verified display name."},{"name":"grant","type":"string | null","description":"Single-use signed grant after verification, until used."},{"name":"grantExpiresAt","type":"string | null","description":"Grant expiry time."},{"name":"challenge","type":"string | null","description":"Public challenge instructions."},{"name":"claimed","type":"string | null","description":"Account requested at the start, for methods that require it."},{"name":"holder","type":"integer | null","description":"Current card holding the verified account."},{"name":"waitDays","type":"integer | null","description":"Takeover cancellation period if another card holds it."},{"name":"takeoverOpen","type":"boolean | null","description":"Whether a takeover is already open."}]}],"responseObjects":[],"errorFormat":"json","errorDetails":[{"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_nonce","description":"The signed-request nonce has an invalid format.","action":"Generate a fresh 16 to 128-character nonce using letters, digits, _ or -.","scope":"common"},{"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":400,"code":"invalid_signature_alg","description":"`X-Signature-Alg` is unsupported.","action":"Use a supported signing algorithm and matching key/signature encoding.","scope":"common"},{"status":400,"code":"invalid_timestamp","description":"The signed-request timestamp is not Unix milliseconds.","action":"Use an integer Unix timestamp in milliseconds and sign the corrected request.","scope":"common"},{"status":401,"code":"invalid_signature","description":"The HTTP request signature does not verify.","action":"Sign the exact method, path and body bytes, without changing them afterwards.","scope":"common"},{"status":401,"code":"missing_signature","description":"The request requires a device signature and its headers are missing or unreadable.","action":"Send `X-Public-Key`, `X-Signature` and the signed-request metadata. An API key does not replace a device signature.","scope":"common"},{"status":401,"code":"stale_timestamp","description":"The signed timestamp is outside the accepted clock window.","action":"Compare the server Date header with your clock, then generate a fresh nonce, timestamp and signature.","scope":"common"},{"status":403,"code":"key_banned","description":"The device signing key is suspended by Veil staff.","action":"Use an authorised active key or ask staff to review the restriction.","scope":"common"},{"status":403,"code":"key_mismatch","description":"The signing key does not have authority over this card or operation.","action":"Use an active device key with the required owner or member role.","scope":"endpoint"},{"status":404,"code":"not_found","description":"The requested card, key, alias, code or resource was not found.","action":"Check the identifier. Temporary codes and previews may already have expired or been used.","scope":"endpoint"},{"status":409,"code":"proof_pending","description":"The OAuth sign-in has not returned yet.","action":"Finish the provider sign-in in the browser that started it.","scope":"endpoint"},{"status":409,"code":"replayed_nonce","description":"The signing key already used this nonce.","action":"Check whether the previous request succeeded before making a fresh signed request.","scope":"common"},{"status":410,"code":"proof_expired","description":"The temporary account-proof session has expired.","action":"Start a new linking session.","scope":"endpoint"},{"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":422,"code":"proof_failed","description":"The provider, code or published proof did not verify.","action":"Read `error.message`, correct the proof and retry while the session remains valid.","scope":"endpoint"},{"status":422,"code":"proof_not_found","description":"The requested DNS record, website file or profile backlink is not visible yet.","action":"Publish the exact challenge and allow for propagation before checking again.","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":429,"code":"too_many_attempts","description":"This proof session exceeded its wrong-code attempt limit.","action":"Start a new proof session. This code is distinct from quota `rate_limited`.","scope":"endpoint"},{"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"},{"status":503,"code":"provider_not_configured","description":"The selected proof provider is unavailable on this server.","action":"Read /v1/platforms for available methods.","scope":"endpoint"}],"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/complete-link","supportsBrowserFetch":false,"browserMode":"local-or-server"}}