A site posts its public key with its enrollment code
const url = 'https://example.com/v1/auth/sites/enroll';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example","publicKey":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/auth/sites/enroll \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "publicKey": {} }'Public: the code is the credential. The site keeps its private key; Kindgi stores the public one, and answers the site’s id (its statements’ iss) and the audience (their aud). A wrong, used or expired code, or one for a paused or unregistered site, gets one answer: 401 site-enrollment-refused. Failures are limited per client (429 rate-limit-exceeded, with Retry-After). The body is at most 4096 bytes.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The site’s Ed25519 public key, a JWK: kty: OKP, crv: Ed25519, x and kid.
object
Examplegenerated
{ "code": "example", "publicKey": {}}Responses
Section titled “Responses”The site’s id and its statements’ audience.
object
What the site’s statements carry as iss.
What the site’s statements carry as aud.
Examplegenerated
{ "siteId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "audience": "example"}A malformed body, or a public key that isn’t an Ed25519 JWK with a kid, or has a private part (site-key-invalid); it’s checked before the code.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The code was refused (site-enrollment-refused).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The body is over 4096 bytes (site-request-too-large).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Too many failures from this client.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}