veil

Request device pairing

Create a temporary pairing code for a new device’s public key.

POST/v1/device-requests
Access
Creates temporary data
Client
Local or server client

JSON body#

NameLocationMeaning
keyRequiredJSONThe new device’s public key.
algJSONed25519 or mldsa65-ed25519.
deviceRequiredJSONA device name from 1 to 40 characters.

Request examples#

cURL
curl -fsS -X POST 'https://veil.rip/v1/device-requests' --json @request.json

Response#

HTTP 201application/json

201 with code, display, key, alg, device, createdAt and expiresAt. The code lasts ten minutes.

FieldTypeMeaning
codestringPrivate eight-character pairing code.
displaystringCode grouped for typing.
keystringPending public key.
algstringSignature algorithm identifier.
ed25519stringEd25519 key or composite half, in hex.
devicestringRequested device label.
createdAtstringCreation time.
expiresAtstringExpiry time, ten minutes after creation.

Response headers#

HeaderValueMeaning
Content-Typeapplication/jsonUse the declared media type before choosing a parser.
DateHTTP dateServer time. Compare it with your clock when signing requests.
Cache-Controlno-storeDo not persist private or temporary responses in a shared cache.
Retry-Afterinteger seconds, on rate_limited or busyWait at least this long before retrying. Other 429/503 codes do not necessarily include it.

Usage notes#

  • Creating codes is limited to 10 per hour per IP. Reading pairing codes is limited to 5 per minute per IP and requires an active person key.

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

HTTPCodeMeaning and next step
400invalid_json

The body is not a JSON object, contains duplicate keys or has trailing data.

Send one valid JSON object with Content-Type application/json.

400invalid_name

A name contains invisible, direction-control or unsupported format characters.

Use a visible name in the accepted Unicode form and sign the corrected request.

400invalid_parameter

A path, query or body field is missing, malformed or outside its accepted range.

Correct the field named in error.message before sending again.

409key_already_used

A device key already belongs to an identity and cannot be reused by another.

Use the existing card or generate a fresh device key.

413payload_too_large

The request body exceeds this endpoint’s byte limit.

Reduce the encoded body. API-key management accepts at most 8 KiB.

Shared request errors
HTTPCodeMeaning and next step
429rate_limited

An anonymous, signed-request or API-key allowance was exceeded.

Wait at least Retry-After seconds. Share a queue and retry budget across your workers.

500internal_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.

503busy

The application has reached a temporary concurrency or database limit.

Wait Retry-After seconds and retry with bounded backoff.