Skip to main content
POST
Create a challenge
string
required
Bearer hrtc_sk_…
string
default:"phone"
phone, the default: the page runs the ceremony on the device that opens it. desktop: the page shows a QR code that hands off to a phone.
string
Your server-chosen account handle, up to 128 characters. An existing account asserts with one of its stored credentials. A new account registers a credential. Omit it for an anonymous ceremony. Widget cdata does not select an account.
integer
default:"600"
120 to 900.
Use this endpoint when your backend decides to request a phone challenge. The widget creates challenges automatically. Read the outcome at GET /v1/challenge/{challenge_id}.

Request

Response

Save challenge_id with the pending action and its server session before returning the URL. Anyone with url can open this challenge. Keep it out of logs and analytics. A callback prompts your backend to read the saved challenge. It does not authorize the action. The first ceremony creates a passkey and then asks for a confirmation with that passkey. Later ceremonies for the same named account authenticate with a stored credential.

Show the ceremony

As a modal on your page. With guard.js loaded:
The frame closes when the ceremony reaches an outcome, then callback runs. On a phone the frame fills the screen. On a desktop it shows the QR hand-off and closes when the phone finishes. heretic.closeChallenge(id) closes it as a dismissal. In your own frame. Any origin may frame the page. Give the frame these permissions:
At an outcome the page posts { source: "heretic", type: "heretic-challenge", challenge_id, status, step_reached } to its parent. Check event.origin === "https://heretic.tech". As a redirect. Send the visitor to url and bring them back yourself. Use the browser callback to notify your backend, then read the saved challenge ID before completing the action.

Status codes

Creating a challenge does not consume a challenge unit. Usage starts once an accepted QR scan or explicit same-device Begin action initiates the attempt. Repeated scans and retries within the same challenge count once. See pricing.