Skip to content
API

REST API reference

Base URL https://rootherald.io. Every call carries Authorization: Bearer rh_sk_… from your backend; there is no client-side key. The live OpenAPI document is authoritative.

terminalbash
curl -X POST https://rootherald.io/api/v1/attest/challenge \
  -H "Authorization: Bearer rh_sk_…" -H "Content-Type: application/json" \
  -d '{ "ask": ["identity", "posture"] }'

curl https://rootherald.io/api/v1/openapi.json          # the machine-authoritative contract

Endpoints

POST/api/v1/attest/challenge

Attest · mint a challenge that carries the ask

The default server→server flow. Your server calls this with its rh_sk_ secret key to mint a single-use challenge, relays the `challenge` string to its client verbatim, and submits the client's evidence to /attest/verify. The challenge names the ask (what the device must prove) and, when you pass expectedKey or expectedDevices, the device that must answer; the policy is the one bound to the calling key. No pre-enrolled RP, no client-side key. Nothing here mints a key.

NameInTypeRequiredDescription
AuthorizationheaderstringyesBearer rh_sk_… secret key.
askbody("identity" | "posture")[]noWhat the device is asked to prove. identity = the installation's attestation key answers the nonce (PCR 7 only, no event log). posture = PCRs 0–4 and 7, the event log and the Secure Boot claims. Omitted ⇒ ["identity", "posture"]. Anything else is 400 invalid_ask.
expectedKeybodystringnoA keyId /keys/certify returned. Only the installation that certified it can answer; any other device fails with reason.code expected_device_mismatch.
expectedDevicesbodystring[]noDevice ids (the alias) you enrolled. Resolved when the challenge is minted; an unknown value is 422 expected_unknown. Enforced after the proof verifies.

200 with a single-use challenge (5-minute TTL). `challenge` is what the client consumes — relay it verbatim; a client refuses anything that is not an `rhc1.` string. `nonce` is your handle for the challenge: 32 random bytes, base64url without padding, the same bytes as the second segment of `challenge`. Pass it to /attest/verify. 401 on a missing/invalid secret key · 400 policy_bound_to_key when the body names a policy · 422 posture_not_bound for a posture ask on a key without a posture policy · 400 invalid_ask on an unknown ask value · 422 expected_unknown for an expectedKey or expectedDevices value that is not yours.

{
  "nonce": "Zm9vYmFy…",
  "challenge": "rhc1.<nonce>.<ask>",
  "expiresAt": "2026-06-18T18:09:11Z"
}
POST/api/v1/attest/verify

Attest · appraise evidence server→server

Submit the opaque evidence blob your client produced for the challenge and get the AttestationVerdict back directly in the response. The server finds the challenge by (tenant, nonce) and the installation from the proof inside the evidence: a TPM quote names its signing key inside the signed structure, a Mac presents the enclave key it enrolled, an iPhone presents its App Attest key id. An un-enrolled / failing device is NOT an error — it returns 200 with a fail (or warn) verdict. Attestation releases no key.

NameInTypeRequiredDescription
AuthorizationheaderstringyesBearer rh_sk_… secret key.
noncebodystringyesThe nonce from /attest/challenge, verbatim. Single-use.
evidencebodyobjectyesOpaque evidence blob from the client; forwarded verbatim. It carries no device identifier. For a posture ask it carries the event log under `logs.srtm`.
requestedDisclosureClassbody"verdict" | "pseudonymous" | "derived" | "full"noCaps what the verdict reveals. The policy's default applies when omitted.

200 with the AttestationVerdict. `device.ueid` is your per-tenant device id. A proof that names no live installation of yours is a failing verdict with `enrollmentRequired: true` and no `ueid`. When the challenge named a key or devices, `verdict.expected` echoes what was enforced; a verdict from any other device is a fail with `verdict.reason.code` `expected_device_mismatch` and no device facts. A warn or fail carries `verdict.reason`, `{ code, text }`, naming the rule that decided it; a pass carries none. 401 invalid key · 400 policy_bound_to_key when the body names a policy · 422 unknown_policy when the key's bound policy no longer exists · 409 challenge_expired_or_used for an unknown, spent, expired or foreign nonce · 400 invalid_evidence for a malformed nonce or evidence with no proof · 429 budget_exhausted.

{
  "verdict": {
    "acr": "urn:rootherald:device:high",
    "expected": { "devices": ["2f9c4a1c-8b…"] },
    "device": {
      "ueid": "2f9c4a1c-8b…",
      "verdict": "pass",
      "earStatus": "affirming",
      "attestationType": "tpm20",
      "secureBootVerified": true,
      "trustworthinessVector": { "hardware": 2, "configuration": 2 }
    }
  },
  "assuranceClaimsMet": ["rootherald:assurance:real-device", "rootherald:assurance:secure-boot"],
  "enrollmentRequired": false
}
POST/api/v1/attest/enroll

Enroll an installation (leg 1, under the key's identity policy)

The body is the client's EnrollBegin output, relayed verbatim; `platform` discriminates the ceremony and is recorded on the installation, so activation demands the proof for the recorded platform rather than for whatever the request claims. TPM: the server validates the EK chain, classifies the chip, recomputes the attestation key's qualified name from the two public areas, admits the device under the identity policy bound to your key, and returns a make-credential challenge sealed to this EK. Admission runs BEFORE the sealed credential is issued, so a TPM class the policy refuses (virtual, emulated) is turned away before the client spends its one elevation prompt. macOS: a nonce for the enclave key to sign. iOS: one leg; the attestation object is validated here and the response is empty. Each activation creates a new installation with its own attestation key; a device enrolled by two of your apps has two.

NameInTypeRequiredDescription
AuthorizationheaderstringyesBearer rh_sk_… secret key.
platformbody"windows" | "linux" | "macos" | "ios"yesThe ceremony. Recorded on the installation.
ekPublicKeybodystringnoTPM and macOS. Base64 TPM2B_PUBLIC of the EK; on macOS the enclave key, X9.63 uncompressed.
attestationKeybody{ publicArea, parentPublicArea, qualifiedName }noTPM. TPM2B_PUBLIC of this installation's attestation key and of its storage parent, and the TPM2B_NAME TPM2_ReadPublic returned, all base64. The server recomputes the qualified name and refuses a mismatch with 400 invalid_enroll_shape. A flat body with a top-level akPublicArea is the 7.0 shape and is refused with 400 wire_version_unsupported.
akPublicAreabodystringnomacOS only. The same key as ekPublicKey; there is no parent.
ekCertPembodystringnoTPM. PEM-encoded EK certificate. Omitted for firmware TPMs with no NV-stored EK cert; the server then fetches the vendor certificate keyed by the EK public key.
ekCertificateChainbodystring[]noTPM. PEM-encoded intermediates the device read from its own TPM NV; path-building material that must still terminate at a seeded root.
tpmSelfReportbody{ manufacturer, vendorString }noTPM. The chip's own TPM2_GetCapability answer, unsigned. Can only lower a device's class.
iosKeyIdbodystringnoiOS. The App Attest key id, base64.
iosAttestationObjectbodystringnoiOS. The App Attest attestation object, base64 CBOR.
noncebodystringnoiOS. The second segment of the challenge string the attestation was made over; the Swift SDK derives it. The challenge is spent whether or not the attestation validates.

201. Relay the body to the client's EnrollComplete verbatim; it carries no device identifier. `enrollmentId` names the open enrollment for /attest/activate. 422 admission_refused when the key's identity policy rejects this TPM class; 400 wire_version_unsupported for a 7.0-shaped TPM body; 400 invalid_enroll_shape when the qualified name does not match the public areas; 400 missing_key_material, malformed_encoding, malformed_ak_public_area, ak_template_rejected, ek_chain_rejected, unrecognised_ek_key, secure_enclave_key_rejected, app_attest_rejected, unknown_platform or platform_mismatch for the enroll body itself.

// TPM
{ "enrollmentId": "3b6d…", "credentialBlob": "…", "encryptedSecret": "…" }
// macOS
{ "enrollmentId": "3b6d…", "challengeNonce": "…" }
// iOS
{}
POST/api/v1/attest/activate

Activate an installation (leg 2)

The client's EnrollComplete output, relayed verbatim. The server finds the open enrollment by (tenant, enrollmentId). TPM: the decrypted make-credential secret proves the EK could open it and that the attestation key named at enrollment lives in the same chip; the installation's row is written and the device counts active. macOS: an ECDSA-P256 signature over challengeNonce by the enrolled enclave key, DER or P1363. iOS has no activate leg. Activation releases no key.

NameInTypeRequiredDescription
AuthorizationheaderstringyesBearer rh_sk_… secret key.
enrollmentIdbodystringyesThe enrollmentId from /attest/enroll.
decryptedSecretbodystringnoTPM. The decrypted make-credential secret, base64, 32 bytes.
signaturebodystringnomacOS. Signature over challengeNonce, base64.

200 on a matching proof. `deviceId` is your per-tenant device id, the same value as `device.ueid` on every verdict; it is for your backend and is never relayed to the device. A new attestation key, a re-enrollment or a TPM clear never changes it. 401 activation_refused for an unknown, spent or foreign enrollmentId, a wrong proof or an attestation key another account holds (one answer for all); 400 for a missing or malformed field.

{
  "deviceId": "2f9c4a1c-8b…",
  "status": "enrolled",
  "enrolledAt": "2026-06-18T18:09:11Z"
}
POST/api/v1/keys/challenge

Mint a key · mint a key challenge for a purpose

Your server says what kind of key it wants and the server mints a single-use nonce for it. Relay the `keyChallenge` string to the client verbatim; its MintKey answers with a certification for /keys/certify. No quote and no posture are involved: a key is a property of the chip, not of a boot. To mint only on a device that booted clean, run an attest challenge first and mint on a pass.

NameInTypeRequiredDescription
AuthorizationheaderstringyesBearer rh_sk_… secret key.
purposebody"sign" | "decrypt"yesWhat the key is for. sign: ES256 or RS256; decrypt: ECDH-ES or RSA-OAEP-256, the family chosen by the device. Any other value is 400 invalid_purpose.
expectedDevicesbodystring[]noDevice ids (the alias) you enrolled. An unknown value is 422 expected_unknown; a certification from any other device is refused.

200 with a single-use key challenge (5-minute TTL). `keyChallenge` starts with `rhk1c.` and carries the purpose; a client refuses anything else. `nonce` is your handle for it: pass it to /keys/certify. 400 invalid_purpose · 422 key_disclosure_too_low when the key's disclosure ceiling is below pseudonymous, since the certify could never return a keyId · 422 expected_unknown · 400 invalid_ask for more than 32 expectedDevices · 422 unknown_policy · 401 on a missing/invalid secret key.

{
  "nonce": "Zm9vYmFy…",
  "keyChallenge": "rhk1c.<nonce>.<purpose>",
  "expiresAt": "2026-06-18T18:09:11Z"
}
POST/api/v1/keys/certify

Mint a key · certify the key the device minted

The client's MintKey output, relayed verbatim. The server consumes the nonce, resolves the installation from the certification's signer, verifies the attestation key's signature over the nonce and that the certified name matches the public area, checks the template against the purpose, evaluates your key's identity policy against the device, and records the key against that installation. One live key per installation per purpose: minting again rotates it under the same keyId. The device counts active for the month as a verify would. macOS proves possession: a sign key is the enclave key it enrolled, and a decrypt key is a second enclave key that the enrolled one signs for. iOS presents the App Attest key and mints sign keys only.

NameInTypeRequiredDescription
AuthorizationheaderstringyesBearer rh_sk_… secret key.
noncebodystringyesThe nonce from /keys/challenge, verbatim. Single-use.
certificationbodyobjectyesOpaque certification from the client; forwarded verbatim. TPM: the new key's public area, the TPMS_ATTEST and the attestation key's signature. macOS: platform, publicKey and a signature over the nonce, plus devicePublicKey and deviceSignature for a decrypt key, the enrolled key signing for the new one. iOS: the key id and an assertion.

200 with the key's public half. `deviceId` is the alias of the device that holds the key: bind the key to that account. `keyId` identifies this installation's credential, not the device; it is stable across rotation and new after a re-enrollment. `jwk` is EC P-256 or RSA-2048, and `alg` matches it and the purpose: ES256 or RS256 on a sign key, ECDH-ES or RSA-OAEP-256 on a decrypt key. A decrypt key also carries `format`, the envelope it opens: jwe on a TPM key, apple-ecies on a Mac. `hardwareBound` is true when the EK certificate chained to a TPM maker's root RootHerald ships; false on a cloud provider's vTPM, when a policy admitted the device without a trusted root, and on macOS, where only possession is proved. A 200 always carries deviceId, keyId and jwk. 409 challenge_expired_or_used for a spent or expired nonce · 409 key_rotation_conflict when two mints for one purpose raced: mint again · 400 invalid_certification for a malformed body, or a macOS body whose device fields do not fit the purpose · 422 purpose_unsupported for an iOS certification of a decrypt key challenge · 422 certification_rejected for a certification that did not verify, that no live installation of yours signed, that fails the key's identity policy, or that came from a device the challenge did not name, one answer for all · 422 key_disclosure_too_low · 429 budget_exhausted · 500 key_write_failed when the key verified but could not be recorded.

{
  "deviceId": "2f9c4a1c-8b…",
  "keyId": "7d1eQx2ZkPq0sT9vB4nLmA",
  "purpose": "sign",
  "alg": "ES256",
  "jwk": { "kty": "EC", "crv": "P-256", "x": "…", "y": "…" },
  "hardwareBound": true,
  "certifiedAt": "2026-06-18T18:09:14Z"
}

Error codes

{ "error": "challenge_expired_or_used", "message": "…" }

Branch on error, never on message. A device that fails policy or a rejected class is a 200 with device.verdict of fail or warn; the one policy outcome carried as a 4xx is admission_refused on the enroll relay, because there is no verdict yet. A verdict from a device other than the one the challenge named is a 200 with a failing verdict whose reason.code is expected_device_mismatch, not an error.

errorHTTPMeaningWhat to do
invalid_secret_key401No valid rh_sk_ key in the Authorization header.Send `Authorization: Bearer rh_sk_…` from your backend only.
invalid_api_key401An enroll or activate relay arrived without a valid secret key.Same key, same header; these are server-to-server relays.
activation_refused401The activate relay carried a credential activation response the server did not issue, one that did not open, or an attestation key another account already holds. One answer for all.Start enrollment again from /attest/enroll; do not resend the same activation response.
invalid_evidence400Malformed verify body: a missing or malformed nonce, or evidence that carries no proof to resolve an installation from.Pass the nonce from /attest/challenge and the whole blob the client produced.
policy_bound_to_key400The call named a policy. Policies bind to API keys; a call cannot name, tighten or loosen one.Remove the `policy` field, and attach the policy to the key in the dashboard.
invalid_ask400An ask that isn't identity or posture, or an expectedDevices list of more than 32 ids. A key is minted by its own ceremony, never inside an attestation.Ask for identity, posture or both. To mint a key, call /keys/challenge with a purpose.
wire_version_unsupported400A TPM enroll relay carried a top-level akPublicArea instead of attestationKey { publicArea, parentPublicArea, qualifiedName }: a client on an earlier SDK.Update the client SDK to ABI 8.0 and the server SDK to its wire 8.0 release; nothing on the server side changes it.
invalid_enroll_shape400An enroll body no platform sends: a nested attestationKey on a macOS enrollment, both shapes at once, or a qualifiedName the two public areas do not produce.Relay the body EnrollBegin produced, unchanged.
missing_key_material400The enroll relay lacks a field the platform's ceremony needs: ekPublicKey, a part of attestationKey, or the iOS key id and attestation object.Relay the body EnrollBegin produced, unchanged. A server SDK that rebuilds the body from fields must keep all three parts of attestationKey.
malformed_encoding400A base64 field in the enroll or activate relay did not decode.Relay the body unchanged; the client re-runs the leg.
malformed_ak_public_area400The attestation key or its parent did not parse as a TPMT_PUBLIC.Start enrollment again from EnrollBegin.
ak_template_rejected400The attestation key is not one of the approved templates (ECC P-256 or RSA-2048, restricted signing, TPM-resident).Start enrollment again from EnrollBegin on a supported SDK.
ek_chain_rejected400The endorsement certificate chain did not validate, or its maker revoked it, and the key's policy does not admit it. `chainFailure` names how. `policyCanAdmit` is true when changing the answer to "A chip whose certificate no maker vouches for?" (or, for `revoked`, "A chip its maker has revoked?") to admit would let this device enroll.Retry on `chain_fetch_failed`; otherwise not retriable for this device under this policy.
unrecognised_ek_key400The endorsement public key is neither RSA nor ECC, or is ECC on the TPM ceremony, which seals to RSA.Start enrollment again from EnrollBegin.
secure_enclave_key_rejected400The macOS enroll relay carried a key that is not a well-formed P-256 point.Start enrollment again from EnrollBegin.
app_attest_rejected400The iOS attestation object did not validate against Apple's root, or the key is already another tenant's installation.Generate a new App Attest key and enroll again.
unknown_platform400The platform field names nothing the TPM ceremony serves.Send windows, linux, macos or ios.
platform_mismatch400The device is already recorded on another ceremony's platform; a TPM device cannot become a Secure Enclave or App Attest device.Not retriable for this device.
invalid_request400A request body that did not bind on any endpoint, or an enrollment or key-ceremony refusal with no code of its own; the message says what was wrong.Read the message.
invalid_purpose400/keys/challenge named a purpose that is not sign or decrypt.Pass purpose "sign" or "decrypt".
purpose_unsupported422/keys/certify received an iOS certification for a decrypt key challenge. An App Attest key only signs.Mint a sign key on iOS.
invalid_certification400The /keys/certify relay is malformed: a missing nonce, a certification that is none of the platform shapes, a macOS decrypt certification without devicePublicKey and deviceSignature, or a macOS sign certification that carries them.Relay the body MintKey produced, unchanged, with the nonce from /keys/challenge.
certification_rejected422The certification did not verify: the signature is not by a live installation of yours, the certified name does not match the public area, the template does not fit the purpose, the device fails the key's identity policy, or it is not a device the challenge named. One answer for all.Enroll if the installation is not yours; otherwise mint again on a device the policy admits.
key_rotation_conflict409Two mints for the same installation and purpose raced; the other one completed first.Mint again.
key_write_failed500The certification verified but the key could not be recorded.Retry with backoff; if it persists, contact support with the request.
key_disclosure_too_low422The key's disclosure ceiling is below pseudonymous, so a certify could never return a keyId. Answered on /keys/challenge and again on /keys/certify.Raise the key's ceiling in the dashboard, or mint under a key whose ceiling is pseudonymous or higher.
expected_unknown422expectedKey names a keyId, or expectedDevices a device id, that your account has not enrolled or certified.Pass only ids you kept from /attest/activate, a verdict, or /keys/certify.
platform_rotation_blocked422The device would switch operating system, and the key's policy refuses a switch between Windows and Linux.Not retriable under this policy. Allow the switch in the policy if a dual-boot machine should enroll from both.
platform_rotation_rate_exceeded422The device has switched operating system more often than the key's posture policy allows in its window.Wait out the window, or raise the policy's limit on switches between Windows and Linux.
unknown_policy422A policy bound to the key no longer exists. Nothing is substituted.Rebind the key to a preset or to a policy you created.
posture_not_bound422The challenge asked for posture on a key that carries no posture policy.Bind a posture policy to the key (Pro), or ask for identity only.
plan_lapsed402The key's posture policy blocks posture checks while the plan does not cover them.Restore the plan, or answer the policy's "If the Pro plan lapses?" with Identity only.
admission_refused422Enrollment ran admission under the key's identity policy and the device is not accepted. Refused before the credential is issued, so no elevation prompt is spent.Not retriable for this device and policy. Tell the user the device is not eligible, or bind the key to a policy that admits it.
challenge_expired_or_used409Unknown, foreign, expired (about five minutes) or already-consumed nonce, on /attest/verify or /keys/certify.Mint a fresh challenge and re-run the client. Never reuse a nonce.
budget_exhausted429This device is new this month and would cost more than the key's budget allows past the included devices. Answered on activate, the one-leg iOS enroll, verify and certify; already-active devices keep working. The body names the budget.Raise the budget's limit or move the key to another budget. The response carries the `budget-exhausted` quota header.
rate_limited429A per-IP or per-session window is exhausted. Carries retryAfterSeconds and a Retry-After header; no X-RootHerald-Quota header.Wait Retry-After seconds and resend. The plan is not involved.
metering_unavailable500A billable route had no resolvable tenant, or usage metering failed. Fails closed rather than serving an unmetered attestation.Retry with backoff; if it persists, contact support with the request.

The native SDKs' own return values are a different layer, on the status codes page.

Transport failures and retries

TLS 1.2+ at rootherald.io. A handshake, reset or timeout surfaces from your HTTP client, not as a Root Herald body; there is no numeric transport-code space. Keep the CA store current and do not pin the leaf certificate.

  • Retry with exponential backoff: transport failures, metering_unavailable, key_write_failed, and 429 honouring Retry-After.
  • Fix the request: invalid_secret_key, invalid_evidence, invalid_ask, invalid_purpose, invalid_certification, policy_bound_to_key, posture_not_bound, expected_unknown, invalid_request. Update the SDKs: wire_version_unsupported. Rebind the key: unknown_policy.
  • Mint a fresh challenge: challenge_expired_or_used, key_rotation_conflict. Raise the budget: budget_exhausted. The same device under the same policy: admission_refused and certification_rejected again.

Stability and deprecation

The base path is /api/v1/ and v1 is additive-only: new endpoints, new response fields and new optional request fields may ship at any time; a new required request field, a removed or renamed response field, or a change in a field's meaning waits for v2. Errors are stable string identifiers.

A deprecation is signalled in the response before anything is removed. Deprecated endpoints and fields carry the standard headers:

Deprecation: Tue, 17 Nov 2026 00:00:00 GMT
Sunset: Mon, 15 Feb 2027 00:00:00 GMT
Link: <https://rootherald.io/changelog/2026-11-deprecation>; rel="deprecation"

Diff your SDK's wire version against /api/v1/openapi.json to catch drift.

Rate limits

Per-IP and per-session fixed windows return 429 with Retry-After; the SDKs surface it as a rate-limited error carrying the delay, and your code retries. There is no published throughput SLA; high-volume needs are a conversation.